:root {
  color-scheme: light dark;
  --page-top: #dde7fb;
  --page-middle: #eef3fa;
  --page-bottom: #f6f9fc;
  --surface: rgb(255 255 255 / 0.94);
  --surface-strong: #ffffff;
  --surface-inset: #f3f3fb;
  --surface-dock: #ebedf9;
  --surface-border: #f2f4fa;
  --surface-shadow: rgb(213 223 237 / 0.82);
  --ink: #43536c;
  --content-accent: #556397;
  --muted: #7b8997;
  --sky: #4cc8ff;
  --sky-label: #0073cc;
  --leaf: #0fea94;
  --leaf-label: #007c69;
  --gold: #ffd100;
  --gold-label: #bd4e04;
  --coral: #ff5553;
  --coral-label: #af0036;
  --drop-shadow: rgb(0 0 0 / 0.1);
  --focus-ring: rgb(76 200 255 / 0.42);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-top: #0d1118;
    --page-middle: #111722;
    --page-bottom: #141b25;
    --surface: rgb(21 27 36 / 0.92);
    --surface-strong: #1a212b;
    --surface-inset: #202733;
    --surface-dock: #141826;
    --surface-border: #2d3542;
    --surface-shadow: rgb(5 7 13 / 0.62);
    --ink: #d4d9dc;
    --content-accent: #aeb9e6;
    --muted: #94a0aa;
    --sky: #7bb2ff;
    --sky-label: #062342;
    --leaf: #48e6a8;
    --leaf-label: #06291f;
    --gold: #ffd75f;
    --gold-label: #3d2f00;
    --coral: #ff7775;
    --coral-label: #3c0714;
    --drop-shadow: rgb(0 0 0 / 0.28);
    --focus-ring: rgb(123 178 255 / 0.38);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: linear-gradient(180deg, var(--page-top), var(--page-middle) 42%, var(--page-bottom));
}

body {
  background:
    radial-gradient(circle at 16% 18%, rgb(255 255 255 / 0.48), rgb(255 255 255 / 0) 30rem),
    linear-gradient(180deg, var(--page-top), var(--page-middle) 42%, var(--page-bottom));
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
p,
strong,
a {
  overflow-wrap: anywhere;
}

.shell {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: clamp(20px, 5vw, 72px);
}

.workspace {
  display: grid;
  gap: clamp(22px, 4vw, 44px);
  grid-template-columns: minmax(0, 0.92fr) minmax(336px, 0.88fr);
  margin: 0 auto;
  max-width: 1120px;
  width: 100%;
}

.intro {
  align-self: center;
  display: grid;
  gap: 16px;
  padding-block: 14px;
}

.brand {
  align-items: center;
  color: var(--content-accent);
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  gap: 10px;
  justify-self: start;
  min-height: 44px;
  text-decoration: none;
}

.brand-icon {
  border-radius: 10px;
  box-shadow: 0 2px 0 var(--drop-shadow), 0 12px 26px rgb(76 200 255 / 0.24);
  display: block;
  height: 36px;
  width: 36px;
}

.eyebrow {
  color: var(--sky-label);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

h1 {
  color: var(--content-accent);
  font-size: clamp(42px, 7vw, 76px);
  letter-spacing: 0;
  line-height: 1.14;
  margin: 0;
  max-width: 9.6ch;
}

.lede {
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.7;
  margin-bottom: 0;
  max-width: 36rem;
}

.upload-panel,
.login-panel,
.result {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.74), 0 18px 44px var(--surface-shadow);
}

.upload-panel,
.login-panel {
  align-self: center;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
}

.panel-heading {
  display: grid;
  gap: 10px;
}

.login-panel h2 {
  color: var(--content-accent);
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: 0;
  line-height: 1.16;
  margin: 0;
}

.panel-copy {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.help-link {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--sky-label);
  cursor: pointer;
  display: inline-flex;
  font-weight: 760;
  gap: 7px;
  justify-self: start;
  min-height: 32px;
  padding: 0;
}

.help-link span {
  align-items: center;
  background: var(--surface-inset);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  display: inline-grid;
  font-size: 13px;
  font-weight: 900;
  height: 22px;
  place-items: center;
  width: 22px;
}

.qr-box {
  align-items: center;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0)),
    var(--surface-inset);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  display: grid;
  min-height: 286px;
  overflow: hidden;
  padding: 18px;
  place-items: center;
  position: relative;
}

