/* Publishing Studio dashboard. Light + dark, phone to desktop. */
:root {
  --bg: #f5f5f8; --surface: #ffffff; --surface-2: #f0f0f5; --line: #e3e3ea; --line-strong: #cfcfda;
  --text: #1b1b26; --text-2: #5c5c6e; --text-3: #8a8a9a;
  --accent: #5b5bd6; --accent-strong: #4a4ac4; --accent-soft: #ececfb; --on-accent: #fff;
  --ok: #18794e; --ok-soft: #e3f4ea; --warn: #9a5b00; --warn-soft: #fdf0d5; --bad: #c62a2f; --bad-soft: #fde8e8;
  --info: #0b68cb; --info-soft: #e4effc; --manual: #7a3fc4; --manual-soft: #f1e8fc; --muted-soft: #ececf1;
  --radius: 12px; --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 4px 16px rgba(20, 20, 40, .05);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101016; --surface: #191922; --surface-2: #21212c; --line: #2b2b38; --line-strong: #3b3b4b;
    --text: #ececf2; --text-2: #a9a9ba; --text-3: #77778a;
    --accent: #8e8eff; --accent-strong: #a3a3ff; --accent-soft: #26264a; --on-accent: #10101c;
    --ok: #55c78e; --ok-soft: #14301f; --warn: #f0b14e; --warn-soft: #382a10; --bad: #ff7b7b; --bad-soft: #3b1819;
    --info: #6eb2ff; --info-soft: #14283f; --manual: #c39bff; --manual-soft: #2a1d42; --muted-soft: #262631;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0; }
h3 { font-size: .8rem; margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
p { margin: 0 0 .75rem; }
small { color: var(--text-3); }
code, pre { font-family: var(--mono); font-size: .86em; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* --- Shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; padding: .25rem .5rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; min-width: 1.3rem; text-align: center; font-weight: 700; }
.nav .count.soft { background: var(--muted-soft); color: var(--text-2); }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 0 .6rem; font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: .78rem; color: var(--text-3); padding: 0 .6rem; display: flex; flex-direction: column; gap: .35rem; }
.main { padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 5rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .sub { color: var(--text-2); margin-top: .2rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: .55rem .9rem; margin-bottom: 1rem; font-weight: 500; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--info-soft); color: var(--info); }
.mobile-nav { display: none; }

/* --- Building blocks ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 1rem 1.1rem; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .body { padding: 1rem 1.1rem; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.empty { color: var(--text-3); padding: 1.25rem; text-align: center; }
.loading { color: var(--text-3); padding: 2rem; text-align: center; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: .45rem .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.small { padding: .25rem .6rem; font-size: .84rem; }
.btn.big { padding: .75rem 1.2rem; font-size: 1rem; }
.btn.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy { opacity: .6; }
button.icon { border: 0; background: transparent; color: var(--text-2); font-size: 1rem; cursor: pointer; padding: .3rem .5rem; border-radius: 6px; }
button.icon:hover { background: var(--surface-2); }

.badge { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 650; padding: .12rem .55rem; border-radius: 99px; white-space: nowrap; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-manual { background: var(--manual-soft); color: var(--manual); }
.tone-muted { background: var(--muted-soft); color: var(--text-2); }
.chan { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 .3rem; border-radius: 7px; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: -.02em; flex: none; }
.chan.small { min-width: 20px; height: 20px; font-size: .58rem; border-radius: 5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; flex: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: var(--ok); } .status-dot.new { background: var(--text-3); } .status-dot.failing, .status-dot.expired { background: var(--bad); } .status-dot.disabled { background: var(--line-strong); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .6rem; }
.tile { background: var(--surface-2); border-radius: 10px; padding: .65rem .8rem; }
.tile.tone-bad, .tile.tone-warn, .tile.tone-manual, .tile.tone-ok, .tile.tone-info { background: unset; }
.tile.tone-bad { background: var(--bad-soft); } .tile.tone-warn { background: var(--warn-soft); } .tile.tone-manual { background: var(--manual-soft); } .tile.tone-ok { background: var(--ok-soft); } .tile.tone-info { background: var(--info-soft); }
.tile-value { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.tile-label { font-size: .78rem; color: var(--text-2); }
.tile-hint { font-size: .72rem; color: var(--text-3); }
a.tile { color: inherit; display: block; }
a.tile:hover { text-decoration: none; outline: 2px solid var(--accent); }

.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1.1rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .55rem .8rem; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-strong); border-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: .5rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .8rem; }
.field .label { font-weight: 600; font-size: .86rem; }
.field em { color: var(--bad); font-style: normal; }
.field.check { flex-direction: row; align-items: center; gap: .5rem; flex-wrap: wrap; }
.field.check .label { order: 2; font-weight: 500; }
.field.check small { order: 3; flex-basis: 100%; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: .45rem .6rem; width: 100%; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-width: 140px; }

.overlay { position: fixed; inset: 0; background: rgba(10, 10, 20, .5); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(820px, 100%); }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal-body { padding: 1.1rem; overflow-y: auto; }
.modal > footer { padding: .8rem 1.1rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 99; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: .65rem .95rem; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; transition: opacity .35s, transform .35s; border: 1px solid var(--line); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* --- Publications ---------------------------------------------------------------- */
.pub-line { display: flex; align-items: center; gap: .7rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--line); color: inherit; }
.pub-line:last-child { border-bottom: 0; }
.pub-line:hover { background: var(--surface-2); text-decoration: none; }
.pub-main { min-width: 0; flex: 1; }
.pub-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-meta { font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-text { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: 10px; padding: .8rem .9rem; line-height: 1.5; }
.media-strip { display: flex; gap: .6rem; flex-wrap: wrap; }
.media-item { width: 132px; }
.media-item img, .media-item video, .media-file { width: 132px; height: 132px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); font-size: .8rem; }
.media-item .cap { font-size: .72rem; color: var(--text-3); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.block > header { display: flex; justify-content: space-between; align-items: center; padding: .4rem .7rem; background: var(--surface-2); font-weight: 600; font-size: .84rem; gap: .5rem; }
.block > div { padding: .7rem; white-space: pre-wrap; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 116px 1fr; gap: .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--text-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; word-break: break-word; }
.signal { padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--accent); }
.signal.up { border-color: var(--ok); } .signal.down { border-color: var(--bad); } .signal.time { border-color: var(--info); }
.signal b { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: .15rem; }
.spark { height: 40px; width: auto; max-width: 100%; display: block; }
.steps { margin: 0; padding-left: 1.2rem; }
.steps li { margin-bottom: .3rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.check-list li:last-child { border-bottom: 0; }

/* --- Project cards --------------------------------------------------------------- */
.project-card { display: flex; flex-direction: column; color: inherit; overflow: hidden; }
.project-card:hover { text-decoration: none; border-color: var(--line-strong); }
.project-card .bar { height: 5px; }
.project-card .inner { padding: .95rem 1.1rem 1.05rem; display: flex; flex-direction: column; gap: .75rem; }
.project-card h2 { font-size: 1.1rem; }
.chan-row { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.chan-wrap { position: relative; display: inline-flex; }
.chan-wrap .status-dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--surface); width: 11px; height: 11px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.mini-stats div { text-align: center; background: var(--surface-2); border-radius: 8px; padding: .4rem .2rem; }
.mini-stats b { display: block; font-size: 1.05rem; }
.mini-stats span { font-size: .7rem; color: var(--text-2); }
.mini-stats .alert b { color: var(--bad); }
.add-card { border-style: dashed; display: grid; place-items: center; min-height: 180px; color: var(--text-2); font-weight: 600; cursor: pointer; background: transparent; box-shadow: none; font: inherit; }
.add-card:hover { border-color: var(--accent); color: var(--accent); }

/* --- Calendar ---------------------------------------------------------------------- */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; }
.cal-head div { padding: .4rem .5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.cal-day.other { background: var(--bg); }
.cal-day.today .cal-date { background: var(--accent); color: var(--on-accent); }
.cal-date { font-size: .78rem; font-weight: 700; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.cal-item { display: flex; align-items: center; gap: .3rem; font-size: .76rem; padding: .12rem .3rem; border-radius: 6px; color: inherit; background: var(--surface-2); border-left: 3px solid var(--line-strong); overflow: hidden; white-space: nowrap; }
.cal-item:hover { text-decoration: none; filter: brightness(.96); }
.cal-item span.t { overflow: hidden; text-overflow: ellipsis; }
.cal-item time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-item.s-published, .cal-item.s-completed { opacity: .7; }
.cal-item.s-published .t::before, .cal-item.s-completed .t::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.cal-item.s-failed { background: var(--bad-soft); }
.cal-item.s-manual_pending { background: var(--manual-soft); border-left-style: dashed; }
.cal-item.s-pending_approval { background: var(--warn-soft); }
.cal-item.s-cancelled, .cal-item.s-skipped, .cal-item.s-rejected { opacity: .45; text-decoration: line-through; }
.cal-item.s-blocked { border-left-style: dotted; opacity: .75; }
.agenda-day { padding: .5rem 1.1rem .2rem; font-weight: 700; font-size: .85rem; color: var(--text-2); background: var(--surface-2); }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }

/* --- Marketing Studio: content cards, media library, brand ------------------------------ */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; align-items: start; }
.ms-card { overflow: hidden; display: flex; flex-direction: column; border-top: 3px solid var(--line-strong); }
.ms-card.s-ready { border-top-color: var(--warn); }
.ms-card.s-approved { border-top-color: var(--ok); }
.ms-card.s-rejected { border-top-color: var(--bad); opacity: .8; }
.ms-card.s-idea, .ms-card.s-archived { opacity: .75; }
.ms-card-body { padding: .75rem .9rem .85rem; display: flex; flex-direction: column; gap: .5rem; }
.ms-title { font-weight: 700; font-size: 1rem; color: var(--text); line-height: 1.3; }
.ms-delivery { border-top: 1px dashed var(--line); padding-top: .45rem; display: flex; flex-direction: column; gap: .25rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .86rem; color: var(--text-2); white-space: pre-line; }
.ms-actions { margin-top: .2rem; gap: .35rem; }
.ms-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.ms-thumb img, .ms-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-thumb.empty { color: var(--text-3); font-size: .82rem; aspect-ratio: 5 / 2; }
.media-item .ms-thumb { width: 220px; aspect-ratio: auto; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.media-item .ms-thumb img, .media-item .ms-thumb video { position: static; width: 220px; height: auto; max-height: 300px; object-fit: contain; }
.media-item:has(.ms-thumb) { width: 220px; }
.ms-thumb-tag { position: absolute; left: .45rem; bottom: .45rem; background: rgba(10, 10, 20, .7); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; max-width: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-thumb-tag.right { left: auto; right: .45rem; }
.ms-fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .9rem .2rem; margin: 0; }
.ms-fieldset legend { display: flex; align-items: center; gap: .3rem; font-weight: 650; padding: 0 .3rem; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg a { padding: .35rem .75rem; color: var(--text-2); font-weight: 600; font-size: .88rem; }
.seg a:hover { text-decoration: none; background: var(--surface-2); }
.seg a.active { background: var(--accent-soft); color: var(--accent-strong); }
.cal-item.ms-cal.s-ready { background: var(--warn-soft); }
.cal-item.ms-cal.s-approved { background: var(--ok-soft); }
.cal-item.ms-cal.s-draft, .cal-item.ms-cal.s-idea { background: var(--info-soft); }
.cal-item.ms-cal.s-rejected, .cal-item.ms-cal.s-archived { opacity: .5; text-decoration: line-through; }
.legend i.ms-legend.s-ready { background: var(--warn-soft); } .legend i.ms-legend.s-approved { background: var(--ok-soft); }
.legend i.ms-legend.s-draft, .legend i.ms-legend.s-idea { background: var(--info-soft); } .legend i.ms-legend.s-rejected { background: var(--muted-soft); }
.ms-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.ms-tile { font: inherit; color: inherit; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ms-tile:hover { border-color: var(--accent); }
.ms-tile-media { position: relative; aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.ms-tile-media img, .ms-tile-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-tile-media .media-file { border: 0; width: 100%; height: 100%; border-radius: 0; }
.ms-tile-cap { padding: .5rem .65rem .6rem; display: flex; flex-direction: column; gap: .1rem; font-size: .78rem; color: var(--text-2); min-width: 0; }
.ms-tile-cap b { color: var(--text); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-tile-cap .warn { color: var(--warn); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem .8rem; }
.swatch { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: .5rem; align-items: center; font-size: .8rem; }
.swatch i { grid-row: span 2; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-strong); }
.swatch span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-logo { width: 132px; height: 132px; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.ms-logo img { max-width: 86%; max-height: 86%; }
.md p { margin: 0 0 .55rem; }
.md h2 { font-size: 1.15rem; }
.md h4 { font-size: .95rem; }

/* --- Channel kit (létrehozási csomag) ------------------------------------------------- */
.kit-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.kit-asset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .45rem; }
.kit-preview { width: 100%; max-height: 200px; background: var(--surface-2); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.kit-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kit-preview.circle { max-width: 160px; border-radius: 50%; margin: 0 auto; }
.kit-preview.circle img { object-fit: cover; }
.kit-field > div { font-size: .9rem; }
.kit-over { color: var(--bad); }
.modal.xwide { width: min(1120px, 100%); }
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.guide-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.guide-nav li { display: flex; gap: .55rem; align-items: center; padding: .45rem .55rem; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: .88rem; }
.guide-nav li:hover { background: var(--surface-2); }
.guide-nav li.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.guide-nav .n { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-strong); }
.guide-nav li.done .n { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.guide-pane h3 { text-transform: none; letter-spacing: 0; font-size: 1.05rem; color: var(--text); }
.guide-collect { border: 1px dashed var(--accent); border-radius: 10px; padding: .6rem .8rem .1rem; background: var(--accent-soft); }
.guide-collect h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-strong); }
@media (max-width: 860px) { .guide { grid-template-columns: 1fr; } .guide-nav { position: static; } }
hr.kit-sep { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }

/* --- Focus mode (manual tasks one by one) ------------------------------------------- */
.focus { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto; }
.focus-inner { max-width: 760px; margin: 0 auto; padding: 1rem clamp(1rem, 3vw, 2rem) 6rem; display: flex; flex-direction: column; gap: 1rem; }
.focus-top { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; background: var(--bg); padding: .5rem 0; z-index: 2; }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.focus-actions { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .75rem clamp(1rem, 3vw, 2rem) calc(.75rem + env(safe-area-inset-bottom)); display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; z-index: 3; }
.focus-actions input { max-width: 340px; }

/* --- Inbox ------------------------------------------------------------------------- */
.inbox { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.mail-item { display: block; padding: .6rem 1rem; border-bottom: 1px solid var(--line); color: inherit; cursor: pointer; }
.mail-item:hover, .mail-item.active { background: var(--surface-2); text-decoration: none; }
.mail-item.unread .from { font-weight: 800; }
.mail-item .from { display: flex; justify-content: space-between; gap: .5rem; }
.mail-item .subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .snip { color: var(--text-3); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login form { width: min(360px, 100%); padding: 1.5rem; display: flex; flex-direction: column; gap: .9rem; }

/* --- Phone ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 1rem .9rem 5.5rem; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; padding: .5rem .2rem .45rem; color: var(--text-2); font-size: .7rem; font-weight: 600; position: relative; }
  .mobile-nav a b { display: block; font-size: 1.1rem; line-height: 1.2; font-weight: 400; }
  .mobile-nav a.active { color: var(--accent-strong); }
  .mobile-nav .count { position: absolute; top: 2px; left: 50%; margin-left: 6px; background: var(--bad); color: #fff; border-radius: 99px; font-size: .62rem; padding: 0 .35rem; }
  .grid-2, .inbox { grid-template-columns: 1fr; }
  .cal-grid, .cal-head { display: none; }
  .agenda { display: block !important; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  h1 { font-size: 1.3rem; }
  #toasts { bottom: 4.5rem; }
}
.agenda { display: none; }
