/* Share Anything — one stylesheet, themed entirely through custom properties. */

:root {
  --bg: #f5f6fb;
  --glow: rgb(109 94 248 / 13%);
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #e8eaf2;
  --border: #e1e4ee;
  --border-strong: #cdd2e1;
  --text: #121628;
  --muted: #5a6178;
  --accent: #5b4ff5;
  --accent-hover: #4a3fe0;
  --accent-soft: #eeecff;
  --accent-text: #4a3ed6;
  --on-accent: #ffffff;
  --success: #0f7b53;
  --success-soft: #e2f5ec;
  --danger: #c92a37;
  --danger-soft: #fdecee;
  --warning: #9a5600;
  --warning-soft: #fff3de;
  --shadow: 0 1px 2px rgb(16 20 40 / 6%), 0 10px 30px -12px rgb(16 20 40 / 16%);
  --shadow-lift: 0 2px 4px rgb(16 20 40 / 8%), 0 18px 40px -14px rgb(16 20 40 / 24%);
  --radius: 18px;
  --radius-sm: 11px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f17;
    --glow: rgb(139 131 255 / 14%);
    --surface: #161925;
    --surface-2: #1c2030;
    --surface-3: #262b3f;
    --border: #272c3f;
    --border-strong: #3a4058;
    --text: #e9ebf5;
    --muted: #9ba2bb;
    --accent: #8b83ff;
    --accent-hover: #a39dff;
    --accent-soft: #25234a;
    --accent-text: #b4aeff;
    --on-accent: #0d0f17;
    --success: #43d197;
    --success-soft: #11291f;
    --danger: #ff6b77;
    --danger-soft: #36161b;
    --warning: #f5b454;
    --warning-soft: #2f2310;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 14px 34px -14px rgb(0 0 0 / 70%);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 45%), 0 20px 44px -14px rgb(0 0 0 / 75%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0f17;
  --glow: rgb(139 131 255 / 14%);
  --surface: #161925;
  --surface-2: #1c2030;
  --surface-3: #262b3f;
  --border: #272c3f;
  --border-strong: #3a4058;
  --text: #e9ebf5;
  --muted: #9ba2bb;
  --accent: #8b83ff;
  --accent-hover: #a39dff;
  --accent-soft: #25234a;
  --accent-text: #b4aeff;
  --on-accent: #0d0f17;
  --success: #43d197;
  --success-soft: #11291f;
  --danger: #ff6b77;
  --danger-soft: #36161b;
  --warning: #f5b454;
  --warning-soft: #2f2310;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 14px 34px -14px rgb(0 0 0 / 70%);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 45%), 0 20px 44px -14px rgb(0 0 0 / 75%);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1100px 520px at 50% -220px, var(--glow), transparent 72%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-underline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.offscreen {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ------------------------------------------------------------------ page chrome */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 4px 10px rgb(109 94 248 / 35%));
}

.topnav {
  display: flex;
  gap: 6px;
}

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  flex: 1;
  outline: none;
}

.site-footer {
  padding: 18px 16px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: inherit;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

a.btn.primary,
.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 16px -8px var(--accent);
}

a.btn.primary:hover,
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent-text);
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn.danger-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.btn.danger-ghost:hover,
.btn.danger-ghost.armed {
  background: var(--danger-soft);
}

.btn.done {
  color: var(--success);
  border-color: var(--success);
}

.btn.primary.done {
  background: var(--success);
  color: #fff;
}

.btn.small {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.85rem;
}