.qr-box img {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgb(67 83 108 / 0.14);
  display: block;
  height: min(240px, 68vw);
  padding: 12px;
  width: min(240px, 68vw);
}

.qr-box img:not([src]),
.qr-box img[src=""] {
  display: none;
}

.qr-refresh-overlay {
  align-items: center;
  background: rgb(243 243 251 / 0.82);
  border: 0;
  border-radius: 0;
  color: var(--content-accent);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  inset: 0;
  justify-content: center;
  padding: 0;
  position: absolute;
  z-index: 2;
}

.qr-refresh-overlay svg {
  display: block;
  height: 34px;
  width: 34px;
}

.qr-refresh-overlay path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.qr-refresh-overlay span {
  font-size: 16px;
  font-weight: 800;
}

.actions {
  display: grid;
  gap: 10px;
}

.session-row,
.retention-row,
.file-row,
.notice-row,
.share-url-row {
  align-items: center;
  background: var(--surface-inset);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.session-row span,
.retention-row strong,
.file-name {
  color: var(--ink);
  font-weight: 760;
}

.retention-row small {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
  line-height: 1.42;
  margin-top: 3px;
}

.retention-row select {
  appearance: none;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.86), rgb(255 255 255 / 0)),
    var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  min-width: 116px;
  padding: 0 34px 0 12px;
  position: relative;
}

.retention-row {
  position: relative;
}

.retention-row::after {
  border-bottom: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  content: "";
  height: 7px;
  pointer-events: none;
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-58%) rotate(45deg);
  width: 7px;
}

.drop-zone {
  align-items: center;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0)),
    var(--surface-inset);
  border: 1.5px dashed rgb(85 99 151 / 0.24);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  min-height: 220px;
  padding: 28px;
  place-items: center;
  position: relative;
  text-align: center;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.drop-zone:focus-within,
.drop-zone.is-dragging {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0)),
    rgb(76 200 255 / 0.12);
  border-color: rgb(0 115 204 / 0.52);
  box-shadow: 0 0 0 4px var(--focus-ring);
  transform: translateY(-1px);
}

.drop-zone input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
}

.drop-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  pointer-events: none;
}

.drop-icon {
  align-items: center;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0)),
    var(--leaf);
  border-radius: 16px;
  box-shadow: 0 2px 0 var(--drop-shadow);
  color: var(--leaf-label);
  display: inline-grid;
  font-size: 34px;
  font-weight: 800;
  height: 64px;
  line-height: 1;
  place-items: center;
  width: 64px;
}

.drop-copy strong {
  color: var(--content-accent);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.24;
}

.drop-copy span:not(.drop-icon),
.status,
.file-meta,
.result-meta,
.result-kicker,
.notice-row p {
  color: var(--muted);
  line-height: 1.5;
}

.file-row {
  align-items: center;
}

.file-row > div {
  min-width: 0;
}

.file-name {
  display: block;
}

.file-meta {
  display: block;
  font-size: 0.9rem;
  margin-top: 4px;
}

.notice-row {
  align-items: flex-start;
  justify-content: flex-start;
}

.notice-row span {
  align-items: center;
  background: var(--gold);
  border-radius: 999px;
  color: var(--gold-label);
  display: inline-grid;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 22px;
  place-items: center;
  text-transform: uppercase;
  width: 22px;
}

.notice-row p {
  font-size: 0.93rem;
  margin: 0;
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 18px;
}

.primary-button {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.54), rgb(255 255 255 / 0)),
    var(--sky);
  box-shadow: 0 2px 0 var(--drop-shadow), 0 14px 26px rgb(76 200 255 / 0.2);
  color: var(--sky-label);
  font-weight: 800;
  min-height: 58px;
}

