/* Inspot – grafisk profil: mörkblå #063442, turkos #51CEBC, Sora */
@font-face { font-family: Sora; font-weight: 300; font-display: swap; src: url(/assets/brand/Sora-Light.ttf) format("truetype"); }
@font-face { font-family: Sora; font-weight: 400; font-display: swap; src: url(/assets/brand/Sora-Regular.ttf) format("truetype"); }
@font-face { font-family: Sora; font-weight: 600; font-display: swap; src: url(/assets/brand/Sora-SemiBold.ttf) format("truetype"); }
@font-face { font-family: Sora; font-weight: 700; font-display: swap; src: url(/assets/brand/Sora-Bold.ttf) format("truetype"); }

:root {
  --navy: #063442;
  --teal: #51CEBC;
  --lilac: #5B7BD6;
  --lilac-light: #D7DFF9;

  --bg: #F2F2F2;
  --surface: #ffffff;
  --surface-2: #edf2f3;
  --border: #dbe3e5;
  --text: #063442;
  --muted: #587480;
  --accent: #51CEBC;
  --accent-soft: rgba(81, 206, 188, .16);
  --accent-text: #063442;
  --link: #1c8a7b;
  --tag-bg: #D7DFF9;
  --tag-text: #34509f;
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --warn: #a35b06;
  --warn-soft: #fff1dc;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --side: #063442;
  --side-text: rgba(255, 255, 255, .82);
  --side-muted: rgba(255, 255, 255, .5);
  --shadow: 0 1px 2px rgba(6, 52, 66, .05), 0 1px 3px rgba(6, 52, 66, .07);
  --shadow-lg: 0 24px 60px -16px rgba(6, 52, 66, .35);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #031d25;
    --surface: #072a35;
    --surface-2: #0b3542;
    --border: #134454;
    --text: #ffffff;
    --muted: #9bb7bf;
    --accent-soft: rgba(81, 206, 188, .14);
    --link: #51CEBC;
    --tag-bg: rgba(91, 123, 214, .22);
    --tag-text: #c5d1f7;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --side: #021821;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Sora, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--link); }
svg { flex-shrink: 0; }
h1, h2, h3 { font-weight: 600; }
b, strong { font-weight: 600; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side);
  color: var(--side-text);
  padding: 26px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 190px;
  background: url(/assets/brand/grafiskt-element.svg) left bottom / 100% auto no-repeat;
  opacity: .35; pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.brand { padding: 0 12px 26px; }
.brand img { height: 30px; width: auto; display: block; }
.brand small { display: block; font-size: 11.5px; color: var(--teal); margin-top: 8px; letter-spacing: .04em; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--side-text); text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(81, 206, 188, .16); color: #fff; }
.nav-item.active svg { color: var(--teal); }
.nav-item .count { margin-left: auto; font-size: 11.5px; background: rgba(255, 255, 255, .1); padding: 0 8px; border-radius: 99px; }
.sidebar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex-shrink: 0; }
.me-name { color: #fff; font-size: 13px; line-height: 1.2; }
.me-role { color: var(--side-muted); font-size: 11.5px; }
.me button { margin-left: auto; background: none; border: 0; color: var(--side-muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.me button:hover { color: #fff; background: rgba(255, 255, 255, .08); }

main { padding: 34px 40px 120px; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
.page-head h1 .accent, .accent-word { color: var(--accent); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-weight: 300; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.section-title h2 { margin: 0; font-size: 16.5px; }
.section-title .meta { color: var(--muted); font-size: 12.5px; }
.section-title .actions { margin-left: auto; display: flex; gap: 8px; }
.rule { height: 2px; width: 44px; background: var(--accent); border-radius: 1px; margin: 10px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, transform .05s, opacity .15s, filter .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -.01em; margin-top: 2px; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- Banners ---------- */
.pending, .notice {
  border: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 28px;
}
.notice { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-style: solid; }
.notice .grow { flex: 1; min-width: 240px; }
.notice b { display: block; }
.notice span { color: var(--muted); font-size: 13px; }
.pending h3 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pending-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pending-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 9px 9px 9px 14px; box-shadow: var(--shadow);
}
.code { font-weight: 600; letter-spacing: .14em; font-size: 15px; }
.pending-item .sub { color: var(--muted); font-size: 12px; }
.email-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 13px; }
.email-chip button { border: 0; background: var(--surface-2); border-radius: 99px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }

/* ---------- Location sections ---------- */
.loc { margin-bottom: 34px; }
.loc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.loc-head h2 { font-size: 16.5px; margin: 0; }
.loc-head .meta { color: var(--muted); font-size: 12.5px; }
.loc-head .btn { margin-left: auto; }
.pin { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); display: grid; place-items: center; color: var(--teal); flex-shrink: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.empty {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent); font-weight: 300;
}
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 600; }

/* ---------- Screen card ---------- */
.screen {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  user-select: none;
}
.screen:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); transform: translateY(-1px); }
.screen.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.tv {
  aspect-ratio: 16 / 9; margin: 10px 10px 0; border-radius: 9px;
  background: var(--navy); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; color: #fff;
}
.tv > img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv.has-shot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(6, 52, 66, .85)); z-index: 1; }
.tv.has-content { background: var(--g); }
.tv .tv-label { position: relative; z-index: 2; font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv .tv-type { position: absolute; top: 10px; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; background: rgba(6, 52, 66, .6); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 99px; }
.tv.idle { align-items: center; justify-content: center; text-align: center; gap: 4px; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.tv.idle::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: url(/assets/brand/grafiskt-element.svg) left bottom / 100% auto no-repeat; opacity: .5; }
.tv.offline .tv-label, .tv.offline > img.shot { opacity: .45; }
.tv.offline::after { opacity: .2; }
.tv .rot { position: absolute; z-index: 3; font-size: 11px; background: rgba(6, 52, 66, .6); padding: 2px 7px; border-radius: 99px; }
.check {
  position: absolute; top: 18px; right: 18px; z-index: 4;
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, .8);
  background: rgba(6, 52, 66, .35); display: grid; place-items: center; transition: all .15s; opacity: 0; color: var(--navy);
}
.screen:hover .check, .screen.selected .check, body.selecting .check { opacity: 1; }
.screen.selected .check { background: var(--teal); border-color: var(--teal); }
.screen-body { padding: 12px 14px 13px; display: flex; align-items: center; gap: 8px; }
.screen-body .info { min-width: 0; flex: 1; }
.screen-name { font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa1b5; flex-shrink: 0; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- Selection bar ---------- */
.selbar {
  position: fixed; left: calc(50% + 124px); bottom: 24px; transform: translateX(-50%) translateY(140%);
  background: var(--navy); color: #fff; border-radius: 16px; padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); z-index: 40;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.2);
  width: max-content; max-width: calc(100vw - 32px); flex-wrap: wrap;
  border: 1px solid rgba(81, 206, 188, .3);
}
.selbar.show { transform: translateX(-50%) translateY(0); }
.selbar .n { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.selbar .btn { box-shadow: none; }
.selbar .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .08); color: #fff; }
.selbar .btn:not(.primary):hover { background: rgba(255, 255, 255, .16); }

/* ---------- Content cards ---------- */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin-bottom: 34px; }
.ccard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.thumb { aspect-ratio: 16 / 9; position: relative; overflow: hidden; background: var(--navy); }
.thumb iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; }
.thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .6); font-size: 12.5px; gap: 6px; align-content: center; text-align: center; }
.thumb .count { position: absolute; right: 10px; bottom: 10px; background: rgba(6, 52, 66, .75); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.ccard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ccard-title { display: flex; align-items: flex-start; gap: 8px; }
.ccard-title h3 { margin: 0; font-size: 15px; flex: 1; line-height: 1.35; word-break: break-word; }
.ccard .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ccard .row.end { margin-top: auto; padding-top: 4px; }
.ccard .by { margin-left: auto; color: var(--muted); font-size: 11.5px; text-align: right; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--tag-bg); color: var(--tag-text); }
.badge.teal { background: var(--accent-soft); color: var(--link); }