.btn.large {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------------ cards and notices */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero {
  padding: 26px 4px 22px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 5.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.notice > .icon {
  margin-top: 2px;
  color: var(--warning);
}

.form-error {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 500;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 28px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-head .muted {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ------------------------------------------------------------------ composer */

.composer {
  padding: 18px;
}

.share-text {
  display: block;
  width: 100%;
  min-height: 150px;
  max-height: 60vh;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.share-text::placeholder {
  color: var(--muted);
  font-family: var(--font);
  font-size: 1rem;
}

.share-text:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-note {
  margin-top: 8px;
  color: var(--warning);
  font-size: 0.85rem;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.88rem;
}

.file-chip .thumb,
.file-chip .file-icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
}

.file-chip .thumb {
  object-fit: cover;
  background: var(--surface-3);
}

.file-icon {
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.file-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.file-chip-size {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.file-chip .icon-btn {
  width: 30px;
  height: 30px;
}

.attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 10px 0 4px;
}

.attach-row .btn.ghost {
  padding-left: 10px;
  padding-right: 12px;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 14px;
  margin: 14px 0 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field select,
.field input,
.gate-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select:focus,
.field input:focus,
.gate-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field select:disabled {
  opacity: 0.5;
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 44px;
}

.password-input .icon-btn {
  position: absolute;
  top: 2px;
  right: 2px;
}

.composer.link-only .options .field:has(select) {
  opacity: 0.55;
}

.toggle {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background-color 0.2s, border-color 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle input:disabled + .toggle-track {
  opacity: 0.7;
}

.toggle-text {
  font-size: 0.93rem;
}

.toggle-text small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.summary {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.summary.over {
  color: var(--danger);
}

.submit-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.shortcut {
  color: var(--muted);
  font-size: 0.8rem;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.drop-overlay-inner {
  display: grid;
  place-items: center;
  gap: 10px;
  width: min(520px, 100%);
  padding: 56px 24px;
  border: 2px dashed var(--accent);
  border-radius: 24px;
  background: var(--surface);
  color: var(--accent-text);
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
}

.drop-overlay-inner .icon {
  width: 36px;
  height: 36px;
}

/* ------------------------------------------------------------------ progress */

.progress-card {
  margin-top: 24px;
  text-align: center;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.progress-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.progress {
  height: 10px;
  margin: 22px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #b04fe0);
  transition: width 0.2s ease-out;
}

.progress-status {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.progress-card .actions {
  justify-content: center;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ result */

.result {
  margin-top: 24px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.result-head h2 {
  margin: 0 0 2px;
  font-size: 1.35rem;
}

.result-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

.result-badge .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.link-row {
  display: flex;
  gap: 8px;
}

.link-field {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.link-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.link-row .btn {
  min-height: 48px;
}

.result-body {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin: 22px 0;
}

.qr-box {
  flex: none;
  margin: 0;
  text-align: center;
}

.qr {
  display: block;
  width: 176px;
  height: 176px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.qr-box figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

p.qr-box {
  max-width: 176px;
  font-size: 0.85rem;
}

.facts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.93rem;
}

.facts li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.facts .icon {
  margin-top: 3px;
  color: var(--accent-text);
}

/* ------------------------------------------------------------------ recent shares */

.recent-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.recent-item.gone {
  opacity: 0.6;
}

.recent-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.recent-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.recent-title:hover {
  text-decoration: underline;
}

.recent-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.recent-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ------------------------------------------------------------------ features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.feature {
  padding: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid var(--border);
}

.feature .icon {
  width: 22px;
  height: 22px;
  color: var(--accent-text);
}

.feature h3 {
  margin: 10px 0 4px;
  font-size: 0.98rem;
}

.feature p {
  color: var(--muted);
  font-size: 0.87rem;
}

/* ------------------------------------------------------------------ viewer */

.viewer {
  margin-top: 16px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--muted);
}

.viewer-head h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.viewer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.viewer-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.viewer-meta li:first-child {
  color: var(--success);
  font-weight: 600;
}

.burn-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text);
  font-size: 0.92rem;
}

.burn-note .icon {
  margin-top: 2px;
  color: var(--warning);
}

.text-block {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.text-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.text-actions {
  display: flex;
  gap: 6px;
}

.text-content {
  max-height: 70vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.link-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.link-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.link-card-body {
  flex: 1 1 260px;
  min-width: 0;
}

.link-card-host {
  font-weight: 700;
}

.link-card-url {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.link-card-actions {
  display: flex;
  gap: 8px;
}

.file-list-view {
  display: grid;
  gap: 10px;
}

.file-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.file-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
}

.file-head .file-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.file-progress {
  padding: 0 14px 12px;
}

.file-progress .progress {
  height: 6px;
  margin: 0;
}

.file-card .form-error {
  margin: 0 14px 12px;
}

.file-preview {
  padding: 0 14px 14px;
}

.file-preview > p {
  margin-top: 6px;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 480px;
  margin: 0 auto;
  border-radius: 10px;
  background:
    repeating-conic-gradient(var(--surface-3) 0 25%, transparent 0 50%) 50% / 20px 20px;
  cursor: zoom-in;
}

.preview-image.zoomed {
  max-height: none;
  cursor: zoom-out;
}

.preview-media {
  display: block;
  width: 100%;
  max-height: 520px;
  border-radius: 10px;
  background: #000;
}

.preview-audio {
  width: 100%;
}

.preview-pdf {
  display: block;
  width: 100%;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.preview-text {
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.viewer-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.88rem;
}

/* ------------------------------------------------------------------ gate and problems */

.gate,
.problem {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 8px;
  text-align: center;
}

.gate h1,
.problem h1 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}

.gate-icon,
.problem-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.problem-icon {
  background: var(--surface-3);
  color: var(--muted);
}

.gate-icon .icon,
.problem-icon .icon {
  width: 28px;
  height: 28px;
}

.gate .burn-note {
  margin: 0;
  max-width: 460px;
  text-align: left;
}

.gate .muted,
.problem .muted {
  max-width: 460px;
}

.gate-row {
  display: flex;
  gap: 8px;
  width: min(420px, 100%);
}

.gate-row .gate-input {
  flex: 1;
  min-height: 48px;
}

.gate .form-error {
  margin-top: 0;
}

.problem .btn {
  margin-top: 8px;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: min(92vw, 520px);
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-kind="error"] {
  background: var(--danger);
  color: #fff;
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 600px) {
  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .hero {
    padding: 14px 2px 16px;
  }

  .result-body {
    flex-direction: column;
    align-items: stretch;
  }

  .qr-box {
    align-self: center;
  }

  .link-row {
    flex-direction: column;
  }

  .submit-group {
    width: 100%;
  }

  .submit-group .btn {
    flex: 1;
  }

  .shortcut,
  .hint {
    display: none;
  }

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

  .options .field:has(.password-input),
  .options .field:has(#opt-token) {
    grid-column: 1 / -1;
  }

  .recent-item {
    flex-wrap: wrap;
  }

  .recent-actions {
    margin-left: auto;
  }

  .file-head {
    flex-wrap: wrap;
  }

  .preview-pdf {
    height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