.secondary-button {
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.64), rgb(255 255 255 / 0)),
    var(--surface-strong);
  border: 1px solid var(--surface-border);
  box-shadow: 0 1.5px 0 var(--drop-shadow);
  color: var(--content-accent);
  flex: 0 0 auto;
  font-weight: 750;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover {
  filter: saturate(1.04) brightness(1.01);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.text-button {
  background: transparent;
  color: var(--sky-label);
  font-weight: 760;
  padding: 0 4px;
}

button:focus-visible,
select:focus-visible,
.brand:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.status {
  min-height: 1.5em;
  margin: 0;
}

.login-status {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.status.is-error {
  color: var(--coral-label);
  font-weight: 760;
}

.result {
  display: grid;
  gap: 18px;
  grid-column: 2;
  padding: clamp(18px, 3vw, 28px);
}

.result h2 {
  color: var(--content-accent);
  font-size: clamp(58px, 9vw, 92px);
  letter-spacing: 0.02em;
  line-height: 0.95;
  margin: 6px 0 0;
}

.result-kicker {
  margin: 8px 0 0;
}

.share-url-row {
  align-items: stretch;
  padding: 10px;
}

.share-url-row a {
  align-items: center;
  color: var(--ink);
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 2px 4px;
  text-decoration-color: var(--sky-label);
}

.result-meta {
  font-size: 0.94rem;
  margin: 0;
}

.help-modal {
  background: transparent;
  border: 0;
  color: var(--ink);
  max-width: min(92vw, 440px);
  padding: 0;
}

.help-modal::backdrop {
  background: rgb(13 17 24 / 0.32);
  backdrop-filter: blur(12px);
}

.help-modal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.74), 0 18px 44px var(--surface-shadow);
  display: grid;
  gap: 18px;
  padding: 20px;
}

.help-modal-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.help-modal-heading h2 {
  color: var(--content-accent);
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-grid;
  height: 36px;
  padding: 0;
  place-items: center;
  width: 36px;
}

.icon-button svg,
.scan-icon svg {
  display: block;
  height: 22px;
  width: 22px;
}

.icon-button path,
.scan-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.scan-steps {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scan-steps li {
  align-items: center;
  background: var(--surface-inset);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.55;
  padding: 14px;
}

.step-number {
  align-items: center;
  background: var(--sky);
  border-radius: 999px;
  color: var(--sky-label);
  display: inline-grid;
  font-size: 14px;
  font-weight: 900;
  height: 28px;
  place-items: center;
  width: 28px;
}

.scan-icon {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  color: var(--content-accent);
  display: inline-grid;
  height: 32px;
  margin-inline: 4px;
  place-items: center;
  vertical-align: middle;
  width: 32px;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at 16% 18%, rgb(174 185 230 / 0.18), rgb(174 185 230 / 0) 30rem),
      linear-gradient(180deg, var(--page-top), var(--page-middle) 42%, var(--page-bottom));
  }

  .upload-panel,
  .login-panel,
  .result {
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.04), 0 18px 44px var(--surface-shadow);
  }

  .help-modal-card {
    box-shadow: 0 1px 0 rgb(255 255 255 / 0.04), 0 18px 44px var(--surface-shadow);
  }

  .qr-box img {
    box-shadow: 0 10px 28px rgb(5 7 13 / 0.42);
  }
}

@media (max-width: 820px) {
  .shell {
    align-items: stretch;
    padding: 20px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .intro {
    padding-block: 4px;
  }

  h1 {
    max-width: 10ch;
  }

  .result {
    grid-column: auto;
  }

  .share-url-row,
  .retention-row,
  .file-row {
    align-items: stretch;
    display: grid;
  }

  .retention-row::after {
    bottom: 27px;
    top: auto;
  }
}

@media (max-width: 480px) {
  .shell {
    padding: 16px;
  }

  .upload-panel,
  .login-panel,
  .result {
    border-radius: 16px;
  }

  h1 {
    font-size: 40px;
    line-height: 1.18;
  }

  .lede {
    font-size: 17px;
    line-height: 1.62;
  }

  .drop-zone {
    min-height: 190px;
    padding: 22px 16px;
  }

  .qr-box {
    min-height: 236px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
