/* WeTransfur — one stylesheet, no framework. Brand colours arrive as CSS variables from the layout. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces/fraunces-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --accent: #3b5bfd;
  --accent-text: #fff;
  --stage-bg: #14161c;
  --ink: #17181c;
  --ink-2: #4a4d57;
  --ink-3: #8a8d97;
  --line: #e6e7eb;
  --line-2: #f0f1f4;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --danger: #d93a3a;
  --success: #17a34a;
  --warning: #b7791f;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 12px 40px rgb(0 0 0 / .18);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05), 0 2px 8px rgb(0 0 0 / .06);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', ui-serif, Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.15rem;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s, opacity .15s;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-block { width: 100%; }
.btn-lg { min-height: 54px; font-size: 1.02rem; }
.btn-sm { min-height: 34px; padding: 0 .8rem; font-size: .85rem; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: #fadada; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-icon { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; background: transparent; }
.btn-icon:hover { background: var(--line-2); }

.field { display: block; margin-bottom: 1rem; }
.field > span, .label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .35rem; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: .65rem .9rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238a8d97' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: .3rem; }
.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; background: var(--surface); cursor: pointer; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span:first-child { display: inline-flex; align-items: center; gap: .5rem; }
.switch .track { flex: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .92rem; }
.alert-error { background: #fdecec; color: #9b1c1c; }
.alert-success { background: #e8f7ee; color: #146c35; }
.alert-info { background: #eef2ff; color: #2d3a8c; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: #e8f7ee; color: #146c35; }
.badge-warn { background: #fff4e0; color: #8a5a00; }
.badge-bad { background: #fdecec; color: #9b1c1c; }
.badge-accent { background: color-mix(in srgb, var(--accent) 14%, white); color: color-mix(in srgb, var(--accent) 80%, black); }

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1rem, 3vw, 2rem);
}
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo img { height: 34px; width: auto; max-width: 180px; object-fit: contain; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: .35rem; }
.nav a, .nav button.navbtn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 .9rem; border-radius: 99px; text-decoration: none; font-weight: 500; font-size: .92rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button.navbtn:hover { background: rgb(127 127 127 / .14); }
.nav a.active { background: rgb(127 127 127 / .16); font-weight: 600; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; z-index: 50; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; padding: .6rem .8rem; border-radius: 8px; text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; font-size: .92rem; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .menu-head { padding: .5rem .8rem .6rem; border-bottom: 1px solid var(--line-2); margin-bottom: .3rem; font-size: .82rem; color: var(--ink-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 0; cursor: pointer; }

/* ---------- Stage (wallpaper pages) ---------- */
.stage-page { min-height: 100vh; min-height: 100dvh; background: var(--stage-bg); color: #fff; overflow-x: hidden; }
.stage-page .topbar { color: #fff; text-shadow: 0 1px 12px rgb(0 0 0 / .25); }
.wallpaper { position: fixed; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(1200px 800px at 85% 15%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
  radial-gradient(900px 700px at 10% 90%, color-mix(in srgb, var(--accent) 30%, #000), transparent 60%),
  var(--stage-bg); }
.wallpaper .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.wallpaper .slide.on { opacity: 1; }
.wallpaper::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / .35), rgb(0 0 0 / 0) 45%), linear-gradient(0deg, rgb(0 0 0 / .35), transparent 30%); pointer-events: none; }
.wallpaper-caption { position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: 1.2rem; z-index: 5; font-size: .82rem; color: rgb(255 255 255 / .85); text-decoration: none; display: flex; align-items: center; gap: .4rem; text-shadow: 0 1px 8px rgb(0 0 0 / .4); }
.wallpaper-caption:hover { color: #fff; text-decoration: underline; }

.stage {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 400px) 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
  min-height: calc(100vh - 80px); min-height: calc(100dvh - 80px);
  padding: 1rem clamp(1rem, 4vw, 3.5rem) 5rem;
}
.hero { max-width: 620px; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.3rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 1rem; font-variation-settings: 'SOFT' 50, 'WONK' 0; text-wrap: balance; text-shadow: 0 2px 30px rgb(0 0 0 / .25); }
.hero p { font-size: clamp(1rem, 1.4vw, 1.2rem); color: rgb(255 255 255 / .86); margin: 0; max-width: 34rem; text-wrap: pretty; }

.card {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; position: relative;
  animation: rise .45s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .card, .wallpaper .slide { animation: none; transition: none; } }
.card-body { padding: 1.4rem; }
.card-foot { padding: 1rem 1.4rem 1.4rem; border-top: 1px solid var(--line-2); }
.card h2 { font-size: 1.35rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
.card .muted { color: var(--ink-3); }

/* ---------- Uploader ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .9rem; padding: 2.2rem 1.4rem 1.8rem; cursor: pointer; }
.add-circle { width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; border: 0; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.add-circle:hover { transform: scale(1.06) rotate(90deg); }
.dropzone h2 { margin: 0; font-size: 1.3rem; }
.dropzone p { margin: 0; color: var(--ink-3); font-size: .9rem; }
.dropzone .alt { display: flex; gap: 1rem; justify-content: center; font-size: .88rem; }

.filelist { list-style: none; margin: 0; padding: .4rem .6rem; max-height: min(38vh, 300px); overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--line-2); }
.fileitem { display: grid; grid-template-columns: 34px 1fr auto; gap: .7rem; align-items: center; padding: .55rem .5rem; border-radius: 10px; position: relative; }
.fileitem:hover { background: var(--surface-2); }
.fileitem .ficon { width: 34px; height: 34px; border-radius: 9px; background: var(--line-2); display: grid; place-items: center; color: var(--ink-2); }
.fileitem .fname { font-weight: 550; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem .fmeta { font-size: .78rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fileitem .fprog { position: absolute; left: .5rem; right: .5rem; bottom: 2px; height: 2px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.fileitem .fprog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }
.fileitem.done .fprog { display: none; }
.fileitem .fremove { opacity: .55; }
.fileitem:hover .fremove { opacity: 1; }
.fileitem.error .fmeta { color: var(--danger); }

.filesummary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1.2rem; font-size: .85rem; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.filesummary .add-more { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 1rem; }
.segmented button { min-height: 38px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 46px; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: text; }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.chips input { flex: 1; min-width: 120px; border: 0; outline: 0; padding: .3rem .3rem; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .25rem .2rem .6rem; border-radius: 99px; background: var(--line-2); font-size: .85rem; }
.chip.invalid { background: #fdecec; color: #9b1c1c; }
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--ink-3); }
.chip button:hover { background: rgb(0 0 0 / .08); color: var(--ink); }

.options-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .7rem 0; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.options-toggle .summary { margin-left: auto; margin-right: .4rem; font-weight: 500; color: var(--ink-3); font-size: .82rem; display: flex; gap: .4rem; align-items: center; }
.options-toggle svg { flex: none; transition: transform .2s; }
.options-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.options { padding-bottom: .5rem; }
.options .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* Progress / done states */
.progress-view { text-align: center; padding: 2.2rem 1.4rem 1.6rem; }
.ring { width: 168px; height: 168px; margin: 0 auto 1.2rem; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: var(--line-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s linear; }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; font-weight: 700; letter-spacing: -.02em; }
.ring .pct small { font-size: 1.1rem; font-weight: 600; color: var(--ink-3); }
.progress-view h2 { margin: 0 0 .25rem; }
.progress-view .stats { color: var(--ink-3); font-size: .88rem; }

.done-view { padding: 2rem 1.4rem 1.4rem; text-align: center; }
.done-check { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--success); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--success) 35%, transparent); display: grid; place-items: center; animation: pop .5s var(--ease) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.linkbox { display: flex; gap: .4rem; align-items: center; padding: .35rem .35rem .35rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 1.1rem 0 .8rem; }
.linkbox input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: .9rem; color: var(--ink-2); outline: none; }
.done-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.qr { display: block; width: 180px; height: 180px; margin: .8rem auto 0; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }

.dragover-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 80%, black 20%); color: var(--accent-text); opacity: 0; pointer-events: none; transition: opacity .15s; }
.dragover-overlay.on { opacity: .94; }
.dragover-overlay div { text-align: center; }
.dragover-overlay h2 { font-family: var(--display); font-size: clamp(2rem, 5vw, 3.6rem); margin: 1rem 0 0; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); z-index: 200; background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 99px; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Download page ---------- */
.dl-head { padding: 1.4rem 1.4rem 1rem; }
.dl-from { font-size: .85rem; color: var(--ink-3); margin-bottom: .3rem; }
.dl-head h1 { font-size: 1.45rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dl-meta { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); }
.dl-message { margin: .9rem 0 0; padding: .8rem .9rem; background: var(--surface-2); border-radius: 12px; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.dl-files { list-style: none; margin: 0; padding: .3rem .6rem; max-height: min(45vh, 380px); overflow-y: auto; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.dl-files .fileitem { grid-template-columns: 44px 1fr auto; }
.dl-files .thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--line-2); display: grid; place-items: center; color: var(--ink-2); overflow: hidden; border: 0; padding: 0; cursor: pointer; }
.dl-files .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dl-files .folder { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: .7rem .5rem .2rem; }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgb(8 9 12 / .92); display: grid; grid-template-rows: auto 1fr; color: #fff; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; }
.lightbox-bar .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-bar .btn-icon { color: #fff; }
.lightbox-bar .btn-icon:hover { background: rgb(255 255 255 / .12); }
.lightbox-body { display: grid; place-items: center; padding: 0 1rem 1rem; min-height: 0; }
.lightbox-body img, .lightbox-body video { max-width: 100%; max-height: calc(100dvh - 90px); border-radius: 8px; box-shadow: 0 20px 60px rgb(0 0 0 / .5); }
.lightbox-body audio { width: min(520px, 90vw); }
.lightbox .nav-prev, .lightbox .nav-next { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox .nav-prev { left: 1rem; }
.lightbox .nav-next { right: 1rem; }

/* ---------- App pages (management) ---------- */
.app-page .topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.container { max-width: 1120px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 4rem; }
.container.narrow { max-width: 560px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.02em; }
.page-head p { margin: .3rem 0 0; color: var(--ink-3); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 1.25rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 1.25rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; text-decoration: none; color: var(--ink-3); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--accent); }
.tabs .count { font-weight: 500; color: var(--ink-3); margin-left: .25rem; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfc; }
.table .title-cell { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .sub { font-size: .8rem; color: var(--ink-3); font-weight: 400; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.actions form { display: inline; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin: .8rem 0 .3rem; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem; }
.stat .k { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; }
.stat .s { font-size: .8rem; color: var(--ink-3); }
.meter { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; margin-top: .6rem; }
.meter i { display: block; height: 100%; background: var(--accent); }

.bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 140px; padding-top: .5rem; }
.bars .day { display: flex; gap: 1px; align-items: flex-end; height: 100%; position: relative; }
.bars .day i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .day i.t { background: var(--accent); }
.bars .day i.d { background: color-mix(in srgb, var(--accent) 35%, white); }
.bars-legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }
.bars-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--accent); }
.bars-legend span.d::before { background: color-mix(in srgb, var(--accent) 35%, white); }

