/* Digital Signage Portal: MirrorMeet design system, light mode.
   Same fonts, radii, hairline-border depth model and mint/amber accents as mm-styles.css.
   Light-mode changes (per the MirrorMeet handoff, 7.8): bright mint stays a FILL (dark text on it); text/links use a darker
   green and amber text uses a darker amber so both pass WCAG AA on white. */

@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url('/static/fonts/SpaceGrotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url('/static/fonts/SpaceGrotesk-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url('/static/fonts/SpaceGrotesk-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/static/fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('/static/fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/static/fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url('/static/fonts/IBMPlexSans-Bold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('/static/fonts/IBMPlexMono-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 600; font-display: swap; src: url('/static/fonts/IBMPlexMono-SemiBold.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-sunken: #eef0f3;
  --border: #d9dde3;
  --text: #14171c;
  --text-muted: #4f5766;
  --text-subtle: #5f6775;
  --accent: #2fd98a;            /* fills only (buttons, dots) */
  --accent-border: #1fb975;
  --accent-ink: #0a0b0d;        /* text on an accent fill */
  --accent-text: #0b7f4c;       /* links / text accents on light surfaces (AA) */
  --accent-tint: rgba(47, 217, 138, 0.16);
  --highlight: #f2a65a;
  --highlight-text: #9a5608;
  --highlight-tint: rgba(242, 166, 90, 0.16);
  --highlight-border: rgba(154, 86, 8, 0.35);
  --danger: #b42318;
  --ok: #0b7f4c;

  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 12px; --radius-xl: 14px; --radius-pill: 100px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font-sans); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.mute { color: var(--text-muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* brand / header */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img.logo { height: 36px; max-width: 160px; width: auto; object-fit: contain; display: block; }
.brand .name { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.15; }
.brand .name small { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); }
.mark rect { stroke: var(--accent-text); fill: none; stroke-width: 2; }
.mark circle { fill: var(--accent-text); }
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.top select { min-width: 250px; max-width: 100%; padding: 9px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg); font-size: 14px; }
.tabs { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.tab { background: none; border: 0; padding: 8px 12px; border-radius: var(--radius-md); color: var(--text-muted); font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.badge { background: var(--danger); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.who { color: var(--text-muted); font-size: 13px; }
.sub-note { background: var(--highlight-tint); border-bottom: 1px solid var(--highlight-border); color: var(--highlight-text); font-weight: 500; text-align: center; padding: 8px 16px; }
main { max-width: var(--container); margin: 0 auto; padding: 24px; }
footer.foot { text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); padding: 28px 0 40px; }

/* cards & text */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 18px; }
.card h2 { margin: 0 0 12px; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.eyebrow { display: inline-flex; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); }
.picbox { font-size: 11px; margin: 2px 0 0; gap: 4px; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; background: var(--surface-sunken); color: var(--text-muted); font-weight: 500; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-subtle); }
.chip.ok { color: var(--ok); } .chip.ok i { background: var(--accent); }
.chip.warn { color: var(--highlight-text); background: var(--highlight-tint); } .chip.warn i { background: var(--highlight); }
.chip.bad { color: var(--danger); } .chip.bad i { background: var(--danger); }
.note { background: var(--accent-tint); border: 1px solid rgba(11, 127, 76, .25); padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin-top: 12px; }
.note.warn { background: var(--highlight-tint); border-color: var(--highlight-border); }
.empty { color: var(--text-muted); padding: 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-sunken); padding: 1px 6px; border-radius: 5px; word-break: break-all; }
.err { color: var(--danger); margin-top: 10px; font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); font-weight: 600; padding: 8px 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn:hover { border-color: var(--accent-text); color: var(--accent-text); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent-border); color: var(--accent-ink); }
.btn.primary:hover { opacity: .9; color: var(--accent-ink); }
.btn.danger { color: var(--danger); } .btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 3px 10px; font-size: 12px; font-family: var(--font-sans); font-weight: 500; }
.btn.lg { padding: 13px 30px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.x { border: 0; background: none; color: var(--text-subtle); font-size: 18px; line-height: 1; padding: 4px 8px; }
.x:hover { color: var(--danger); }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.field label, .lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-subtle); }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, .input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); width: 100%; }
input:focus, select:focus { border-color: var(--accent-text); outline: none; box-shadow: 0 0 0 3px var(--accent-tint); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.check input { width: auto; accent-color: var(--accent-text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 14px; font-weight: 500; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.devs { display: flex; flex-wrap: wrap; gap: 6px; }
.cb { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.cb input { width: auto; accent-color: var(--accent-text); }

/* auth pages */
.auth { max-width: 400px; margin: 9vh auto 0; padding: 0 16px; }
.auth .card { padding: 26px; margin-top: 22px; }
.auth h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth .brand { justify-content: center; width: 100%; }
.auth .btn { width: 100%; margin-top: 18px; }

/* editor */
.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .opts { grid-template-columns: 1fr; } .top select { min-width: 0; width: 100%; } .tabs { margin-left: 0; } }
.preview { position: relative; background: #000; border-radius: var(--radius-md); overflow: hidden; width: 100%; border: 1px solid var(--border); }
.preview iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.list { display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.item { display: flex; gap: 10px; align-items: center; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); cursor: grab; }
.item.over { border-color: var(--accent-text); background: var(--accent-tint); }
.item img, .item .ph { width: 72px; height: 44px; object-fit: cover; border-radius: 5px; background: #000; flex: none; }
.item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item input[type=number] { width: 64px; padding: 4px 6px; }
.drop { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; color: var(--text-muted); margin-bottom: 14px; background: var(--surface); }
.drop.over { border-color: var(--accent-text); background: var(--accent-tint); color: var(--accent-text); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.tile .th { position: relative; aspect-ratio: 16/9; background: #111; cursor: zoom-in; }
.tile .th img, .tile .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tag { position: absolute; left: 6px; top: 6px; background: rgba(10, 11, 13, .72); color: #fff; font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.tile .meta { padding: 7px 9px; font-size: 12px; }
.tile .meta b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .acts { display: flex; gap: 4px; padding: 0 9px 9px; }
.bar { height: 6px; background: var(--surface-sunken); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-subtle); }
.tablewrap { overflow-x: auto; }
.modal { position: fixed; inset: 0; background: rgba(10, 11, 13, .72); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 24px; }
.modal .box { background: var(--surface); border-radius: var(--radius-xl); max-width: min(1100px, 100%); max-height: 100%; overflow: auto; padding: 16px; }
.modal img, .modal video { max-width: 100%; max-height: 78vh; display: block; margin: auto; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--radius-md); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
#toast.on { opacity: 1; }
.logo-prev { height: 56px; max-width: 220px; object-fit: contain; background: repeating-conic-gradient(var(--surface-sunken) 0 25%, var(--surface) 0 50%) 0 0/16px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px; }
.price { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -.02em; }

/* ── drag-and-drop editor: preview is the drop target ── */
.grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.preview.over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.drop-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; pointer-events: none;
  color: #fff; font-family: var(--font-display); font-size: 18px; font-weight: 500; background: rgba(10, 11, 13, .55); z-index: 2; padding: 16px; }
.drop-hint.show, .preview.over .drop-hint { display: flex; }
.preview.over .drop-hint::before { content: "Drop to add to this screen"; }
.preview.over .drop-hint { font-size: 0; }
.preview.over .drop-hint::before { font-size: 18px; }
.upl { margin-top: 8px; font-size: 13px; }
.ctl { display: grid; grid-template-columns: 150px 1fr; gap: 0 16px; align-items: end; margin-top: 4px; }
@media (max-width: 560px) { .ctl { grid-template-columns: 1fr; } }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 14px; }
.thumb { position: relative; border: 2px solid transparent; border-radius: var(--radius-md); background: var(--surface-sunken); cursor: grab; padding: 2px; }
.thumb.over { border-color: var(--accent-text); }
.thumb.sel { border-color: var(--accent-text); background: var(--accent-tint); }
.thumb .pic { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #111; border-radius: 7px; overflow: hidden; aspect-ratio: 16/9; cursor: pointer; }
.thumb .pic img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb .num { position: absolute; left: 4px; bottom: 4px; background: rgba(10, 11, 13, .75); color: #fff; font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 4px; }
.thumb .rm { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--danger);
  font-size: 15px; line-height: 1; padding: 0; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.thumb:hover .rm, .thumb:focus-within .rm, .thumb .rm:focus-visible { opacity: 1; }
@media (hover: none) { .thumb .rm { opacity: 1; width: 28px; height: 28px; top: -8px; right: -8px; } }   /* touch: always visible */
.thumb .ov { width: 100%; margin-top: 4px; padding: 3px 6px; font-size: 12px; }
.hold { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.lib { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 640px; overflow-y: auto; }

/* ── screens tab: resolution pickers; session-ended state ── */
.respick { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.respick .rp-sel { width: auto; max-width: 100%; }
.respick .rp-custom { display: inline-flex; align-items: center; gap: 4px; }
.respick .rp-custom[hidden] { display: none; }
.respick input[type=number] { width: 82px; }
select.rot { width: auto; }
body.ended .drop-hint, body.ended .drop { display: none !important; }
body.ended .preview { outline: none; }

/* ── per-file fit toggle; screens-tab sections ── */
.fitseg { display: flex; margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.fitseg button { flex: 1; border: 0; background: var(--surface); padding: 2px 4px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.fitseg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fitseg button[disabled] { cursor: default; }
h2.sect { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 22px 0 0; }
.modelpick { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.modelpick select { width: auto; }
.modelpick input[hidden] { display: none; }
[hidden] { display: none !important; }

/* ── narrow screens: this block must stay LAST so it wins over the desktop grid above ── */
.row > .grow { flex: 1 1 220px; }
.ctl .row { flex-wrap: wrap; }
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  main { padding: 16px 12px; }
  .top .wrap { padding-left: 12px; padding-right: 12px; }
  .lib { max-height: none; }
  .strip { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
}

/* weather slide thumbnail in the strip */
.wxthumb { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(160deg, #2b6fd6, #78b7ff); color: #fff; font-size: 11px; }
.wxthumb svg { width: 46%; height: 46%; }

.webthumb { background: linear-gradient(160deg, #4b5563, #9ca3af); }
.wxthumb b { max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
