/* Pin Scheduler · Hmizat Digital Services: shared by the client app and the admin dashboard. */
/* ============ Design tokens: Hmizat Digital Services (yellow + black) ============ */
:root {
  --brand: #ffd400;
  --brand-hover: #f2c900;
  --brand-ink: #111111;
  --brand-soft: #fff7cc;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f8f8f5;
  --text: #111111;
  --text-2: #4a4d55;
  --muted: #8a8d95;
  --border: #e7e7e2;
  --border-strong: #d4d4cd;
  --side-bg: #111111;
  --side-text: #b8b8b3;
  --side-border: #262626;
  --ok: #0f8a4f;
  --ok-soft: #e3f5ec;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --err: #d1242f;
  --err-soft: #fdecec;
  --info: #2563eb;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, .05);
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 28px rgba(17, 17, 17, .06);
  --shadow-lg: 0 16px 44px rgba(17, 17, 17, .18);
  --ring: 0 0 0 4px rgba(255, 212, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 252px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-soft: #2e2700;
    --bg: #0d0d0d;
    --surface: #171717;
    --surface-2: #1e1e1e;
    --text: #f2f2ef;
    --text-2: #bdbdb7;
    --muted: #85857f;
    --border: #282828;
    --border-strong: #363636;
    --side-bg: #0a0a0a;
    --ok-soft: #0f2c1f;
    --warn: #ffcf4d;
    --warn-soft: #2e2600;
    --err-soft: #3a1518;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .3);
  }
}

