/* ADRIDGE Connect — Corporate Premium UI
   Deep navy #071D37 · metallic gold #B88B3E · white · light surface #F2F5F8 · body grey #526174
   Sans-serif throughout (Inter / system). Cards 12–16 px radius, 8 px spacing scale, 44 px touch targets. */
:root {
  --navy: #071D37;
  --navy-2: #0C2A4D;
  --navy-3: #123866;
  --gold: #B88B3E;
  --gold-2: #D4AB5C;
  --gold-soft: #F6EEDC;
  --blue: #1D6AE5;
  --blue-soft: #E7EFFD;
  --surface: #F2F5F8;
  --paper: #FFFFFF;
  --ink: #0F1F33;
  --grey: #526174;
  --grey-2: #8A97A8;
  --line: #E3E8EF;
  --line-2: #CBD4DF;
  --green: #1E9E63;
  --green-soft: #DFF5EA;
  --red: #D64545;
  --red-soft: #FBE4E4;
  --amber: #B7791F;
  --amber-soft: #FBEFD9;
  --focus: #1D6AE5;
  --shadow: 0 1px 2px rgba(7, 29, 55, .05), 0 10px 30px -18px rgba(7, 29, 55, .28);
  --shadow-sm: 0 1px 2px rgba(7, 29, 55, .06);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --side: 248px;
  --topbar: 68px;
  --switch-on: #34C759;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --navy: #061629; --navy-2: #0B2240; --navy-3: #10315A; --gold: #CFA35A; --gold-2: #E2BC74; --gold-soft: #2E2612;
  --blue: #6FA1F2; --blue-soft: #15294A; --surface: #0A1526; --paper: #10203A; --ink: #E8EEF6; --grey: #A3B0C2; --grey-2: #6F7E93;
  --line: #22334F; --line-2: #2E4264; --green: #4CC38A; --green-soft: #15382A; --red: #F08A85; --red-soft: #44201E; --amber: #E0A84C; --amber-soft: #3C2E12;
  --focus: #6FA1F2; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -20px rgba(0, 0, 0, .8); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #061629; --navy-2: #0B2240; --navy-3: #10315A; --gold: #CFA35A; --gold-2: #E2BC74; --gold-soft: #2E2612;
    --blue: #6FA1F2; --blue-soft: #15294A; --surface: #0A1526; --paper: #10203A; --ink: #E8EEF6; --grey: #A3B0C2; --grey-2: #6F7E93;
    --line: #22334F; --line-2: #2E4264; --green: #4CC38A; --green-soft: #15382A; --red: #F08A85; --red-soft: #44201E; --amber: #E0A84C; --amber-soft: #3C2E12;
    --focus: #6FA1F2; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -20px rgba(0, 0, 0, .8); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--grey); }
.small { font-size: 13px; }
.serif { font-family: var(--sans); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.wrap { overflow-wrap: anywhere; }

/* Boot */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 12px; color: var(--grey); text-align: center; }
.boot-mark { width: 48px; height: 48px; margin: 0 auto; border-radius: 12px; background: var(--navy); position: relative; }
.boot-mark::after { content: ""; position: absolute; left: 12px; right: 12px; top: 22px; height: 3px; background: var(--gold); border-radius: 3px; }

/* Brand mark: stylised gold "A" (two strokes) */
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 40px; height: 40px; flex: none; }
.mark svg { width: 100%; height: 100%; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark b { font-size: 17px; font-weight: 800; letter-spacing: .14em; color: #fff; }
.wordmark span { font-size: 10px; letter-spacing: .36em; color: var(--gold-2); font-weight: 600; margin-top: 4px; }
.wordmark.dark b { color: var(--navy); }
.wordmark.dark span { color: var(--gold); }

/* Avatars (initials) */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; letter-spacing: .02em; }
.avatar.gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--navy); }
.avatar.ring { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--gold); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; background: var(--navy); color: #fff; transition: background .15s, box-shadow .15s, transform .05s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); box-shadow: 0 6px 16px -8px rgba(29, 106, 229, .7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: var(--gold-soft); color: #7A5A1E; border-color: #EAD9B5; }
.btn.gold:hover { background: #F0E3C6; }
:root[data-theme="dark"] .btn.gold { color: var(--gold-2); border-color: #4A3B19; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.icon { padding: 0; width: 42px; min-height: 42px; border-radius: 50%; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 2px; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--paper); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--grey); font-weight: 400; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: var(--grey-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.textarea.serif { font-size: 15.5px; min-height: 200px; }
.input.serif { font-size: 17px; font-weight: 600; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--grey) 50%), linear-gradient(135deg, var(--grey) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.code-input { font-size: 28px; letter-spacing: .35em; text-align: center; font-weight: 600; }
.msg { font-size: 13.5px; min-height: 20px; margin: 0; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--grey); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

/* iOS-style switch with explicit state label */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch .sw-text { min-width: 0; display: flex; gap: 10px; align-items: flex-start; }
.switch .sw-text svg { width: 20px; height: 20px; fill: none; stroke: var(--grey); stroke-width: 1.9; flex: none; margin-top: 2px; }
.switch .sw-text b { display: block; font-weight: 600; font-size: 14.5px; }
.switch .sw-text span { display: block; font-size: 12.5px; color: var(--grey); }
.sw { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.sw .sw-state { font-size: 11px; font-weight: 700; color: var(--grey-2); min-width: 26px; text-align: right; letter-spacing: .04em; }
.sw-track { position: relative; width: 51px; height: 31px; border-radius: 31px; background: var(--line-2); border: 0; padding: 0; transition: background .2s; flex: none; }
.sw-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
.sw-track[aria-checked="true"] { background: var(--switch-on); }
.sw-track[aria-checked="true"]::after { transform: translateX(20px); }
.sw[data-on="true"] .sw-state { color: var(--green); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.tile .switch { border: 0; padding: 0; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.aside .tiles { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .feed-tools.only-mobile { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Public (sign-in, register) */
.public { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 500px at 50% -200px, #DCE6F3 0%, var(--surface) 60%); }
:root[data-theme="dark"] .public { background: radial-gradient(1200px 500px at 50% -200px, #12294A 0%, var(--surface) 60%); }
.public-top { background: var(--navy); color: #fff; padding: 0 28px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.public-top .brand { display: flex; align-items: center; gap: 12px; }
.public-top .tagline { color: #C7D6EE; font-size: 14px; margin-left: 22px; padding-left: 22px; border-left: 1px solid rgba(255, 255, 255, .18); }
.public-top .partner { background: #fff; border-radius: 10px; padding: 6px 12px; display: flex; align-items: center; }
.public-top .partner img { height: 26px; width: auto; }
.public-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.card { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 460px; border: 1px solid var(--line); }
.card.wide { max-width: 600px; }
.card h2 { font-size: 26px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.01em; }
.card .lead { color: var(--grey); margin-bottom: 22px; font-size: 14.5px; }
.card form { display: flex; flex-direction: column; gap: 14px; }
.logo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.logo-row .brand { display: flex; align-items: center; gap: 10px; }
.lang-pick { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--paper); }
.lang-pick button { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--grey); min-height: 34px; }
.lang-pick button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.public-foot { text-align: center; color: var(--grey); font-size: 12.5px; padding: 0 20px 28px; }
.public-foot img { height: 22px; width: auto; display: inline-block; vertical-align: middle; margin-left: 8px; opacity: .9; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 70px; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); font-weight: 600; font-size: 13px; padding: 6px 8px; }
@media (max-width: 760px) { .public-top { padding: 0 16px; } .public-top .tagline { display: none; } .public-main { align-items: flex-start; padding: 20px 14px 32px; } .card { padding: 22px 18px; } }

/* Agreement gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--surface); }
.gate .card { max-width: 680px; }
.agreement-text { font-size: 15px; line-height: 1.65; white-space: pre-wrap; max-height: 50vh; overflow: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.agreement-meta { font-size: 12.5px; color: var(--grey); display: flex; gap: 14px; flex-wrap: wrap; }

/* App shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { background: var(--navy); color: #fff; padding: 22px 16px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.side .brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 0; }
.nav { display: flex; flex-direction: column; gap: 10px; }
/* Setiap kumpulan menu mempunyai ton navy yang sedikit berbeza, makin cerah ke bawah */
.nav-group { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 8px; border-radius: 12px; }
.nav-group.g1 { background: rgba(255, 255, 255, .03); }
.nav-group.g2 { background: rgba(255, 255, 255, .06); }
.nav-group.g3 { background: rgba(255, 255, 255, .09); }
.nav-title { color: #7F97B8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 8px 6px; font-weight: 700; }
.nav-group.g2 .nav-title { color: var(--gold-2); }
.nav-group.g3 .nav-title { color: #A9C4E8; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #C9D6E8; font-size: 14.5px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-3); color: #fff; font-weight: 600; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -22px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side .me { margin-top: auto; padding: 12px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(184, 139, 62, .14)); border: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; gap: 12px; }
.side .me .who b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.side .me .who span { display: block; color: #9DB0CB; font-size: 12px; }
.side .me .who small { display: block; color: #6F87A8; font-size: 11.5px; }
.side .company { padding: 8px 10px; background: #fff; border-radius: 10px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.side .company img { height: 24px; width: auto; }
.side .btn.ghost { color: #C9D6E8; }
.side .btn.ghost:hover { background: rgba(255, 255, 255, .08); }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .search { flex: 1 1 320px; max-width: 460px; position: relative; }
.topbar .search input { width: 100%; min-height: 42px; padding: 9px 14px 9px 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.topbar .search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); background: var(--paper); }
.topbar .search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--grey); stroke-width: 2; }
.topbar .spacer { flex: 1; }
.topbar .partner { display: flex; align-items: center; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--line); }
.topbar .partner img { height: 24px; width: auto; }
.topbar .menu-btn { display: none; }
main.content { padding: 28px 32px 60px; min-width: 0; }
.page { max-width: 820px; margin: 0 auto; }
.page.wide { max-width: 1120px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--grey); margin-top: 4px; max-width: 64ch; font-size: 14.5px; }
.tabbar { display: none; }
.drawer { position: fixed; inset: 0; z-index: 40; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(4, 14, 28, .55); }
.drawer .side { display: flex; position: absolute; left: 0; top: 0; width: min(300px, 86vw); height: 100%; }
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { height: auto; min-height: 60px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--navy); color: #fff; border-bottom: 0; }
  .topbar .menu-btn { display: grid; }
  .topbar .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .18); color: #fff; }
  .topbar .icon-btn .badge { border-color: var(--navy); }
  .topbar .search { display: none; }
  .topbar .partner { display: none; }
  .topbar .lang-pick { border-color: rgba(255, 255, 255, .25); background: transparent; }
  .topbar .lang-pick button { color: #C9D6E8; }
  .topbar .lang-pick button[aria-pressed="true"] { background: #fff; color: var(--navy); }
  .topbar .m-brand { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
  main.content { padding: 18px 14px calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; font-size: 11px; color: var(--grey); position: relative; font-weight: 500; }
  .tabbar a[aria-current="page"] { color: var(--blue); font-weight: 700; }
  .tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .badge { position: absolute; top: 4px; right: calc(50% - 20px); background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 0 5px; }
  .page-head h1 { font-size: 22px; }
  .fab { position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 21; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(29, 106, 229, .8); }
  .fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
}
@media (min-width: 1024px) { .topbar .m-brand { display: none; } .fab { display: none; } }

/* Dashboard */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-bottom: 22px; }
.banner { position: relative; overflow: hidden; border-radius: 18px; background: linear-gradient(110deg, #0A2142 0%, #0F3566 60%, #1A4A86 100%); color: #fff; padding: 30px 32px; min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 10px; box-shadow: var(--shadow); }
.banner::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(184, 139, 62, .35), transparent 65%); }
.banner .avatar { position: absolute; right: 28px; top: 24px; }
.banner h2 { font-size: 28px; font-weight: 700; color: var(--gold-2); letter-spacing: -.01em; }
.banner h3 { font-size: 22px; font-weight: 600; }
.banner blockquote { margin: 6px 0 0; font-style: italic; color: #D6E1F2; font-size: 15px; max-width: 46ch; border-left: 3px solid var(--gold); padding-left: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow-sm); }
.kpi .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.kpi .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi .ico.blue { background: var(--blue-soft); color: var(--blue); }
.kpi .ico.green { background: var(--green-soft); color: var(--green); }
.kpi .ico.red { background: var(--red-soft); color: var(--red); }
.kpi span { display: block; font-size: 12.5px; color: var(--grey); line-height: 1.3; }
.kpi b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.section-head h2 { font-size: 17px; font-weight: 700; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.quick .btn { min-height: 48px; justify-content: flex-start; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); color: inherit; min-width: 0; }
.post-card:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow); }
.post-card time { font-size: 12px; color: var(--grey); }
.post-card h3 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.post-card .thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; background: var(--surface); }
.post-card .thumb.none { display: grid; place-items: center; color: var(--grey-2); font-size: 13px; }
.post-card .stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--grey); margin-top: auto; padding-top: 4px; }
.post-card .stats span { display: inline-flex; align-items: center; gap: 5px; }
.post-card .stats svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.inbox { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.inbox h2 { font-size: 15.5px; font-weight: 700; margin-bottom: 8px; }
.inbox .item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.inbox .item:first-of-type { border-top: 0; }
.inbox .item b { display: block; font-size: 13.5px; }
.inbox .item small { color: var(--grey); font-size: 11.5px; }
.inbox .item p { font-size: 13px; color: var(--grey); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1023px) { .dash-top, .dash-grid { grid-template-columns: 1fr; } .banner { min-height: 0; padding: 24px 22px; } .banner .avatar { display: none; } }

/* Feed cards */
.letter { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 20px 22px 16px; margin-bottom: 14px; }
.letter.pinned { border-color: #EAD9B5; }
.letter-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.letter-head .who b { display: block; font-size: 14.5px; font-weight: 700; }
.letter-head .who span { display: block; font-size: 12.5px; color: var(--grey); }
.letter-head .when { margin-left: auto; font-size: 12.5px; color: var(--grey); text-align: right; white-space: nowrap; }
.letter-head .when .pin { display: block; color: var(--gold); font-weight: 700; font-size: 12px; }
.letter-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.letter .cat { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
:root[data-theme="dark"] .letter .cat { color: var(--ink); }
.letter h2, .letter h1.title { font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 8px; }
.letter h1.title { font-size: 24px; }
.letter h2 a { color: inherit; }
.letter .from { display: none; }
.letter .body { font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.letter .body.excerpt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.letter .body .hash { color: var(--blue); font-weight: 600; }
.letter .meta { margin-top: 12px; font-size: 13px; color: var(--grey); display: flex; gap: 16px; flex-wrap: wrap; }
.letter .meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; fill: none; stroke: currentColor; stroke-width: 2; }
.letter .acts { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.letter .acts .spacer { flex: 1; }
.letter .acts .btn.ghost { color: var(--grey); font-weight: 600; }
.letter .acts .btn.ghost[aria-pressed="true"] { color: var(--red); }
.letter .acts .btn.ghost[aria-pressed="true"] svg { fill: var(--red); stroke: var(--red); }
.letter .acts .btn.comment { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface); }
.gallery img.hero { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gallery video { width: 100%; border-radius: 12px; background: #000; grid-column: 1 / -1; max-height: 70vh; }
.thumb-row { margin-top: 12px; }
.thumb-row img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.ack-box { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #EAD9B5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
:root[data-theme="dark"] .ack-box { border-color: #4A3B19; }
.ack-box p { font-size: 13.5px; }
.ack-done { color: var(--green); font-weight: 700; font-size: 13.5px; }
.feed-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.feed-tools .input, .feed-tools .select { min-height: 42px; }
.feed-tools .input { flex: 1 1 220px; }
.feed-tools .select { flex: 0 1 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--grey); white-space: nowrap; min-height: 34px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; font-size: 14px; color: var(--grey); }
.empty { text-align: center; padding: 48px 20px; color: var(--grey); background: var(--paper); border: 1px dashed var(--line-2); border-radius: 14px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* Private thread */
.thread { margin-top: 14px; }
.thread h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--surface); margin-bottom: 8px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { background: var(--blue-soft); margin-left: auto; }
.bubble.ceo { background: var(--navy); color: #fff; }
.bubble small { display: block; font-size: 11.5px; opacity: .7; margin-top: 4px; }
.privacy-note { font-size: 13px; color: var(--grey); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.privacy-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Panels & tables */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h2 svg, .thread h3 svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.panel h2 + p.muted { margin-top: -8px; margin-bottom: 12px; }
.panel.gold-edge { border-color: #EAD9B5; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--grey); }
.stat.warn b { color: var(--amber); }
.stat.good b { color: var(--green); }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; color: var(--grey); padding: 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-size: 12.5px; background: var(--surface); }
.t th:first-child { border-radius: 8px 0 0 0; }
.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.acts { white-space: nowrap; text-align: right; }
.t td.acts .btn { margin-left: 4px; }
.t td.name-cell { min-width: 240px; }
.t td.name-cell .person { display: flex; align-items: center; gap: 10px; }
.t td.name-cell b { display: block; font-weight: 600; }
.t td.name-cell .small { display: block; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); white-space: nowrap; border: 1px solid var(--line); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.tag.ok { background: var(--green-soft); color: #146C44; border-color: transparent; }
.tag.warn { background: var(--amber-soft); color: #7A4F0C; border-color: transparent; }
.tag.bad { background: var(--red-soft); color: #8A2A25; border-color: transparent; }
.tag.info { background: var(--blue-soft); color: var(--navy); border-color: transparent; }
:root[data-theme="dark"] .tag.ok { color: #7BE3B0; }
:root[data-theme="dark"] .tag.warn { color: #F2C675; }
:root[data-theme="dark"] .tag.bad { color: #F6ABA7; }
:root[data-theme="dark"] .tag.info { color: var(--blue); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; color: var(--grey); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.meter { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--grey); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list li.unread { background: linear-gradient(90deg, var(--blue-soft), transparent 40%); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.list .what { min-width: 0; flex: 1 1 260px; }
.list .what b { display: block; font-weight: 600; }
.list .what span { font-size: 13px; color: var(--grey); display: block; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); color: var(--ink); font-size: 14px; margin-bottom: 16px; border-left: 3px solid var(--blue); }
.notice.warn { background: var(--amber-soft); border-color: var(--amber); color: #4A3307; }
:root[data-theme="dark"] .notice.warn { color: #F2C675; }
.notice.bad { background: var(--red-soft); border-color: var(--red); color: #5C1B17; }
:root[data-theme="dark"] .notice.bad { color: #F6ABA7; }
.temp-pass { font-size: 24px; letter-spacing: .08em; padding: 12px 16px; background: var(--surface); border-radius: 10px; border: 1px dashed var(--line-2); user-select: all; text-align: center; font-weight: 600; }

/* Composer */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.composer .aside { position: sticky; top: calc(var(--topbar) + 16px); }
@media (max-width: 1100px) { .composer { grid-template-columns: 1fr; } .composer .aside { position: static; } }
.editor-box { border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); overflow: hidden; }
.editor-box .textarea { border: 0; border-radius: 0; min-height: 220px; box-shadow: none !important; }
.editor-box .toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.editor-box .toolbar .count { margin-left: auto; font-size: 12.5px; color: var(--grey); }
.media-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.media-btns .btn { min-height: 46px; justify-content: center; }
.voice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.voice .rec { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; margin-right: 6px; }
.voice.live .rec { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
.voice .interim { font-size: 15px; color: var(--grey); min-height: 22px; margin-top: 8px; white-space: pre-wrap; }
.voice .cues { font-size: 12.5px; color: var(--grey); margin-top: 6px; }
.voice .cues code { background: var(--paper); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.compare .opt { border: 2px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--paper); }
.compare .opt[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.compare .opt h4 { font-size: 13.5px; margin-bottom: 8px; }
.compare .opt .txt { font-size: 14.5px; white-space: pre-wrap; max-height: 260px; overflow: auto; line-height: 1.55; }
.media-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.media-item { position: relative; width: 120px; }
.media-item img, .media-item .vid { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 12px; color: var(--grey); }
.media-item .rm { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.upload-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.upload-bar span { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.status-pill.published { background: var(--green-soft); color: #146C44; border-color: transparent; }
.status-pill.scheduled { background: var(--blue-soft); color: var(--navy); border-color: transparent; }
:root[data-theme="dark"] .status-pill.published { color: #7BE3B0; }
:root[data-theme="dark"] .status-pill.scheduled { color: var(--blue); }
.tone-row { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-live { border: 1px dashed var(--line-2); border-radius: 14px; padding: 6px; background: var(--surface); }
.preview-live .letter { margin: 0; box-shadow: none; }
.publish-bar { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(4, 14, 28, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 760px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.modal.narrow { max-width: 480px; }
.modal-head { position: sticky; top: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 1; border-radius: 16px 16px 0 0; }
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 18px 20px; }
.modal-foot { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-radius: 0 0 16px 16px; }
.modal .letter { margin-bottom: 0; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 96vw; object-fit: contain; border-radius: 6px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@media (max-width: 1023px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media print { .side, .tabbar, .topbar, .acts, .feed-tools, .toasts, .fab { display: none !important; } .letter { box-shadow: none; } }