.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; }
.side-nav { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 1rem; align-self: start; }
.side-nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.side-nav a:hover { background: var(--line-2); }
.side-nav a.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.side-nav .pill { margin-left: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }

.brand-card { display: grid; grid-template-columns: 120px 1fr auto; gap: 1.2rem; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.brand-card:last-child { border-bottom: 0; }
.brand-thumb { width: 120px; height: 72px; border-radius: 10px; background: var(--stage-bg); position: relative; overflow: hidden; display: grid; place-items: center; }
.brand-thumb img.wp { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brand-thumb .lg { position: relative; max-width: 70%; max-height: 40px; }
.wallpapers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.wallpaper-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.wallpaper-item .media { aspect-ratio: 16/9; background: #111; }
.wallpaper-item .media img, .wallpaper-item .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wallpaper-item form { padding: .7rem; }
.wallpaper-item .input { min-height: 36px; padding: .4rem .6rem; font-size: .85rem; margin-bottom: .4rem; }

.brand-preview { border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 16 / 9; max-height: 320px; width: 100%; margin: 0 auto; background: var(--stage-bg); color: #fff; }
.brand-preview .wp { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.brand-preview .mini { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); width: 26%; aspect-ratio: 3/4; background: #fff; border-radius: 8px; box-shadow: var(--shadow); display: grid; place-items: center; }
.brand-preview .mini i { width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.brand-preview .txt { position: absolute; left: 40%; top: 50%; transform: translateY(-50%); right: 6%; font-family: var(--display); font-size: clamp(.9rem, 2vw, 1.4rem); font-weight: 600; line-height: 1.1; text-shadow: 0 1px 10px rgb(0 0 0 / .4); }
.brand-preview .lg { position: absolute; left: 4%; top: 6%; height: 12%; max-width: 30%; object-fit: contain; }

.browser-list { list-style: none; margin: 0; padding: 0; }
.browser-list li { display: grid; grid-template-columns: 28px 30px 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem 1rem; border-bottom: 1px solid var(--line-2); }
.browser-list li:hover { background: #fafbfc; }
.browser-list a { text-decoration: none; font-weight: 550; }
.crumbs { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.crumbs a { color: var(--accent); text-decoration: none; font-weight: 600; }

.auth-wrap { min-height: calc(100dvh - 72px); display: grid; place-items: center; padding: 1rem 1rem 4rem; position: relative; z-index: 10; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; margin: 0 0 .3rem; letter-spacing: -.02em; }
.auth-card .lead { color: var(--ink-3); margin: 0 0 1.4rem; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; margin-top: 1rem; color: var(--ink-3); flex-wrap: wrap; }
.auth-links a { color: var(--ink-2); }

.copyable { display: flex; gap: .4rem; align-items: center; }
.copyable input { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .85em; }

.not-wetransfer { margin: .4rem 0 1.4rem; padding: .9rem 1rem 1rem; border-radius: 12px; background: #fff7e6; border: 1px solid #f3dfb5; color: #6b4a00; font-size: .88rem; }
.not-wetransfer strong { display: block; font-size: .95rem; margin-bottom: .25rem; color: #4d3500; }
.not-wetransfer p { margin: 0 0 .7rem; }
.not-wetransfer .btn { background: #fff; border-color: #ead29f; color: #4d3500; white-space: normal; text-align: left; }

/* Legal notice: quiet, but on every page. */
.legal-footer { position: relative; z-index: 10; padding: 1.5rem clamp(1rem, 3vw, 2rem) 1.25rem; font-size: .72rem; line-height: 1.5; color: var(--ink-3); }
.legal-footer p { margin: 0; max-width: 46rem; }
.legal-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-footer sup { font-size: .7em; }
.app-page .legal-footer { text-align: center; }
.app-page .legal-footer p { margin: 0 auto; }
.stage-page .legal-footer { position: fixed; left: 0; bottom: 0; padding: 0 clamp(1rem, 3vw, 2rem) 1.1rem; max-width: min(46rem, 60vw); color: rgb(255 255 255 / .62); text-shadow: 0 1px 6px rgb(0 0 0 / .5); }
.stage-page .legal-footer a:hover { color: #fff; }
.prose h2 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 .8rem; color: var(--ink-2); }

.footer-note { text-align: center; font-size: .8rem; color: var(--ink-3); padding: 2rem 1rem; }
.stage-page .footer-note { color: rgb(255 255 255 / .6); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stage-page .legal-footer { position: relative; max-width: none; padding-top: .5rem; }
  .stage { grid-template-columns: 1fr; align-items: start; gap: 1.5rem; min-height: 0; padding-top: .5rem; }
  .hero { order: 1; padding-bottom: 2rem; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.3rem); margin-bottom: .5rem; }
  .hero p { font-size: .98rem; }
  .card-wrap { max-width: 480px; width: 100%; margin: 0 auto; }
  .hero { text-align: left; max-width: 480px; width: 100%; margin: 0 auto; }
  .admin-layout { grid-template-columns: 1fr; gap: 1rem; }
  .side-nav { flex-direction: row; overflow-x: auto; position: static; }
  .side-nav a { white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .brand-card { grid-template-columns: 80px 1fr; }
  .brand-card .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .brand-thumb { width: 80px; height: 56px; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .6rem; }
  .table .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .nav .hide-sm { display: none; }
  .stage-page .topbar { padding-top: .8rem; padding-bottom: .4rem; }
  .card-body, .dl-head { padding: 1.1rem; }
  .options .row2 { grid-template-columns: 1fr; }
  .browser-list li { grid-template-columns: 28px 26px 1fr auto; }
  .browser-list li .hide-sm { display: none; }
}