/* ============ Base ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
a { color: inherit; }
.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.hint { display: block; color: var(--muted); font-size: 12.5px; margin-block-start: 6px; }
.hint:empty { display: none; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ============ Shell ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 16px;
  background: var(--side-bg); color: var(--side-text);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-logo { width: 52px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand-tagline { color: var(--brand); font-size: 9.5px; font-weight: 700; letter-spacing: .22em; margin-block-start: 3px; }
.product-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-inline-start: 6px;
  padding: 5px 11px; border-radius: 999px; background: #1f1f1f; color: #eaeae5; font-size: 12px; font-weight: 600;
}
.dot-yellow { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.nav { display: flex; flex-direction: column; gap: 4px; margin-block-start: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; position: relative;
  padding: 11px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--side-text); font: inherit; font-weight: 500; cursor: pointer; text-align: start;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #1c1c1c; color: #fff; }
.nav-item.active { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.nav-badge {
  margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.sidebar-foot { margin-block-start: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-status {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-radius: var(--radius); background: #1a1a1a; font-size: 12.5px;
}
.status-line { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.contact { padding: 12px; border-radius: var(--radius); border: 1px solid var(--side-border); }
.contact-title { display: block; font-size: 12px; color: #eaeae5; font-weight: 600; margin-block-end: 8px; }
.contact-links { display: flex; gap: 6px; }
.contact-links a {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: #1c1c1c; color: #eaeae5; transition: background .15s, color .15s;
}
.contact-links a:hover { background: var(--brand); color: var(--brand-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-brand { display: none; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 26px 32px 10px;
}
.page-sub { margin: 4px 0 0; color: var(--text-2); }
.topbar-right { display: flex; gap: 10px; flex-wrap: wrap; }
.clock {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--brand-ink); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.clock .ic { color: var(--brand); width: 20px; height: 20px; }
.clock div { display: flex; flex-direction: column; line-height: 1.2; }
.clock-time { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 11.5px; color: #c9c9c4; }
.stats { display: flex; gap: 10px; }
.stat {
  display: flex; flex-direction: column; justify-content: center; min-width: 96px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-danger.has-failed { border-color: var(--err); background: var(--err-soft); }
.stat-danger.has-failed .stat-value { color: var(--err); }
.content { padding: 16px 32px 32px; max-width: 1200px; width: 100%; flex: 1; }
.app-footer {
  display: flex; gap: 16px; flex-wrap: wrap; padding: 16px 32px 28px; color: var(--muted); font-size: 12.5px;
}
.app-footer a { text-decoration: none; }
.app-footer a:hover { color: var(--text); }

/* ============ Cards ============ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px; margin-block-end: 20px;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-block-end: 18px; }
.card-head > div:not(.head-icon) { flex: 1; }
.card-head h2 { flex: 1; }
.card-sub { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.head-icon, .step {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
}
.step { font-weight: 800; font-size: 15px; border-radius: 50%; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.stack { display: flex; flex-direction: column; }

/* ============ Form controls ============ */
.field { margin-block-end: 18px; }
.field-narrow { max-width: 240px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 8px; }
.label { display: block; font-weight: 600; font-size: 13px; margin-block-end: 8px; }
.label-row .label { margin: 0; }
.optional { font-weight: 400; color: var(--muted); }
.counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--warn); font-weight: 600; }
input, textarea, select {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-ink); box-shadow: var(--ring); }
input.invalid, textarea.invalid { border-color: var(--err); }
.field-error { display: block; color: var(--err); font-size: 12.5px; margin-block-start: 6px; }
.field-error:empty { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.input-icon input { padding-inline-start: 38px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 0 #d9b400; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-dark { background: var(--brand-ink); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn-ghost { background: transparent; color: var(--text-2); font-weight: 600; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--err); }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-icon { padding: 10px; }
.btn-sm.btn-icon { padding: 7px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 8px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--brand-ink); color: #fff; font-weight: 600; }
.seg-btn.active .count { color: var(--brand); }
.seg-sm .seg-btn { padding: 5px 10px; font-size: 12.5px; }
.seg-sm .ic { width: 14px; height: 14px; }
.count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count:empty { display: none; }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-block-end: 12px; }
.choice {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center;
  padding: 14px; text-align: start; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice .ic { grid-row: span 2; width: 20px; height: 20px; color: var(--muted); }
.choice-title { font-weight: 700; }
.choice-sub { font-size: 12.5px; color: var(--muted); }
.choice:hover { border-color: var(--text-2); }
.choice.active { border-color: var(--brand-ink); background: var(--brand-soft); box-shadow: var(--ring); }
.choice.active .ic { color: var(--brand-ink); }

/* Dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 28px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand-ink); background: var(--brand-soft); }
.dropzone.busy { pointer-events: none; opacity: .6; }
.dropzone-lg { padding: 40px 16px; }
.dz-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); margin-block-end: 4px;
}
.dz-title { font-weight: 700; }
.dz-hint { font-size: 12.5px; color: var(--muted); }

.inline-status {
  display: flex; align-items: flex-start; gap: 8px; margin-block-start: 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 13px; background: var(--surface-2); color: var(--text-2); overflow-wrap: anywhere;
}
.inline-status .ic { width: 16px; height: 16px; margin-block-start: 1px; }
.inline-status.ok { background: var(--ok-soft); color: var(--ok); }
.inline-status.err { background: var(--err-soft); color: var(--err); }

/* ============ Compose + live preview ============ */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.preview-sticky { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.pin-preview { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.pp-media { position: relative; aspect-ratio: 2 / 3; background: var(--surface-2); }
.pp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 13px; padding: 20px; text-align: center;
}
.pp-empty .ic { width: 36px; height: 36px; stroke-width: 1.5; }
.pp-body { padding: 14px 16px 16px; }
.pp-title { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.pp-title.placeholder, .pp-desc.placeholder { color: var(--muted); font-weight: 500; }
.pp-desc {
  margin-block-start: 6px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 12px; }
.pp-meta span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.pp-meta span:empty { display: none; }

/* ============ Notices ============ */
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 13px; margin-block-start: 14px; overflow-wrap: anywhere; }
.notice strong { display: block; margin-block-end: 4px; }
.notice ul { margin: 0; padding-inline-start: 18px; }
.notice li + li { margin-block-start: 4px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.err { background: var(--err-soft); color: var(--err); }
.notice code { display: block; margin-block-start: 8px; white-space: pre-wrap; font-size: 12px; opacity: .85; }

/* ============ Bulk ============ */
.progress { display: flex; flex-direction: column; gap: 6px; margin-block-start: 16px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; transition: width .25s; }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-block-start: 16px; }
.upload-tile { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.upload-tile .ut-media { position: relative; aspect-ratio: 1; background: var(--surface-2); }
.upload-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-tile .badge { position: absolute; top: 8px; inset-inline-start: 8px; }
.ut-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ut-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-link { display: flex; gap: 4px; }
.ut-link input { padding: 5px 7px; font-size: 11px; background: var(--surface-2); direction: ltr; min-width: 0; }
.ut-error { color: var(--err); font-size: 11.5px; overflow-wrap: anywhere; }
.ut-size { color: var(--ok); font-size: 11.5px; font-weight: 600; }
.csv-columns { display: flex; flex-wrap: wrap; gap: 6px; margin-block-end: 12px; }
.csv-columns code {
  padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.result-head { margin-block: 22px 12px; font-weight: 700; }

/* ============ Pin cards (My pins + CSV preview) ============ */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-end: 18px; }
.toolbar-right { display: flex; gap: 8px; }
.search input { width: 220px; padding-block: 9px; }
.pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pin-grid-sm { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pin-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.pin-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pin-card.has-errors { border-color: var(--err); }
.pc-media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); }
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-media .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.pc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-title { font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-desc { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.pc-meta .ic { width: 14px; height: 14px; color: var(--muted); }
.pc-error {
  display: flex; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--err-soft); color: var(--err);
  font-size: 12px; overflow-wrap: anywhere;
}
.pc-error .ic { width: 14px; height: 14px; margin-block-start: 1px; }
.pc-actions { display: flex; gap: 4px; padding: 8px 10px; border-block-start: 1px solid var(--border); }
.pc-actions .btn-primary { margin-inline-start: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--surface); box-shadow: var(--shadow-sm);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.Scheduled { color: var(--info); }
.badge.Processing, .badge.Uploading { color: var(--warn); }
.badge.Posted, .badge.Ready, .badge.Uploaded { color: var(--ok); }
.badge.Failed, .badge.Invalid { color: var(--err); }
.badge.Paused { color: var(--muted); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 56px 16px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); margin-block-end: 6px; }
.empty-icon .ic { width: 26px; height: 26px; }
.empty .btn { margin-block-start: 10px; }

/* ============ Settings ============ */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.last-run { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--text-2); margin-block-end: 8px; overflow-wrap: anywhere; }
.last-run strong { display: block; color: var(--text); font-size: 12px; margin-block-end: 2px; }
#sched-state.on { color: var(--ok); font-weight: 600; }
#sched-state.off { color: var(--err); font-weight: 600; }
.support-card { background: var(--brand-ink); color: #eaeae5; border-color: var(--brand-ink); }
.support-card h2 { color: #fff; }
.support-card .card-sub { color: #b8b8b3; }
.support-logo { width: 56px; height: 46px; flex: none; }
.support-links { display: flex; flex-direction: column; gap: 6px; }
.support-links a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: #1c1c1c; text-decoration: none; font-size: 13px; overflow-wrap: anywhere; transition: background .15s, color .15s;
}
.support-links a .ic { color: var(--brand); }
.support-links a:hover { background: var(--brand); color: var(--brand-ink); }
.support-links a:hover .ic { color: var(--brand-ink); }

/* ============ License ============ */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--side-bg); z-index: 60; }
.splash-logo { width: 120px; height: 100px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.96); } }
.license-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--side-bg);
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 212, 0, .18), transparent 45%);
}
.license-card {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-lg);
}
.license-brand {
  display: flex; align-items: center; gap: 10px; margin: -28px -28px 22px; padding: 18px 28px;
  background: var(--brand-ink); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.license-card h1 { font-size: 22px; }
.license-card .card-sub { margin-block-end: 18px; }
#license-key {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; letter-spacing: .08em;
  text-transform: uppercase; text-align: center; direction: ltr;
}
.btn-block { width: 100%; margin-block-start: 12px; }
.license-contact {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-block-start: 18px;
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none;
}
.license-contact .ic { color: #25d366; }
.license-contact:hover { color: var(--text); }
.license-lang { display: flex; justify-content: center; gap: 4px; margin-block-start: 14px; }
.license-lang button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 4px 8px;
  border-radius: 6px; cursor: pointer;
}
.license-lang button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.notice a { color: inherit; font-weight: 700; }