/* ---------- Panels / settings ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
.panel-head { padding: 18px 22px 0; }
.panel-head h2 { margin: 0; font-size: 15.5px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; font-weight: 300; }
.panel-body { padding: 16px 22px 20px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-grid > div > .panel:last-child { margin-bottom: 0; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { color: var(--muted); font-size: 12px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--teal); font-weight: 600; font-size: 12.5px; display: grid; place-items: center; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 13px; font-weight: 300; }
.cmd {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  background: var(--navy); color: #d9f5f1; border-radius: 10px; padding: 10px 10px 10px 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
}
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd .btn { height: 30px; background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; box-shadow: none; font-family: Sora, Arial, sans-serif; }
.log-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.log-row:first-child { border-top: 0; }
.log-row time { color: var(--muted); white-space: nowrap; width: 92px; flex-shrink: 0; font-size: 12px; padding-top: 1px; }
.google-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.google-status .g { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); flex-shrink: 0; }
.google-status .grow { flex: 1; min-width: 0; }
.google-status .sub { color: var(--muted); font-size: 12px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; font-weight: 300; }
.input, select.input {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.input.code-input { font-size: 20px; letter-spacing: .25em; text-transform: uppercase; height: 50px; text-align: center; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: none; }
.form-error.show { display: block; }
.callout { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.callout b { color: var(--text); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(3, 29, 37, .55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: fade .15s ease-out;
}
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.15);
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 4px; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 300; }
.modal-body { padding: 14px 22px 6px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s;
}
.pick:hover { background: var(--surface-2); }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; }
.pick .swatch { width: 56px; aspect-ratio: 16/9; border-radius: 6px; background: var(--g, var(--navy)); flex-shrink: 0; display: grid; place-items: center; color: #fff; overflow: hidden; position: relative; }
.pick .swatch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick .swatch.none { background: var(--navy); color: var(--teal); }
.pick .grow { flex: 1; min-width: 0; }
.pick .t { font-weight: 600; }
.pick .s { color: var(--muted); font-size: 12px; }
.pick-group { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; }
.pick-group:first-child { margin-top: 0; }
.pick-group button { margin-left: auto; background: none; border: 0; color: var(--link); cursor: pointer; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.preview-box { aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; position: relative; background: var(--navy); margin-bottom: 16px; }
.preview-box iframe { position: absolute; top: 0; left: 0; width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0; border: 0; }

/* ---------- Popover menu ---------- */
.menu {
  position: fixed; z-index: 90; min-width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .12s ease-out;
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; font-size: 13px; animation: pop .2s ease-out; max-width: 400px;
  border-left: 3px solid var(--teal);
}
.toast.error { background: var(--danger); border-left-color: #fff; }
.toast svg { color: var(--teal); }
.toast.error svg { color: #fff; }

.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Presentatörsläge ---------- */
body.presenting .app { grid-template-columns: 1fr; }
body.presenting .sidebar, body.presenting .selbar { display: none; }
body.presenting main { padding: 0; }
.presenter { min-height: 100vh; background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.p-head { display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.p-exit { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: #fff; font-weight: 600; cursor: pointer; }
.p-exit:hover { background: rgba(255, 255, 255, .08); }
.p-title { font-weight: 600; font-size: 16px; }
.p-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.p-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .08); border-radius: 99px; padding: 2px 10px; font-size: 11.5px; color: rgba(255, 255, 255, .85); }
.p-clock { margin-left: auto; text-align: right; font-size: 22px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.1; }
.p-clock small { display: block; font-size: 10.5px; color: rgba(255, 255, 255, .5); letter-spacing: .1em; text-transform: uppercase; }
.p-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; padding: 22px 22px 16px; align-items: start; }
.p-current { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; width: 100%; max-height: calc(100vh - 290px); margin: 0 auto; box-shadow: 0 24px 60px -24px #000; outline: 2px solid var(--teal); outline-offset: 3px; }
.p-current img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.p-live { position: absolute; top: 12px; left: 12px; background: var(--teal); color: var(--navy); font-weight: 700; font-size: 10.5px; padding: 3px 9px; border-radius: 99px; letter-spacing: .08em; }
.p-side { display: flex; flex-direction: column; gap: 10px; }
.p-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .55); }
.p-next { aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; position: relative; }
.p-next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.p-end { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-size: 13px; }
.p-tips { margin-top: 10px; font-size: 12px; line-height: 1.7; color: rgba(255, 255, 255, .55); font-weight: 300; }
.p-tips b { color: rgba(255, 255, 255, .85); font-weight: 600; }
.p-controls { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 22px 14px; }
.p-btn { height: 56px; min-width: 170px; border-radius: 14px; border: 0; font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255, 255, 255, .1); color: #fff; transition: background .15s, transform .05s; touch-action: manipulation; }
.p-btn:hover { background: rgba(255, 255, 255, .16); }
.p-btn:active { transform: translateY(1px); }
.p-btn.primary { background: var(--teal); color: var(--navy); }
.p-btn.primary:hover { background: #63d8c7; }
.p-btn:disabled { opacity: .3; cursor: default; }
.p-pos { min-width: 90px; text-align: center; font-size: 22px; font-weight: 600; }
.p-pos small { font-size: 14px; font-weight: 300; color: rgba(255, 255, 255, .6); }
.p-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 22px 22px; scrollbar-width: thin; }
.p-thumb { flex: 0 0 132px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; position: relative; border: 2px solid transparent; cursor: pointer; background: #000; padding: 0; opacity: .7; transition: opacity .15s, border-color .15s; }
.p-thumb:hover { opacity: 1; }
.p-thumb.on { border-color: var(--teal); opacity: 1; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb span { position: absolute; left: 6px; bottom: 4px; font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(6, 52, 66, .85); padding: 0 6px; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; z-index: 50; overflow-x: auto; }
  .sidebar::after { display: none; }
  .brand { padding: 0 10px 0 4px; }
  .brand img { height: 22px; }
  .brand small, .sidebar .spacer, .me .me-name, .me .me-role, .nav-item .count { display: none; }
  .nav-item span.label { display: none; }
  .me { border: 0; margin: 0 0 0 auto; padding: 0; }
  main { padding: 22px 16px 120px; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .selbar { left: 50%; }
  .row2 { grid-template-columns: 1fr; }
  /* Mobilen som fjärrkontroll */
  .p-head { padding: 12px 14px; gap: 12px; }
  .p-main { grid-template-columns: 1fr; padding: 14px; }
  .p-side { display: none; }
  .p-current { max-height: none; }
  .p-controls { padding: 0 14px 12px; gap: 10px; }
  .p-btn { min-width: 0; flex: 1; height: 64px; }
  .p-pos { min-width: 64px; }
  .p-strip { padding: 4px 14px 18px; }
  .p-thumb { flex-basis: 104px; }
}