.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 32px 0; padding: 12px 16px;
  border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font-weight: 600;
}
.banner > span { flex: 1; min-width: 200px; }
.banner.offline { background: var(--warn-soft); color: var(--warn); }
.btn-dark .ic { color: var(--brand); }
.text-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--text-2);
}
.text-link:hover { color: var(--text); text-decoration: underline; }
.text-link .ic { width: 15px; height: 15px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
#lic-state.ok { color: var(--ok); font-weight: 600; }
#lic-state.warn { color: var(--warn); font-weight: 600; }

/* ============ Toast ============ */
#toast {
  position: fixed; inset-inline-end: 24px; inset-block-end: 24px; z-index: 50; max-width: 420px;
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--brand-ink); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500;
  opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast .ic { width: 18px; height: 18px; margin-block-start: 1px; color: var(--brand); }
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--err); }
#toast.error .ic { color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .compose { grid-template-columns: minmax(0, 1fr) 260px; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .compose { grid-template-columns: 1fr; }
  .preview-col { order: -1; }
  .preview-sticky { position: static; }
  .pin-preview { display: grid; grid-template-columns: 96px 1fr; }
  .pp-media { aspect-ratio: auto; min-height: 120px; }
  .pp-empty span { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; height: auto; width: auto; z-index: 40;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .sidebar > .brand, .sidebar > .product-chip, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; margin: 0; }
  .nav-item { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 11px; align-items: center; flex: 1; }
  .nav-badge { position: absolute; top: 2px; inset-inline-end: 20%; margin: 0; }
  .mobile-brand {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--side-bg);
  }
  .mobile-brand .brand-logo { width: 42px; height: 36px; }
  .mobile-brand .brand-name { font-size: 16px; }
  .mobile-brand .product-chip { margin-inline-start: auto; }
  .topbar { padding: 18px 16px 4px; }
  .banner { margin: 12px 16px 0; }
  .license-card { padding: 22px; }
  .license-brand { margin: -22px -22px 20px; padding: 16px 22px; }
  h1 { font-size: 21px; }
  .topbar-right, .stats { width: 100%; }
  .clock { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 8px 10px; }
  .content { padding: 12px 16px 16px; }
  .app-footer { padding: 8px 16px 96px; }
  .card { padding: 18px; border-radius: var(--radius); }
  .grid-2, .choice-cards { grid-template-columns: 1fr; }
  .field-narrow { max-width: none; }
  .toolbar-right, .search { width: 100%; }
  .search input { width: 100%; }
  .toolbar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .pin-grid, .pin-grid-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-body { padding: 10px 12px; }
  .pc-actions { flex-wrap: wrap; padding: 6px; }
  .pc-actions .btn-primary { width: 100%; margin: 4px 0 0; }
  .btn-lg { width: 100%; }
  #toast { inset-inline: 16px; inset-block-end: 84px; max-width: none; }
}
@media (max-width: 340px) {
  .pin-grid, .pin-grid-sm, .upload-grid { grid-template-columns: 1fr; }
}

/* ============ Hosted version: login, account and read-only banner ============ */
.auth-form + .auth-form { margin-block-start: 0; }
.auth-form .field { margin-block-end: 14px; }
.auth-screen-msg { margin-block-end: 6px; }
.impersonation {
  position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px; background: var(--info); color: #fff; font-size: 13px; font-weight: 600;
}
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.maintenance-msg { white-space: pre-wrap; }
