/* SupplyKlik — design system (DESIGN §6.6).
   "The Matrix" digital-code look: black screen, phosphor-green monospace type with a soft glow, terminal
   panels and the falling green rain (ui/matrix-rain.js) behind the content. One dark palette for light and
   dark OS settings alike. Content sits on opaque panels; semantic colours stay out of the green: amber for
   warnings, red for errors, danger and key changes, filled bright green + icon for "verified".
   No web fonts. Mobile-first from 320 px; breakpoints 600 px and 1024 px.
   Sections: 1 tokens · 2 base · 3 utilities · 4 shell · 5 buttons · 6 forms · 7 cards, badges, avatars
   8 landing · 9 search bar · 10 directory · 11 supplier card · 12 profile · 13 profile editor
   14 static pages · 15 states · 16 dialogs, toasts · 17 chat (shared with track D2) · 18 motion, forced colours
   19 digital rain · 20 print. Track D2 may append one clearly delimited section at the very end of this file.
   The second theme, "Bersih" / "Clean" (DESIGN §6.6.2), lives in css/clean.css, loaded after this file and scoped
   to html[data-theme="clean"]; the theme switch's own controls are the last section here. */

/* ===== 1. Tokens ===== */
/* Every text/background pair below is checked for WCAG AA in tests/ui/theme-contrast.test.js,
   including text on the page background with the rain at its brightest behind it. */
:root {
  --c-bg: #000000; --c-surface: #020A04; --c-surface-2: #06160A;
  --c-border: #0F3D1A;                        /* inner dividers only (rules, table rows, list separators) */
  --c-border-dim: #2A7A3F;                    /* ≥ 3:1 on bg/surface: frames of panels, cards, tiles, bubbles */
  --c-border-strong: #1E9E46;                 /* ≥ 3:1 on bg/surface: input and control boundaries */
  --c-text: #B3F5C0; --c-muted: #5CBF74;
  --c-heading: #00FF41;                       /* phosphor bright: headings, brand, prices, codes */
  --c-primary: #00FF41; --c-primary-ink: #000000; --c-primary-soft: #05290F;
  --c-accent: #D9FFE1;                        /* the "white-hot" leading glyph: only "Minta Penawaran" and highlights */
  --c-accent-ink: #000000;
  --c-success: #00FF41; --c-success-ink: #000000; --c-success-soft: #04260E;
  --c-warning: #FFB000; --c-warning-ink: #000000; --c-warning-soft: #2B1D00; --c-warning-text: #FFE3A6;
  --c-warning-border: #9A6A00;                /* quiet amber frame of small notes (flags, fraud tip) */
  --c-danger: #FF6B6B; --c-danger-ink: #000000; --c-danger-soft: #2E0707; --c-danger-text: #FFD6D6;
  --c-focus: #F2FFF4;                         /* white-hot ring: never mistaken for a green border */
  --c-overlay: rgba(0, 0, 0, .8);
  --c-skeleton: #164A24;                      /* loading placeholders: visible on every panel (≥ 1.8:1) */
  --c-glow: rgba(0, 255, 65, .45); --c-glow-soft: rgba(0, 255, 65, .16);
  /* Avatar tiles (initials --c-av-ink ≥ 9:1 on each) */
  --c-av-ink: #C8FFD3;
  --c-av0: #003B17; --c-av1: #00363A; --c-av2: #1F3A0A; --c-av3: #0A2F2A; --c-av4: #133D24; --c-av5: #2A3A1A;
  /* Theme previews in Settings (fixed colours: each swatch shows its own theme whichever one is active) */
  --sw-matrix-bg: #000000; --sw-matrix-fg: #00FF41; --sw-matrix-dim: #1E9E46;
  --sw-clean-bg: #F5F5F7; --sw-clean-card: #FFFFFF; --sw-clean-blue: #0071E3;
  --font: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
  --font-mono: var(--font);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 2px; --r2: 4px; --r-pill: 4px;
  --shadow: 0 0 0 1px rgba(0, 255, 65, .10), 0 0 14px rgba(0, 255, 65, .10);
  --shadow-lg: 0 0 0 1px rgba(0, 255, 65, .22), 0 0 32px rgba(0, 255, 65, .14), 0 16px 40px rgba(0, 0, 0, .85);
  --glow-text: 0 0 6px rgba(0, 255, 65, .55), 0 0 18px rgba(0, 255, 65, .25);
  --glow-text-sm: 0 0 4px rgba(0, 255, 65, .35);
  --gutter: 16px;
  --header-h: 56px;
  --bottom-nav-h: 60px;
  --content-max: 1200px;
  --sidebar-w: 280px;
  --chat-list-w: 360px;
  color-scheme: dark;
}
@media (min-width: 600px) { :root { --gutter: 24px; --header-h: 64px; } }

/* ===== 2. Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s3)); scrollbar-color: var(--c-border-strong) var(--c-bg); }
/* The body background propagates to the viewport, so the fixed rain canvas (z-index -1) paints above it. */
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 15px/1.6 var(--font); min-height: 100vh; min-height: 100dvh; overflow-wrap: break-word; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--s3); font-weight: 700; color: var(--c-heading); letter-spacing: -.01em; }
h1, h2 { text-shadow: var(--glow-text-sm); }
h1 { font-size: 24px; text-shadow: var(--glow-text); }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 16px; }
@media (min-width: 600px) { h1 { font-size: 28px; } }
h1:focus, h2:focus { outline: none; }
h1:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
p { margin: 0 0 var(--s3); }
ul, ol { margin: 0 0 var(--s3); padding-inline-start: 1.25em; }
a { color: var(--c-primary); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; text-shadow: var(--glow-text-sm); }
img, svg { display: inline-block; vertical-align: middle; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s5) 0; }
small, .text-sm { font-size: 14px; }
strong, b { color: var(--c-heading); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
::selection { background: var(--c-primary); color: var(--c-primary-ink); text-shadow: none; }
[hidden] { display: none !important; }
dl { margin: 0; }
dd { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
table { border-collapse: collapse; }
.icon { flex: none; }

/* ===== 3. Utilities ===== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--s3); }
.stack-lg > * + * { margin-top: var(--s5); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.row { display: flex; gap: var(--s3); align-items: center; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--c-muted); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.lead { font-size: 17px; color: var(--c-muted); }
.inline-icon { display: inline-flex; align-items: center; gap: var(--s1); }
.inline-icon .icon { width: 18px; height: 18px; }
.e2ee-note { display: inline-flex; align-items: center; gap: var(--s1); color: var(--c-muted); font-size: 14px; }
.e2ee-note .icon { width: 16px; height: 16px; color: var(--c-success); }

/* ===== 4. App shell ===== */
.skip-link { position: absolute; left: var(--s2); top: -100px; z-index: 100; background: var(--c-surface); color: var(--c-primary); border: 1px solid var(--c-primary); padding: var(--s2) var(--s4); border-radius: var(--r1); box-shadow: var(--shadow-lg); font-weight: 700; }
.skip-link:focus { top: var(--s2); }
.room-main { position: relative; } /* the room's skip link (UX L13) sits at the top of the log when focused */
/* Hidden like .sr-only until focused: a negative top inside .room-main would land on the room header. */
.room-skip:not(:focus) { width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; top: 0; }

.app-header { position: sticky; top: 0; z-index: 40; background: var(--c-surface); border-bottom: 1px solid var(--c-border-strong); box-shadow: 0 0 18px rgba(0, 255, 65, .12), 0 6px 20px rgba(0, 0, 0, .7); }
.app-header-inner { display: flex; align-items: center; gap: var(--s3); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--c-heading); text-decoration: none; font-weight: 700; font-size: 17px; min-height: 44px; flex: 0 1 auto; min-width: 44px; text-shadow: var(--glow-text); letter-spacing: -.02em; }
/* With the logged-in nav (600 px and up) the brand never shrinks under the logo (review UX-10). */
@media (min-width: 600px) { .app-header.is-signed-in .brand { flex: none; } }
/* v2: four nav items (Ruang · Mitra · Chat · Profil) need the brand name's room up to 900 px (measured at 768). */
@media (min-width: 600px) and (max-width: 899.98px) { .app-header.is-signed-in .brand-name { display: none; } }
.brand:hover { text-decoration: none; }
.brand .logo-mark { flex: none; filter: drop-shadow(0 0 4px rgba(0, 255, 65, .55)); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .brand-name { font-size: 14px; letter-spacing: -.05em; } } /* the whole name still fits at 320 px in monospace */
.logo-mark .logo-tile { fill: var(--c-primary); }
.logo-mark .logo-bubble { fill: var(--c-primary-ink); }
.logo-mark .logo-dot { fill: var(--c-primary); }
.logo-mark .logo-link { stroke: var(--c-primary); stroke-width: 1.6; fill: none; }

.main-nav { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); }
.nav-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border-radius: var(--r1); color: var(--c-text); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: var(--c-surface-2); color: var(--c-primary); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--c-primary); background: var(--c-primary-soft); box-shadow: inset 0 -2px 0 var(--c-primary); text-shadow: var(--glow-text-sm); }
.nav-link .icon { width: 20px; height: 20px; }
@media (min-width: 600px) { .main-nav { display: block; margin-inline-start: var(--s3); } }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s2); }
.header-auth { display: none; gap: var(--s2); }
@media (min-width: 600px) { .header-auth { display: flex; } }
.lang-toggle { min-width: 44px; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r-pill); background: transparent; color: var(--c-primary); font-weight: 700; font-size: 14px; letter-spacing: .06em; }
.lang-toggle:hover { background: var(--c-surface-2); border-color: var(--c-primary); box-shadow: 0 0 10px var(--c-glow-soft); }

.menu { position: relative; }
.menu-button { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; padding: 0 var(--s3); border: 1px solid transparent; border-radius: var(--r1); background: transparent; color: var(--c-text); }
.menu-button:hover { background: var(--c-surface-2); color: var(--c-primary); }
.menu-button[aria-expanded="true"] { background: var(--c-surface-2); border-color: var(--c-border-strong); }
.menu-button .menu-label { max-width: 14ch; display: none; }
@media (min-width: 1024px) { .menu-button .menu-label { display: block; } }
.menu-button { position: relative; }
.menu-alert { position: absolute; top: 8px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-warning); box-shadow: 0 0 0 2px var(--c-surface), 0 0 6px var(--c-warning); }
.menu-item[data-key="menu:rc-reminder"] { font-weight: 700; color: var(--c-warning-text); }
.menu-item[data-key="menu:rc-reminder"] .icon { color: var(--c-warning); }
/* 600–1023 px: short nav labels; the full label stays readable for screen readers (review UX-10). */
.nav-label-short { display: none; }
@media (min-width: 600px) and (max-width: 1023px) {
  .nav-link .nav-label-short { display: inline; }
  .nav-link .nav-label-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
.nav-link { white-space: nowrap; }
.header-actions { flex: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + var(--s1)); z-index: 50; min-width: 240px; max-width: calc(100vw - 2 * var(--gutter)); background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: var(--r2); box-shadow: var(--shadow-lg); padding: var(--s2); }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel .menu-heading { padding: var(--s2) var(--s3); font-size: 14px; color: var(--c-muted); border-bottom: 1px solid var(--c-border); margin-bottom: var(--s1); }
.menu-item { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: var(--r1); background: transparent; color: var(--c-text); text-decoration: none; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--c-surface-2); color: var(--c-primary); text-decoration: none; }
.menu-item .icon { width: 20px; height: 20px; color: var(--c-muted); }
.menu-separator { height: 1px; background: var(--c-border); margin: var(--s1) 0; }
.menu-mobile-only { display: block; }
@media (min-width: 600px) { .menu-mobile-only { display: none; } }

.demo-banner { background: var(--c-warning-soft); color: var(--c-warning-text); border-bottom: 1px solid var(--c-warning); font-size: 14px; }
.demo-banner .container { display: flex; gap: var(--s2); align-items: center; padding-block: var(--s2); }
.demo-banner .icon { color: var(--c-warning); width: 18px; height: 18px; }

.app-main { display: block; min-height: 60vh; padding-block: var(--s5) var(--s7); }
.app-main:focus { outline: none; }
.app-main.is-full { padding: 0; }

.app-footer { background: var(--c-surface); border-top: 1px solid var(--c-border-strong); padding-block: var(--s6); font-size: 14px; color: var(--c-muted); }
.app-footer .footer-grid { display: grid; gap: var(--s4); }
.app-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.app-footer a { color: var(--c-text); display: inline-flex; align-items: center; min-height: 44px; }
.app-footer a:hover { color: var(--c-primary); }
.app-footer .footer-brand { display: flex; align-items: center; gap: var(--s2); color: var(--c-heading); font-weight: 700; text-shadow: var(--glow-text-sm); }
@media (min-width: 1024px) { .app-footer .footer-grid { grid-template-columns: 1fr auto; align-items: start; } }

.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--c-surface); border-top: 1px solid var(--c-border-strong); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: var(--bottom-nav-h); }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; color: var(--c-muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.bottom-nav a .icon { width: 24px; height: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--c-primary); text-shadow: var(--glow-text-sm); }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 2px 2px; background: var(--c-primary); box-shadow: 0 0 8px var(--c-glow); }
.bottom-nav .count-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 600px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav { padding-bottom: 0; }
}
body[data-view="chat-thread"] .bottom-nav, body[data-view="room"] .bottom-nav, body[data-view="room-members"] .bottom-nav { display: none; }
body[data-view="chat-thread"].has-bottom-nav, body[data-view="room"].has-bottom-nav, body[data-view="room-members"].has-bottom-nav { padding-bottom: 0; }

.live-region { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ===== 5. Buttons ===== */
/* Primary: filled phosphor with a glow. Secondary: glowing outline on an opaque panel. Tertiary: text. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r1); border: 1px solid transparent; background: transparent; color: var(--c-text); font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: .01em; text-decoration: none; text-align: center; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--c-primary); color: var(--c-primary-ink); border-color: var(--c-primary); box-shadow: 0 0 12px var(--c-glow-soft); }
.btn-primary:hover { background: color-mix(in srgb, var(--c-primary) 70%, var(--c-accent)); box-shadow: 0 0 18px var(--c-glow); }
.btn-accent { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); box-shadow: 0 0 12px rgba(217, 255, 225, .25); }
.btn-accent:hover { background: #FFFFFF; box-shadow: 0 0 18px rgba(217, 255, 225, .45); }
.btn-secondary { background: var(--c-surface); border-color: var(--c-border-strong); color: var(--c-primary); }
.btn-secondary:hover { background: var(--c-primary-soft); border-color: var(--c-primary); box-shadow: 0 0 12px var(--c-glow-soft), inset 0 0 8px var(--c-glow-soft); }
.btn-tertiary { color: var(--c-primary); padding-inline: var(--s3); }
.btn-tertiary:hover { background: var(--c-primary-soft); }
.btn-danger { background: var(--c-danger); color: var(--c-danger-ink); border-color: var(--c-danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--c-danger) 80%, #FFFFFF); box-shadow: 0 0 14px rgba(255, 107, 107, .4); }
.btn-danger-outline { border-color: var(--c-danger); color: var(--c-danger); background: var(--c-surface); }
.btn-danger-outline:hover { background: var(--c-danger-soft); }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 13px; letter-spacing: 0; }
.btn-sm .icon { width: 18px; height: 18px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
.btn-icon { min-width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.is-busy { cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.link-button { background: none; border: 0; padding: 0; color: var(--c-primary); text-decoration: underline; text-underline-offset: .2em; font: inherit; min-height: 44px; }

/* ===== 6. Forms ===== */
/* Controls are terminal wells: black, a ≥ 3:1 green boundary, a phosphor caret. */
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); min-width: 0; }
.field-label { font-weight: 700; font-size: 14px; color: var(--c-text); }
.field-label .optional { font-weight: 400; color: var(--c-muted); }
.field-hint { font-size: 14px; color: var(--c-muted); margin: 0; }
.field-error { font-size: 14px; color: var(--c-danger); margin: 0; display: flex; gap: var(--s1); align-items: flex-start; }
.field-error .icon { width: 18px; height: 18px; margin-top: 1px; }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r1); background: var(--c-bg); color: var(--c-text); font-size: 16px; caret-color: var(--c-primary); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-inline-end: 40px; background-image: none; }
.select option { background: var(--c-surface); color: var(--c-text); }
.select-wrap { position: relative; display: block; min-width: 0; }
.select-wrap .icon { position: absolute; right: var(--s3); top: 50%; transform: translateY(-50%); width: 20px; height: 20px; pointer-events: none; color: var(--c-primary); }
.input::placeholder, .textarea::placeholder { color: var(--c-muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-primary); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 0; border-color: var(--c-focus); box-shadow: 0 0 14px var(--c-glow-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-danger); border-width: 2px; }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--c-surface-2); color: var(--c-muted); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: inline-flex; align-items: center; padding: 0 var(--s3); border: 1px solid var(--c-border-strong); border-right: 0; border-radius: var(--r1) 0 0 var(--r1); background: var(--c-surface-2); color: var(--c-muted); font-size: 14px; }
.input-prefix .input { border-radius: 0 var(--r1) var(--r1) 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; min-height: 44px; padding: var(--s2) 0; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-primary); cursor: pointer; }
/* Terminal-style boxes instead of grey OS widgets (review N1): a ≥ 3:1 green frame on a black well; checked =
   filled phosphor with a black tick (a rotated border, so no image is needed); radios get a round dot. */
.check input[type="checkbox"], .check input[type="radio"] { appearance: none; -webkit-appearance: none; display: inline-grid; place-content: center; border: 2px solid var(--c-border-strong); border-radius: var(--r1); background: var(--c-bg); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="checkbox"]::after { content: ""; width: 6px; height: 11px; margin-top: -3px; border: solid var(--c-primary-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); visibility: hidden; }
.check input[type="radio"]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c-primary); visibility: hidden; }
.check input:checked::after { visibility: visible; }
.check input[type="checkbox"]:checked { background: var(--c-primary); border-color: var(--c-primary); }
.check input[type="radio"]:checked { border-color: var(--c-primary); }
.check input:hover { border-color: var(--c-primary); }
.check input:disabled { opacity: .5; cursor: not-allowed; }
.check-label { flex: 1; }
.check-label .field-hint { display: block; margin-top: 2px; }
.check-list { display: flex; flex-direction: column; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 0 var(--s4); }
.fieldset { margin-bottom: var(--s4); }
.fieldset > legend, .legend { font-weight: 700; font-size: 14px; margin-bottom: var(--s1); color: var(--c-heading); }
.form-grid { display: grid; gap: 0 var(--s4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) {
  .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid .span-all { grid-column: 1 / -1; }
}
.error-summary { border: 2px solid var(--c-danger); background: var(--c-danger-soft); color: var(--c-danger-text); border-radius: var(--r2); padding: var(--s4); margin-bottom: var(--s5); }
.error-summary h2 { font-size: 17px; color: var(--c-danger); text-shadow: none; display: flex; gap: var(--s2); align-items: center; }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--c-danger-text); }
.char-count { font-size: 14px; color: var(--c-muted); text-align: end; }

/* ===== 7. Cards, badges, avatars ===== */
.card { background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s4); box-shadow: inset 0 1px 0 rgba(0, 255, 65, .07); }
.card-flush { padding: 0; overflow: hidden; }
@media (hover: hover) and (pointer: fine) {
  .card-hover { transition: box-shadow .15s, border-color .15s; }
  .card-hover:hover { box-shadow: var(--shadow); border-color: var(--c-border-strong); }
}
.card-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }

.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px var(--s2); border-radius: var(--r-pill); border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; letter-spacing: .01em; }
.badge .icon { width: 15px; height: 15px; }
.badge-nib { border-color: var(--c-success); color: var(--c-success); }
.badge-pkp { border-color: var(--c-border-strong); color: var(--c-text); }
.badge-halal { border-color: var(--c-success); color: var(--c-success); background: var(--c-success-soft); }
.badge-demo { border-style: dashed; color: var(--c-muted); }
.badge-trust-unverified { color: var(--c-muted); }
/* Verified: the only filled green badge (plus the check-shield icon), so it never drowns in the green. */
.badge-trust-verified { background: var(--c-success); border-color: var(--c-success); color: var(--c-success-ink); box-shadow: 0 0 8px var(--c-glow-soft); }
/* A changed key is an alert: red, with the alert icon and text. */
.badge-trust-changed { background: var(--c-danger-soft); border-color: var(--c-danger); color: var(--c-danger); }
.badge-neutral { background: var(--c-surface-2); border-color: var(--c-border-dim); color: var(--c-text); font-weight: 500; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-danger); color: var(--c-danger-ink); font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: var(--s1); min-height: 36px; padding: 0 var(--s2) 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--c-border-strong); background: var(--c-primary-soft); color: var(--c-text); font-size: 14px; }
.chip button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: var(--r1); background: transparent; color: var(--c-text); }
.chip button:hover { background: var(--c-surface); color: var(--c-primary); }
.chip .icon { width: 16px; height: 16px; }
@media (pointer: coarse) { .chip { min-height: 44px; } .chip button { width: 36px; height: 36px; } }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: var(--r1); overflow: hidden; color: var(--c-av-ink); border: 1px solid var(--c-border-dim); font-weight: 700; font-size: 18px; letter-spacing: .02em; user-select: none; text-shadow: var(--glow-text-sm); }
.avatar img { width: 100%; height: 100%; object-fit: cover; background: var(--c-surface); }
.avatar.has-image { background: var(--c-surface); border: 1px solid var(--c-border-dim); }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; border-radius: var(--r2); }
.avatar-round { border-radius: 50%; }
.avatar.c0 { background: var(--c-av0); } .avatar.c1 { background: var(--c-av1); } .avatar.c2 { background: var(--c-av2); }
.avatar.c3 { background: var(--c-av3); } .avatar.c4 { background: var(--c-av4); } .avatar.c5 { background: var(--c-av5); }

.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); border: 1px solid var(--c-border-dim); background: var(--c-surface); margin-bottom: var(--s4); }
.notice > .icon { width: 22px; height: 22px; margin-top: 1px; color: var(--c-muted); }
.notice p:last-child { margin-bottom: 0; }
.notice-info { background: var(--c-primary-soft); border-color: var(--c-border-dim); }
.notice-info > .icon { color: var(--c-primary); }
.notice-warning { background: var(--c-warning-soft); border-color: var(--c-warning); color: var(--c-warning-text); }
.notice-warning > .icon { color: var(--c-warning); }
.notice-warning strong { color: var(--c-warning-text); }
.notice-danger { background: var(--c-danger-soft); border-color: var(--c-danger); color: var(--c-danger-text); }
.notice-danger > .icon { color: var(--c-danger); }
.notice-danger strong { color: var(--c-danger-text); }
.notice-success { background: var(--c-success-soft); border-color: var(--c-success); }
.notice-success > .icon { color: var(--c-success); }

/* ===== 8. Landing ===== */
/* The hero is the one place the rain runs bright: its words sit in an opaque terminal window, and the
   sections below are opaque so the rain stays behind the hero. */
.hero { padding-block: var(--s5) var(--s6); } /* a band of rain shows above and below the window, phones included */
/* Phones: the terminal fills the width, so the rain gets a deliberate band above it (review L2). */
@media (max-width: 599.98px) { .hero { padding-top: 72px; } }
.hero-terminal { max-width: 880px; background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: var(--r2); box-shadow: 0 0 0 1px rgba(0, 255, 65, .08), 0 0 40px rgba(0, 255, 65, .16), 0 24px 60px rgba(0, 0, 0, .9); }
.term-bar { display: flex; align-items: center; gap: var(--s3); min-width: 0; padding: var(--s2) var(--s4); border-bottom: 1px solid var(--c-border); color: var(--c-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.term-dots { flex: none; display: inline-flex; gap: 6px; }
.term-dots > span { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--c-border-strong); }
.term-dots > span:first-child { background: var(--c-border-strong); }
.hero-terminal-body { padding: var(--s4); }
.hero h1 { font-size: 26px; max-width: 22ch; }
/* Blinking block cursor after the landing title (decorative: an empty pseudo-element is not read). */
.hero h1::after { content: ""; display: inline-block; width: .55em; height: .95em; margin-inline-start: .12em; vertical-align: -.1em; background: var(--c-primary); box-shadow: 0 0 10px var(--c-glow); animation: cursor-blink 1.06s steps(1, end) infinite; }
@keyframes cursor-blink { 50% { opacity: 0; } }
.hero .lead { max-width: 60ch; margin-bottom: var(--s5); }
/* Decorative prompts use the alt-text form (`/ ""`) so screen readers skip them; browsers without it drop the rule. */
.hero .lead::before { content: "> " / ""; color: var(--c-primary); }
@media (min-width: 600px) { .hero { padding-block: var(--s6) var(--s7); } .hero h1 { font-size: 34px; } .hero-terminal-body { padding: var(--s5) var(--s6) var(--s6); } }
.hero-panel { background: var(--c-bg); border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s4); }
.hero-secondary { margin-top: var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.section { padding-block: var(--s6); background: var(--c-bg); }
body[data-view="landing"] .app-main { padding-bottom: 0; } /* no stray band of bright rain above the footer */
.section + .section { border-top: 1px solid var(--c-border); }
.section-head { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; justify-content: space-between; margin-bottom: var(--s4); }
.section-head h2 { margin: 0; }
.section h2::before, .join-cta h2::before { content: "// " / ""; color: var(--c-muted); text-shadow: none; }
.how-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.how-step .value-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r1); background: var(--c-primary-soft); border: 1px solid var(--c-border-strong); color: var(--c-primary); margin-bottom: var(--s3); filter: drop-shadow(0 0 4px rgba(0, 255, 65, .35)); }
.how-step h3 { margin-bottom: var(--s2); }
.how-step p { margin: 0; color: var(--c-muted); }
.how-n { color: var(--c-primary); }
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
@media (min-width: 600px) { .tile-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.tile { display: flex; align-items: center; gap: var(--s2); min-height: 56px; padding: var(--s3); font-size: 14px; background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); color: var(--c-text); text-decoration: none; height: 100%; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--c-primary); text-decoration: none; box-shadow: 0 0 12px var(--c-glow-soft); }
.tile:hover .tile-title { color: var(--c-primary); }
@media (min-width: 600px) { .tile { gap: var(--s3); min-height: 64px; padding: var(--s3) var(--s4); font-size: 15px; } }
.tile-body { flex: 1; min-width: 0; }
.tile-title { display: block; font-weight: 700; }
.tile-sub { display: block; font-size: 13px; color: var(--c-muted); }
.tile > .icon { color: var(--c-primary); width: 20px; height: 20px; }
.tile-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--r1); background: var(--c-surface-2); color: var(--c-primary); font-weight: 700; font-size: 14px; }
.join-cta { display: grid; gap: var(--s4); align-items: center; background: var(--c-primary-soft); border: 1px solid var(--c-border-strong); border-radius: var(--r2); padding: var(--s5); box-shadow: 0 0 24px rgba(0, 255, 65, .08); }
.join-cta h2 { margin-bottom: var(--s2); }
.join-cta p { margin: 0; }
@media (min-width: 600px) { .join-cta { grid-template-columns: 1fr auto; padding: var(--s6); } }

/* ===== 9. Product-type search (DESIGN-v2-wilderness.md §6.4, §6.5) ===== */
.type-search { display: grid; gap: var(--s2); grid-template-columns: minmax(0, 1fr); }
.type-search .field { margin: 0; }
.search-input-wrap { position: relative; }
.search-input-wrap .icon { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); color: var(--c-primary); width: 20px; height: 20px; pointer-events: none; }
.search-input-wrap .input { padding-inline-start: 40px; }
@media (min-width: 600px) { .type-search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.type-search-hero .input { min-height: 52px; font-size: 16px; }
.type-search-hero .btn { min-height: 52px; padding-inline: var(--s5); }

/* ===== 10. Categories and room lists ===== */
.page-head { margin-bottom: var(--s4); }
.page-head p { color: var(--c-muted); margin: 0; }
.cat-search { margin-bottom: var(--s5); }
.section-tight { margin-bottom: var(--s5); }
.cat-results { margin-bottom: var(--s5); }
.cat-results-title { font-size: 17px; }
.cat-results h3 { font-size: 15px; color: var(--c-muted); margin-top: var(--s4); }
.cat-propose { margin: var(--s3) 0 0; }
.lead-sm { color: var(--c-muted); }
.tile-grid-small { margin-bottom: var(--s3); }
.room-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.rli-link { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); color: var(--c-text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.rli-link:hover { border-color: var(--c-primary); text-decoration: none; box-shadow: 0 0 12px var(--c-glow-soft); }
.rli-link > .icon { color: var(--c-primary); width: 20px; height: 20px; }
.rli-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rli-name { font-weight: 700; color: var(--c-heading); }
.rli-link:hover .rli-name { color: var(--c-primary); }
.rli-parent { font-size: 12px; color: var(--c-muted); }
.rli-desc { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rli-stats { margin: 0; font-size: 12px; color: var(--c-muted); }
.rli-stats:empty { display: none; }
.rli-unread { flex: none; font-size: 12px; font-weight: 700; color: var(--c-primary-ink); background: var(--c-primary); border-radius: var(--r-pill); padding: 2px var(--s2); }
.room-list-item.is-skeleton { padding: var(--s3) var(--s4); border: 1px solid var(--c-border-dim); border-radius: var(--r2); background: var(--c-surface); }
@media (max-width: 599.98px) { .rli-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } }
/* Smarter search (DESIGN-v2-wilderness.md §11.6): "Mungkin maksud Anda" under the local results, with its label */
.ai-suggest { margin: var(--s4) 0; }
.ai-suggest-host:first-child .ai-suggest { margin-top: 0; }
.ai-suggest-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); }
.ai-suggest-head h2 { margin: 0; }
.badge-ai { border-color: var(--c-border-dim); color: var(--c-muted); font-weight: 600; }
.rli-note { color: var(--c-text); }
@media (min-width: 600px) { .rli-note { white-space: normal; } }
.ai-suggest-loading { margin: var(--s3) 0 0; font-size: 14px; }
.welcome-panel { margin-bottom: var(--s4); padding: var(--s4); background: var(--c-primary-soft); border: 1px solid var(--c-border-strong); border-radius: var(--r2); }
.welcome-panel h2 { font-size: 17px; margin-bottom: var(--s2); }
.welcome-panel p { margin: 0 0 var(--s3); }
.welcome-panel p:last-child { margin-bottom: 0; }

/* ===== 11. Supplier card ===== */
.sc-head { display: flex; gap: var(--s3); align-items: flex-start; }
.sc-title { flex: 1; min-width: 0; }
.sc-name { font-size: 17px; margin: 0 0 2px; }
.sc-name a { color: var(--c-heading); text-decoration: none; }
.sc-name a:hover { text-decoration: underline; }
.sc-tagline { margin: 0; color: var(--c-muted); }
.sc-badges { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.sc-facts { display: grid; gap: var(--s1) var(--s4); grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; font-size: 14px; }
@media (min-width: 600px) { .sc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sc-facts li { display: flex; gap: var(--s2); align-items: flex-start; min-width: 0; }
.sc-facts .icon { width: 18px; height: 18px; color: var(--c-primary); margin-top: 1px; }
.sc-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; border-top: 1px dashed var(--c-border); padding-top: var(--s3); }
.sc-meta { font-size: 13px; color: var(--c-muted); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.sc-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 599px) { .sc-actions { width: 100%; } .sc-actions .btn { flex: 1 1 140px; padding-inline: var(--s2); gap: 6px; } }

/* ===== 12. Supplier profile ===== */
.breadcrumb { font-size: 14px; margin-bottom: var(--s3); }
.breadcrumb a { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; }
.profile-header { display: grid; gap: var(--s4); margin-bottom: var(--s5); }
.profile-identity { display: flex; gap: var(--s4); align-items: flex-start; }
.profile-identity h1 { margin-bottom: var(--s1); }
.profile-identity .sc-tagline { font-size: 16px; }
.profile-location { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); color: var(--c-muted); font-size: 14px; margin-top: var(--s2); }
.profile-location .inline-icon .icon { width: 16px; height: 16px; }
.profile-cta { display: grid; gap: var(--s2); }
.profile-cta .btn-row .btn { flex: 1 1 200px; }
@media (min-width: 600px) { .profile-cta .btn-row .btn { flex: 0 0 auto; } }
.profile-layout { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) {
  .profile-header { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .profile-cta { justify-items: end; text-align: end; }
  .profile-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
/* One explicit shrinkable column: an implicit auto track grows to its items' min-content, and the review
   tabs (a scrolling .tab-list) made it wider than a 320 px phone. */
.profile-main, .profile-aside { display: grid; gap: var(--s4); min-width: 0; grid-template-columns: minmax(0, 1fr); }
.profile-section h2 { font-size: 17px; display: flex; gap: var(--s2); align-items: center; }
.profile-section h2 .icon { width: 20px; height: 20px; color: var(--c-primary); }
.profile-section > :last-child { margin-bottom: 0; }
.about-text { white-space: pre-line; }
.fact-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
.fact-list > div { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: var(--s3); padding-block: var(--s1); border-bottom: 1px dashed var(--c-border); }
.fact-list > div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--c-muted); font-size: 14px; }
.fact-list dd { font-size: 14px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.plain-list li { display: flex; gap: var(--s2); align-items: flex-start; }
.plain-list li > .icon { width: 18px; height: 18px; color: var(--c-success); margin-top: 3px; }
.product-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.product { border: 1px solid var(--c-border-dim); border-radius: var(--r1); padding: var(--s3); background: var(--c-bg); }
.product h3 { font-size: 15px; margin-bottom: var(--s1); }
.product p { margin-bottom: var(--s2); color: var(--c-muted); font-size: 14px; }
.product-meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-size: 14px; }
.product-price { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-heading); }
.tier-table { width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; margin-top: var(--s2); }
.tier-table th, .tier-table td { text-align: start; padding: var(--s1) var(--s2); border-bottom: 1px solid var(--c-border); }
.tier-table th { color: var(--c-muted); font-weight: 700; }
.tier-table td:last-child, .tier-table th:last-child { text-align: end; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.cert { display: grid; gap: 2px; padding: var(--s2) 0; border-bottom: 1px dashed var(--c-border); }
.cert:last-child { border-bottom: 0; }
.cert-name { font-weight: 700; }
.cert-status { font-size: 14px; display: inline-flex; gap: var(--s1); align-items: center; }
.cert-status .icon { width: 16px; height: 16px; }
.cert-status.is-reviewed { color: var(--c-success); }
.cert-status.is-self { color: var(--c-muted); }
.cert-status.is-expired { color: var(--c-danger); }
.hours-table { width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.hours-table th, .hours-table td { text-align: start; padding: 6px 0; border-bottom: 1px dashed var(--c-border); font-weight: 400; }
.hours-table th { color: var(--c-muted); width: 40%; }
.hours-table tr:last-child th, .hours-table tr:last-child td { border-bottom: 0; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(min(150px, 45%), 1fr)); }
.photo-grid a, .photo-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r1); background: var(--c-surface-2); }
.photo-grid img { border: 1px solid var(--c-border-dim); }
.photo-full img { width: 100%; height: auto; max-height: 75vh; object-fit: contain; border-radius: var(--r1); }
.contact-list { display: grid; gap: var(--s2); }
.contact-list a { display: inline-flex; gap: var(--s2); align-items: center; min-height: 44px; }
.disclaimer { font-size: 14px; color: var(--c-muted); display: flex; gap: var(--s2); align-items: flex-start; }
.disclaimer .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.report-link { display: inline-flex; align-items: center; gap: var(--s2); color: var(--c-muted); }
.report-link .icon { width: 18px; height: 18px; }
.radio-list { display: grid; }

/* ===== 13. Profile editor ===== */
.editor { max-width: 880px; }
.editor-head { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.editor-head h1 { margin: 0; }
.form-section { background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s4); margin-bottom: var(--s4); }
@media (min-width: 600px) { .form-section { padding: var(--s5); } }
.form-section > h2 { font-size: 17px; margin-bottom: var(--s1); }
.form-section > .section-intro { color: var(--c-muted); font-size: 14px; margin-bottom: var(--s4); }
.repeater { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; gap: var(--s3); }
.repeater-item { border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s3) var(--s4); background: var(--c-bg); }
.repeater-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.repeater-head h3 { font-size: 15px; margin: 0; }
.tier-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s2); align-items: end; }
.tier-row .field { margin-bottom: var(--s2); }
.tier-row .btn { margin-bottom: var(--s2); }
.hours-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); align-items: end; }
.hours-row .field { margin-bottom: var(--s2); }
.hours-row .day { padding-bottom: 20px; font-weight: 700; font-size: 14px; }
.hours-head { font-weight: 700; font-size: 14px; margin-bottom: var(--s1); }
@media (max-width: 479px) {
  .hours-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--s2); }
  .hours-row .day { grid-column: 1 / -1; padding: var(--s1) 0 0; }
  .hours-head > span:first-child { display: none; }
}
.vis-toggle { margin-top: calc(-1 * var(--s3)); margin-bottom: var(--s3); }
.vis-toggle .check { min-height: 40px; padding-block: 4px; font-size: 14px; }
.media-block { display: grid; gap: var(--s2); padding-block: var(--s3); border-bottom: 1px solid var(--c-border); }
.media-block:last-child { border-bottom: 0; }
.media-block h3 { font-size: 15px; margin: 0; }
.media-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.thumb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.thumb { position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r1); border: 1px solid var(--c-border-dim); background: var(--c-surface-2); display: block; }
.thumb .btn { position: absolute; top: 4px; right: 4px; background: var(--c-surface); border-color: var(--c-border-strong); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input:focus-visible + label { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; justify-content: flex-end; padding: var(--s3) var(--gutter); margin-inline: calc(-1 * var(--gutter)); background: var(--c-surface); border-top: 1px solid var(--c-border-strong); box-shadow: 0 -4px 18px rgba(0, 0, 0, .8), 0 -1px 12px rgba(0, 255, 65, .08); }
@media (min-width: 600px) { .save-bar { margin-inline: 0; padding: var(--s3) var(--s5); border: 1px solid var(--c-border-strong); border-bottom: 0; border-radius: var(--r2) var(--r2) 0 0; } }
.pay-param { margin: 0 0 var(--s3) 34px; max-width: 220px; }
body.has-bottom-nav .save-bar { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { body.has-bottom-nav .save-bar { bottom: 0; } }
.save-bar .save-status { margin-inline-end: auto; font-size: 14px; color: var(--c-muted); }

/* ===== 14. Static pages ===== */
/* Long reading happens on an opaque panel, never directly over the rain. */
.prose { max-width: 72ch; }
.static-body .prose { background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s4); }
@media (min-width: 600px) { .static-body .prose { padding: var(--s5) var(--s6); } }
.prose h2 { margin-top: var(--s6); font-size: 19px; }
.prose > section:first-child h2 { margin-top: 0; }
.prose p, .prose li { font-size: 15px; line-height: 1.7; }
.prose li + li { margin-top: var(--s2); }
.prose li::marker { color: var(--c-primary); }
.limits-list { counter-reset: lim; list-style: none; padding: 0; }
.limits-list li { counter-increment: lim; position: relative; padding: var(--s3) var(--s3) var(--s3) 52px; border: 1px solid var(--c-border-dim); border-radius: var(--r2); background: var(--c-bg); }
.limits-list li::before { content: counter(lim); position: absolute; left: var(--s3); top: var(--s3); width: 28px; height: 28px; border-radius: var(--r1); background: var(--c-warning-soft); border: 1px solid var(--c-warning); color: var(--c-warning); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.static-head { max-width: 72ch; }
.static-body { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) {
  .static-body { grid-template-columns: minmax(0, 72ch) 260px; gap: var(--s7); }
  .static-body .toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + var(--s5)); }
  .static-body .prose { grid-column: 1; grid-row: 1; }
}
.toc { border-left: 3px solid var(--c-border-strong); padding: var(--s2) var(--s3) var(--s2) var(--s4); margin-block: var(--s2); background: var(--c-surface); border-radius: 0 var(--r2) var(--r2) 0; }
.toc h2 { font-size: 14px; color: var(--c-muted); margin: 0 0 var(--s1); text-shadow: none; text-transform: uppercase; letter-spacing: .08em; }
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; font-size: 14px; }
.toc a { display: inline-flex; min-height: 32px; align-items: center; }
@media (pointer: coarse) { .toc a { min-height: 40px; } }
.page-meta { font-size: 14px; color: var(--c-muted); }

/* ===== 15. States ===== */
.empty-state, .error-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); padding: var(--s6) var(--s4); background: var(--c-surface); border: 1px dashed var(--c-border-strong); border-radius: var(--r2); }
.error-state { border-style: solid; border-color: var(--c-danger); }
.state-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--r2); background: var(--c-surface-2); border: 1px solid var(--c-border-dim); color: var(--c-primary); margin-bottom: var(--s2); }
.state-icon .icon { width: 28px; height: 28px; }
.error-state .state-icon { background: var(--c-danger-soft); border-color: var(--c-danger); color: var(--c-danger); }
.empty-state h2, .error-state h2 { font-size: 17px; margin: 0; }
.error-state h2, .error-state h1, .error-state h3 { color: var(--c-danger-text); text-shadow: none; }
.empty-state p, .error-state p { margin: 0; color: var(--c-muted); max-width: 48ch; }
.empty-state .btn, .error-state .btn { margin-top: var(--s3); }
.skeleton { display: block; background: var(--c-skeleton); border-radius: var(--r1); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.skeleton-line { height: 14px; margin-bottom: var(--s2); }
.skeleton-line.w-30 { width: 30%; } .skeleton-line.w-50 { width: 50%; } .skeleton-line.w-70 { width: 70%; } .skeleton-line.w-90 { width: 90%; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: var(--s2); }
.skeleton-avatar { width: 48px; height: 48px; flex: none; }
.skeleton-card { display: grid; gap: var(--s2); }
.skeleton-card .row { align-items: flex-start; }
.skeleton-card .row > div { flex: 1; }
.skeleton-bubble { height: 44px; width: 55%; border-radius: var(--r2); }
.skeleton-bubble.is-own { margin-inline-start: auto; width: 45%; }
.skeleton-text { display: inline-block; height: 1em; width: 12ch; vertical-align: middle; }
.spinner { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inline { display: flex; gap: var(--s2); align-items: center; justify-content: center; color: var(--c-muted); padding: var(--s4); }

/* ===== 16. Dialogs and toasts ===== */
.dialog { width: min(560px, calc(100vw - 2 * var(--s4))); max-height: calc(100dvh - 2 * var(--s4)); padding: 0; border: 1px solid var(--c-border-strong); border-radius: var(--r2); background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: var(--c-overlay); }
.dialog-inner { display: flex; flex-direction: column; max-height: inherit; }
.dialog-header { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s3) var(--s3) var(--s4); border-bottom: 1px solid var(--c-border); }
.dialog-header h2 { flex: 1; font-size: 17px; margin: 0; }
.dialog-body { padding: var(--s4); overflow: auto; overscroll-behavior: contain; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-footer { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s4); border-top: 1px solid var(--c-border); }
.dialog-wide { width: min(880px, calc(100vw - 2 * var(--s4))); }
/* Key-change interstitial and destructive confirmations: red header, title and frame. */
.dialog-alert, .dialog-danger { border-color: var(--c-danger); box-shadow: 0 0 0 1px rgba(255, 107, 107, .25), 0 0 32px rgba(255, 107, 107, .16), 0 16px 40px rgba(0, 0, 0, .85); }
.dialog-alert .dialog-header, .dialog-danger .dialog-header { background: var(--c-danger-soft); border-bottom-color: var(--c-danger); }
.dialog-alert .dialog-header h2, .dialog-danger .dialog-header h2 { color: var(--c-danger-text); text-shadow: none; }
@media (max-width: 599px) {
  .dialog-sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .dialog-sheet .dialog-inner { height: 100%; }
  .dialog-sheet .dialog-body { flex: 1; }
  .dialog-sheet .dialog-footer { padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
  .dialog-footer .btn { flex: 1 1 auto; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .dialog-sheet { height: min(860px, calc(100dvh - 2 * var(--s4))); }
  .dialog-sheet .dialog-inner { height: 100%; }
  .dialog-sheet .dialog-body { flex: 1; }
}
.toast-region { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--s4) + env(safe-area-inset-bottom)); width: min(480px, calc(100vw - 2 * var(--s4))); display: flex; flex-direction: column; gap: var(--s2); pointer-events: none; }
body.has-bottom-nav .toast-region { bottom: calc(var(--bottom-nav-h) + var(--s3) + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { body.has-bottom-nav .toast-region { bottom: var(--s4); } }
/* Views with a composer at the bottom (rooms, private threads): toasts sit under the header, not over the send
   button (v2 UX review M4); on wide screens at the right, clear of the conversation. */
body[data-view="room"] .toast-region, body[data-view="room-members"] .toast-region, body[data-view="chat-thread"] .toast-region { top: calc(var(--header-h) + var(--s3) + env(safe-area-inset-top)); bottom: auto; }
@media (min-width: 900px) { body[data-view="room"] .toast-region, body[data-view="room-members"] .toast-region, body[data-view="chat-thread"] .toast-region { left: auto; right: var(--s4); transform: none; } }
.toast { pointer-events: auto; display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--c-surface-2); color: var(--c-text); border: 1px solid var(--c-primary); box-shadow: 0 0 18px var(--c-glow-soft), 0 10px 30px rgba(0, 0, 0, .9); font-size: 14px; animation: toast-in .18s ease-out; }
.toast .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--c-primary); }
.toast-error { background: var(--c-danger-soft); color: var(--c-danger-text); border-color: var(--c-danger); box-shadow: 0 0 18px rgba(255, 107, 107, .2), 0 10px 30px rgba(0, 0, 0, .9); }
.toast-error .icon { color: var(--c-danger); }
.toast-success .icon { color: var(--c-success); }
.toast button { margin-inline-start: auto; background: transparent; border: 0; color: inherit; min-width: 32px; min-height: 32px; border-radius: var(--r1); display: inline-flex; align-items: center; justify-content: center; }
.toast button .icon { color: inherit; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== 17. Chat (shared design system; views and components by track D2) ===== */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--header-h) - var(--bottom-nav-h) - env(safe-area-inset-bottom)); min-height: 360px; }
@media (min-width: 600px) { .chat-layout { height: calc(100dvh - var(--header-h)); } }
body[data-view="chat-thread"] .chat-layout, body[data-view="room"] .room-layout, body[data-view="room-members"] .room-layout { height: calc(100dvh - var(--header-h)); }
@media (min-width: 1024px) {
  .chat-layout { grid-template-columns: var(--chat-list-w) minmax(0, 1fr); max-width: var(--content-max); margin-inline: auto; border-inline: 1px solid var(--c-border-strong); background: var(--c-surface); }
  .chat-layout .chat-pane-list { border-right: 1px solid var(--c-border-strong); }
}
.chat-pane-list, .chat-pane-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--c-surface); }
@media (max-width: 1023px) { .chat-layout.is-thread .chat-pane-list, .chat-layout:not(.is-thread) .chat-pane-thread { display: none; } }
.chat-pane-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--c-border); min-height: 60px; }
.chat-pane-head h1, .chat-pane-head h2 { font-size: 17px; margin: 0; flex: 1; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.chat-list-item { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--c-border); color: var(--c-text); text-decoration: none; min-height: 72px; }
.chat-list-item:hover { background: var(--c-surface-2); text-decoration: none; }
.chat-list-item:focus-visible { outline-offset: -3px; } /* inside the item: the list's scroll box clips an outer ring */
.chat-list-item[aria-current="page"] { background: var(--c-primary-soft); box-shadow: inset 3px 0 0 var(--c-primary); }
.cli-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cli-top, .cli-bottom { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.cli-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-time { font-size: 12px; color: var(--c-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cli-preview { flex: 1; min-width: 0; font-size: 13px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-preview .icon { width: 14px; height: 14px; }
.chat-list-item.is-unread .cli-name, .chat-list-item.is-unread .cli-preview { color: var(--c-heading); font-weight: 700; }
.chat-empty-pane { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); color: var(--c-muted); padding: var(--s5); text-align: center; background: var(--c-bg); }
/* No chats yet: the list already says so; "Pilih chat di sebelah kiri" would point at nothing (UX-17). */
.chat-layout:has(.chat-list-empty) .chat-empty-pane > * { display: none; }

.thread { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.thread-header { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--c-border-strong); min-height: 60px; background: var(--c-surface); }
.thread-header .th-title { flex: 1; min-width: 0; display: grid; }
.thread-header .th-name { font-weight: 700; font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-heading); text-shadow: var(--glow-text-sm); }
.thread-header .th-sub { font-size: 12px; color: var(--c-muted); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
@media (min-width: 1024px) { .thread-header .th-back { display: none; } }
/* The conversation is a calm black terminal: the rain never runs behind messages. */
.message-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s2); background: var(--c-bg); }
@media (min-width: 600px) { .message-list { padding-inline: var(--s5); } }
.day-separator { align-self: center; font-size: 12px; color: var(--c-muted); background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r-pill); padding: 2px var(--s3); margin-block: var(--s3); letter-spacing: .04em; }
.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); }
.msg-own { align-self: flex-end; align-items: flex-end; }
.msg-other { align-self: flex-start; align-items: flex-start; }
.msg-sender { font-size: 12px; font-weight: 700; color: var(--c-primary); margin: 0 var(--s2) 2px; }
/* Theirs: dim panel, dim frame, left. Mine: green-tinted panel, bright frame, right. */
.bubble { padding: var(--s2) var(--s3); border-radius: var(--r2); background: var(--c-surface-2); border: 1px solid var(--c-border-dim); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg-own .bubble { background: var(--c-primary-soft); border-color: var(--c-border-strong); border-bottom-right-radius: 0; box-shadow: 0 0 10px rgba(0, 255, 65, .08); }
.msg-other .bubble { border-bottom-left-radius: 0; }
.bubble-meta { display: flex; gap: var(--s2); align-items: center; font-size: 12px; color: var(--c-muted); margin: 2px var(--s2) 0; font-variant-numeric: tabular-nums; }
.bubble-meta .icon { width: 14px; height: 14px; }
.msg-status-failed { color: var(--c-danger); font-weight: 700; }
.msg-retry { background: none; border: 0; padding: 0 var(--s1); color: var(--c-danger); font: inherit; font-weight: 700; text-decoration: underline; min-height: 32px; }
.msg-flags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.msg-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-warning); background: var(--c-warning-soft); border: 1px solid var(--c-warning-border); border-radius: var(--r-pill); padding: 2px var(--s2); }
.msg-flag .icon { width: 13px; height: 13px; }
.system-line { align-self: center; max-width: 92%; text-align: center; font-size: 13px; color: var(--c-muted); padding: var(--s1) var(--s3); display: flex; gap: var(--s2); align-items: flex-start; justify-content: center; }
.system-line .icon { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.system-line.is-e2ee { background: var(--c-surface); border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s2) var(--s3); }
.system-line.is-e2ee .icon { color: var(--c-success); }
/* Key changes and membership alerts in the thread are red (with the alert icon and words). */
.system-line.is-warning { color: var(--c-danger); }
.msg-placeholder { align-self: stretch; display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); border: 1px dashed var(--c-border-strong); border-radius: var(--r2); color: var(--c-muted); font-size: 14px; background: transparent; }
.msg-placeholder .icon { width: 18px; height: 18px; }
.held-notice { align-self: stretch; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s3); border: 1px dashed var(--c-danger); border-radius: var(--r2); background: var(--c-danger-soft); color: var(--c-danger-text); font-size: 14px; }
.fraud-tip { display: flex; gap: var(--s2); align-items: flex-start; margin-top: var(--s1); padding: var(--s2) var(--s3); border-radius: var(--r1); background: var(--c-warning-soft); border: 1px solid var(--c-warning-border); color: var(--c-warning-text); font-size: 13px; max-width: 100%; }
.fraud-tip .icon { width: 16px; height: 16px; color: var(--c-warning); margin-top: 1px; }
.unread-divider { display: flex; align-items: center; gap: var(--s2); color: var(--c-primary); font-size: 12px; font-weight: 700; margin-block: var(--s2); text-transform: uppercase; letter-spacing: .08em; }
.unread-divider::before, .unread-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-primary); opacity: .5; }
.thread-start { align-self: center; font-size: 12px; color: var(--c-muted); padding: var(--s2); }
.biz-card { align-self: stretch; max-width: 100%; border: 1px solid var(--c-border-strong); border-radius: var(--r2); background: var(--c-surface); overflow: hidden; box-shadow: 0 0 14px rgba(0, 255, 65, .08); }
.msg-own .biz-card, .msg-other .biz-card { align-self: stretch; }
.msg.has-card { max-width: min(100%, 560px); width: 100%; }
.biz-card-strip { display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); font-weight: 700; font-size: 13px; color: var(--c-primary-ink); background: var(--c-primary); text-transform: uppercase; letter-spacing: .06em; }
.biz-card-strip .icon { width: 18px; height: 18px; }
.biz-card.is-rfq { border-color: var(--c-accent); }
.biz-card.is-rfq .biz-card-strip { background: var(--c-accent); color: var(--c-accent-ink); }
.biz-card.is-quote .biz-card-strip { background: var(--c-primary); color: var(--c-primary-ink); }
.biz-card-body { padding: var(--s3); display: grid; gap: var(--s2); }
.biz-card-body .fact-list > div { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
/* Narrow cards: label above value, so long monospace labels ("Waktu pengerjaan/kirim") never break mid-word. */
@media (max-width: 479px) { .biz-card-body .fact-list > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.biz-card-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0 var(--s3) var(--s3); }
.quote-table { width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.quote-table th, .quote-table td { padding: var(--s1) var(--s2); text-align: start; border-bottom: 1px dashed var(--c-border); vertical-align: top; }
.quote-table thead th { color: var(--c-muted); }
.quote-table td.num, .quote-table th.num { text-align: end; white-space: nowrap; }
.quote-table tfoot td, .quote-table tfoot th { font-weight: 700; border-bottom: 0; color: var(--c-heading); }
.composer { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2) var(--s3); padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom)); border-top: 1px solid var(--c-border-strong); background: var(--c-surface); }
.composer-row { display: flex; gap: var(--s2); align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 40vh; resize: none; padding: 10px var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r2); background: var(--c-bg); color: var(--c-text); font-size: 16px; caret-color: var(--c-primary); line-height: 1.4; overflow-y: auto; }
.composer textarea::placeholder { color: var(--c-muted); opacity: 1; }
.composer textarea:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 0; }
.composer .btn-icon { border-radius: var(--r2); }
.composer-send { background: var(--c-primary); color: var(--c-primary-ink); box-shadow: 0 0 12px var(--c-glow-soft); }
.composer-tools { display: flex; gap: var(--s1); flex-wrap: wrap; }
.composer-blocked { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s3); border-radius: var(--r2); background: var(--c-warning-soft); border: 1px solid var(--c-warning); color: var(--c-warning-text); font-size: 14px; }
.composer-attachments { display: flex; flex-wrap: wrap; gap: var(--s2); }
.file-chip { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r2); background: var(--c-surface); min-width: 0; max-width: 100%; }
.file-chip > .icon { width: 28px; height: 28px; color: var(--c-primary); }
.file-chip-body { flex: 1; min-width: 0; display: grid; }
.file-chip-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-meta { font-size: 12px; color: var(--c-muted); }
.file-chip progress { width: 100%; height: 6px; accent-color: var(--c-primary); }
.file-chip.is-risky { border-color: var(--c-warning); }
.image-view { display: block; border-radius: var(--r2); overflow: hidden; border: 1px solid var(--c-border-strong); background: var(--c-surface-2); max-width: 320px; }
.image-view img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; }
.image-view button { display: block; padding: 0; border: 0; background: transparent; width: 100%; }
.image-tap { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 120px; padding: var(--s4); color: var(--c-muted); font-size: 14px; }
.connection-banner { display: flex; gap: var(--s2); align-items: center; justify-content: center; padding: var(--s2) var(--s4); font-size: 14px; background: var(--c-warning-soft); color: var(--c-warning-text); border-bottom: 1px solid var(--c-warning); }
.connection-banner .icon { color: var(--c-warning); }
.connection-banner.is-offline { background: var(--c-danger-soft); color: var(--c-danger-text); border-bottom-color: var(--c-danger); }
.connection-banner.is-offline .icon { color: var(--c-danger); }
.connection-banner .icon { width: 18px; height: 18px; }
.e2ee-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-muted); }
.e2ee-badge .icon { width: 14px; height: 14px; color: var(--c-success); }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-item { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-bottom: 1px dashed var(--c-border); }
.member-item .cli-body { flex: 1; }
/* Security code: big bright digits in a black well, grouped; glow kept faint so the digits stay crisp. */
.security-code { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: var(--s2) var(--s5); padding: var(--s4); border-radius: var(--r2); background: var(--c-bg); border: 1px solid var(--c-border-strong); color: var(--c-heading); text-shadow: var(--glow-text-sm); font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: .05em; font-variant-numeric: tabular-nums; list-style: none; margin: 0 0 var(--s4); }
@media (max-width: 359px) { .security-code { font-size: 17px; gap: var(--s2) var(--s3); padding: var(--s3); } }
.security-code li { text-align: center; }
.recovery-code { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s3); padding: var(--s4); border: 2px dashed var(--c-border-strong); border-radius: var(--r2); background: var(--c-bg); color: var(--c-heading); text-shadow: var(--glow-text-sm); font-family: var(--font-mono); font-size: 20px; letter-spacing: .08em; font-weight: 700; user-select: all; margin-bottom: var(--s3); }
.trust-panel { display: grid; gap: var(--s3); padding: var(--s4); border-radius: var(--r2); border: 1px solid var(--c-border-dim); background: var(--c-surface); }
.trust-panel.is-changed { border-color: var(--c-danger); background: var(--c-danger-soft); color: var(--c-danger-text); }
.progress-steps { display: flex; gap: var(--s1); margin-bottom: var(--s4); }
.progress-steps span { flex: 1; height: 4px; border-radius: 0; background: var(--c-border); }
.progress-steps span.is-done { background: var(--c-primary); box-shadow: 0 0 6px var(--c-glow); }
.auth-card { max-width: 480px; margin-inline: auto; }

/* ===== 18. Motion, forced colours ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
  .hero h1::after { animation: none; }
}
@media (forced-colors: active) {
  .btn, .badge, .chip, .card, .tile, .input, .select, .textarea, .public-badge, .rel-chip, .role-chip { border: 1px solid CanvasText; }
  .btn-primary, .btn-accent { border: 2px solid ButtonText; }
  .bottom-nav a[aria-current="page"]::before { background: Highlight; }
  .skeleton { border: 1px solid GrayText; }
  .check input[type="checkbox"], .check input[type="radio"] { appearance: auto; -webkit-appearance: auto; }
  .check input::after { display: none; }
  .matrix-rain { display: none; }
  .hero h1::after { background: CanvasText; }
}

/* ===== 19. Digital rain (ui/matrix-rain.js) ===== */
/* One fixed canvas behind everything (body's background is the viewport's, so z-index -1 paints above it).
   Mirrored like the film's code. Its brightness per mode is the canvas opacity below; the contrast test
   (tests/ui/theme-contrast.test.js) checks page text against the brightest rain pixel of each mode. */
.matrix-rain { position: fixed; top: 0; left: 0; z-index: -1; display: block; pointer-events: none; transform: scaleX(-1); opacity: .2; }
.matrix-rain[data-mode="hero"] { opacity: .85; }
.matrix-rain[data-mode="page"] { opacity: .2; }
.matrix-rain[data-mode="calm"] { opacity: .12; }
.matrix-rain[data-mode="off"] { opacity: 0; }

/* ===== 20. Print ===== */
/* Paper is white and printers drop backgrounds (review M2): black ink on white, no glow, no rain, no app
   chrome. Every text colour token is ≥ 4.5:1 on white and frames ≥ 3:1 (tests/ui/theme-contrast.test.js);
   backgrounds are cleared, so a printout looks the same with or without "background graphics". */
@media print {
  :root {
    color-scheme: light;
    --c-bg: #FFFFFF; --c-surface: #FFFFFF; --c-surface-2: #FFFFFF;
    --c-border: #999999; --c-border-dim: #767676; --c-border-strong: #555555;
    --c-text: #000000; --c-muted: #333333; --c-heading: #000000;
    --c-primary: #000000; --c-primary-ink: #000000; --c-primary-soft: #FFFFFF;
    --c-accent: #000000; --c-accent-ink: #000000;
    --c-success: #00662A; --c-success-ink: #000000; --c-success-soft: #FFFFFF;
    --c-warning: #7A4B00; --c-warning-ink: #000000; --c-warning-soft: #FFFFFF; --c-warning-text: #5C3800; --c-warning-border: #7A4B00;
    --c-danger: #B00020; --c-danger-ink: #000000; --c-danger-soft: #FFFFFF; --c-danger-text: #B00020;
    --c-focus: #000000; --c-skeleton: #DDDDDD; --c-av-ink: #000000;
  }
  *, *::before, *::after { background: transparent !important; text-shadow: none !important; box-shadow: none !important; filter: none !important; }
  .matrix-rain, .app-header, .bottom-nav, .composer, .toast-region, .skip-link, .thread-header .th-back,
  .chat-layout.is-thread .chat-pane-list, .hero h1::after,
  .room-composer, .room-foot, .room-members, .rh-actions, .rh-back, .rl-menu, .room-line .relation, .room-log-top .btn,
  .footer-theme { display: none !important; }
  body.has-bottom-nav { padding-bottom: 0; }
  /* The chat rules further down size the layout to the window: printed, it runs over as many pages as it needs. */
  .chat-layout, body[data-view="chat-thread"] .chat-layout, .room-layout, body[data-view="room"] .room-layout, body[data-view="room-members"] .room-layout { display: block !important; height: auto !important; max-width: none; border: 0; }
  .chat-list, .chat-list-body, .message-list, .dialog-body, .room-log { overflow: visible !important; }
  .logo-mark .logo-bubble { fill: var(--c-bg); } /* a white bubble on the black tile */
}

/* ===== Track D2: append the chat-specific section below this line ===== */

/* ===== D2. Chat, account and settings views (track D2) =====
   Layout fitting, list/thread details, cards and forms in chat, security and recovery codes,
   settings. Tokens and the shared chat design system above are unchanged. */

/* Chat screens fill the space under the header (measured into --chat-top by fitChatLayout). */
body[data-view="chat-list"] .app-footer, body[data-view="chat-thread"] .app-footer, body[data-view="room"] .app-footer, body[data-view="room-members"] .app-footer { display: none; }
.chat-layout { height: calc(100dvh - var(--chat-top, var(--header-h)) - var(--bottom-nav-h) - env(safe-area-inset-bottom)); }
body[data-view="chat-thread"] .chat-layout, body[data-view="room"] .room-layout, body[data-view="room-members"] .room-layout { height: calc(100dvh - var(--chat-top, var(--header-h))); }
@media (min-width: 600px) { .chat-layout, body[data-view="chat-thread"] .chat-layout, .room-layout, body[data-view="room"] .room-layout, body[data-view="room-members"] .room-layout { height: calc(100dvh - var(--chat-top, var(--header-h))); } }
.chat-list-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.chat-list-loading, .chat-list-empty { padding: var(--s4); }
.chat-pane-head .btn { flex: none; }
.avatar-group { width: 48px; height: 48px; background: var(--c-primary-soft); color: var(--c-primary); }
.avatar-group.avatar-sm { width: 36px; height: 36px; }
.avatar-group .icon { width: 22px; height: 22px; }
.trust-mark { display: inline-flex; align-items: center; flex: none; color: var(--c-muted); }
.trust-mark.is-verified { color: var(--c-success); }
.trust-mark.is-changed { color: var(--c-danger); }
.cli-preview.is-warn { color: var(--c-danger); }
.cli-preview .icon { vertical-align: -2px; }

/* Thread */
.thread-header .th-sub .badge { min-height: 20px; font-size: 12px; }
.th-verify { font-size: 12px; font-weight: 700; }
.th-menu .menu-panel { right: 0; }
/* Phones (review UX-21): the thread gets the screen. The global header and the demo banner step aside
   (the thread header has its own back link and menu), the header is two rows (name; badge, Verifikasi
   and the lock on one line, wrapping to a third only when they do not fit) and the composer is tighter.
   fitChatLayout re-measures --chat-top. */
/* Security-code screen: long action labels ("Kode cocok — terima dan tandai terverifikasi") may wrap. */
.verify-view .btn { padding-block: var(--s2); }
@media (max-width: 599.98px) {
  body[data-view="chat-thread"] .app-header, body[data-view="chat-thread"] .demo-banner, body[data-view="room"] .app-header, body[data-view="room"] .demo-banner, body[data-view="room-members"] .app-header, body[data-view="room-members"] .demo-banner { display: none; }
  .thread-header { min-height: 0; padding-block: 6px; }
  /* Badge, "Verifikasi" and the lock share the row when they fit and wrap when they do not (Indonesian
     "Belum diverifikasi" + "Verifikasi" at 320–375 px): nothing is clipped, and no focusable link is
     ever hidden (review ui-chat N6). Measured in Chrome (ID): 375 px — verified and "Kode keamanan
     berubah" one row, unverified two ("Belum diverifikasi" / "Verifikasi 🔒"); 320 px — at most two
     rows. One item wider than the row (a long badge on a very narrow screen) is ellipsized, not cut. */
  .thread-header .th-sub { flex-wrap: wrap; column-gap: var(--s1); row-gap: 2px; min-width: 0; }
  .thread-header .th-sub > * { flex: none; max-width: 100%; white-space: nowrap; }
  .thread-header .th-sub > .badge { overflow: hidden; }
  .thread-header .th-sub > .badge > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .thread-header .th-sub > .badge > .icon { flex: none; }
  /* Monospace is wider: a tighter header gap and badge padding keep "Kode keamanan berubah" + the lock on
     one row at 375 px (measured in Chrome: 209 px row, 184 px badge + 4 px gap + 14 px lock). */
  .thread-header { gap: 6px; }
  .thread-header .th-sub > .badge { padding-inline: 6px; gap: 3px; letter-spacing: 0; }
  .thread-header .e2ee-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .thread .composer { gap: var(--s1); padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
/* 320–359 px: a trust badge wider than the row wraps its words inside the badge instead of losing them to
   an ellipsis ("Kode keamanan / berubah" keeps the word that matters). */
@media (max-width: 359.98px) {
  .thread-header .th-sub > .badge { white-space: normal; }
  .thread-header .th-sub > .badge > span { white-space: normal; text-overflow: clip; }
}
.menu-item.is-danger, .btn.is-danger { color: var(--c-danger); }
.thread-banners:empty { display: none; }
.chat-layout.is-thread .chat-pane-list .connection-banner-host { display: none; } /* the thread shows its own */
.thread-banners .notice { margin: var(--s2) var(--s3); }
.message-list { position: relative; }
.thread-top { align-self: stretch; display: flex; justify-content: center; min-height: 32px; }
.thread-error { padding-block: var(--s5); }
.connection-banner.is-alert { background: var(--c-danger-soft); color: var(--c-danger-text); border-bottom-color: var(--c-danger); }
.connection-banner.is-alert .icon { color: var(--c-danger); }
.msg.is-failed .bubble { border-color: var(--c-danger); }
.msg-status { display: inline-flex; align-items: center; gap: 2px; }
.msg-retry { display: inline-flex; align-items: center; gap: 4px; }
.msg-retry .icon { width: 14px; height: 14px; }
.system-line .btn { margin-inline-start: var(--s2); }
/* Phones (review L8): a system line with a button ("Tinjau") puts the text on the full width and the
   button below it, start-aligned, instead of a tall narrow centred column beside the button. */
@media (max-width: 599.98px) {
  .system-line.has-action { flex-wrap: wrap; justify-content: flex-start; text-align: start; max-width: 100%; }
  .system-line.has-action > span { flex: 1 1 calc(100% - 24px); min-width: 0; }
  .system-line.has-action > .btn { margin-inline-start: 24px; }
}
.system-reason { display: block; margin-top: 2px; color: var(--c-muted); }
.system-line a { white-space: nowrap; }
.held-notice .icon { color: var(--c-danger); width: 20px; height: 20px; }
.held-notice span { flex: 1 1 200px; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .fraud-tip { margin-top: var(--s1); }

/* Attachments */
.file-chip { width: 320px; }
.msg .file-chip { width: min(320px, 100%); }
.file-chip-actions { display: flex; gap: var(--s1); align-items: center; flex: none; }
.file-chip-status { font-size: 12px; color: var(--c-muted); }
.file-chip-status .field-error { font-size: 12px; }
.file-chip-risky { display: inline-flex; align-items: center; gap: 2px; color: var(--c-warning); font-weight: 700; }
@media (max-width: 380px) { .file-chip-btn-text { display: none; } }
.image-view { width: min(320px, 100%); }
.image-open { cursor: zoom-in; }
.image-tap progress { width: 120px; }
.image-error { color: var(--c-danger); }
.dialog-image .dialog-body { display: flex; justify-content: center; background: var(--c-bg); }
.image-full { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; }

/* Visually hidden inputs (.sr-only is absolutely positioned) must not stretch a scrolling dialog
   or the chat layout: contain them in their scroll container. */
.dialog-body, .composer, .attach-picker { position: relative; }

/* Composer */
.composer-form { display: flex; flex-direction: column; gap: var(--s2); }
.composer-attach { cursor: pointer; }
.composer-attach.is-disabled { opacity: .5; pointer-events: none; }
.composer-error { margin: 0; }
.composer-attachments:empty { display: none; }
.composer-attachments .file-chip { width: min(320px, 100%); }
.composer-blocked .btn { margin-inline-start: auto; }
.composer-blocked > .icon { color: var(--c-warning); }
.composer-blocked > span { flex: 1 1 12rem; min-width: 0; } /* beside the icon, not alone on a row below it */
/* Phones: the text keeps the row beside the icon and the button goes below it, start-aligned with the text. */
@media (max-width: 599.98px) {
  .composer-blocked > span { flex-basis: calc(100% - 32px); }
  .composer-blocked .btn { margin-inline-start: 32px; }
}
/* A changed security code (or a forked group) blocks sending: red, like every key-change surface (review N2). */
.composer-blocked.is-danger { background: var(--c-danger-soft); border-color: var(--c-danger); color: var(--c-danger-text); }
.composer-blocked.is-danger > .icon { color: var(--c-danger); }
.composer-tools:empty { display: none; }

/* RFQ / quote cards and forms */
.biz-card-body .fact-list dd { overflow-wrap: anywhere; }
.quote-table td .muted { font-size: 12px; }
.quote-table tfoot tr.is-sub th, .quote-table tfoot tr.is-sub td { font-weight: 400; color: var(--c-text); }
.dialog-form .dialog-body { background: var(--c-bg); }
.dialog-form form > * + * { margin-top: var(--s2); }
.form-status { flex: 1 1 100%; margin: 0; font-size: 14px; color: var(--c-muted); }
.form-status.is-saved { color: var(--c-success); display: flex; align-items: center; gap: var(--s1); font-weight: 600; }
.form-status.is-saved .icon { width: 16px; height: 16px; }
.form-status.is-error { color: var(--c-danger-text); }
@media (min-width: 600px) { .dialog-footer .form-status { flex: 1 1 auto; } }
.quote-item { margin-bottom: var(--s3); }
.quote-item > legend { float: left; width: 100%; font-weight: 700; margin-bottom: var(--s2); }
.quote-item > legend + * { clear: both; }
.quote-live-total { display: block; font-weight: 700; font-size: 18px; padding: var(--s2) 0; color: var(--c-heading); text-shadow: var(--glow-text-sm); }
.attach-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s1); }
.attach-list li { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.attach-list .icon { width: 18px; height: 18px; color: var(--c-muted); }
.attach-list .truncate { flex: 1; }

/* Security code and recovery code */
.security-code-box { margin: 0 0 var(--s4); }
.security-code-caption { display: flex; gap: var(--s2); align-items: center; font-weight: 700; margin-bottom: var(--s2); }
.security-code-caption .icon { color: var(--c-primary); }
.security-code { grid-template-columns: repeat(4, auto); gap: var(--s2) var(--s4); }
@media (max-width: 400px) { .security-code { gap: var(--s2) var(--s3); font-size: 18px; padding: var(--s3); } }
@media (max-width: 340px) { .security-code { grid-template-columns: repeat(3, auto); } }
.security-code-names { font-size: 14px; text-align: center; margin: 0; }
.old-code summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--c-primary); }
.recovery-code span { white-space: nowrap; }
.rc-tail { max-width: 14ch; text-transform: uppercase; letter-spacing: .08em; }

/* Account, info and settings pages */
.auth-card h1 { font-size: 24px; }
.register-card .progress-steps { margin-bottom: 0; }
.back-link { margin: 0 0 var(--s3) calc(-1 * var(--s3)); }
.conv-info, .verify-view, .group-new, .settings { max-width: 760px; }
.conv-info > * + *, .verify-view > * + *, .group-new > * + *, .settings > * + * { margin-top: var(--s4); }
.info-card .row { align-items: center; }
.info-card h1 { margin: 0; }
.member-actions { display: flex; flex-wrap: wrap; gap: 0 var(--s1); margin-top: var(--s1); }
.member-item .badge { flex: none; }
.grow { flex: 1; min-width: 0; }
.settings-section h2 { font-size: 17px; margin: 0; }
.settings-advanced summary { cursor: pointer; list-style: none; display: flex; align-items: center; min-height: 44px; }
.settings-advanced summary::-webkit-details-marker { display: none; }
.settings-advanced summary h2 { font-size: 17px; margin: 0; }
.settings-advanced summary::after { content: "▾" / ""; margin-inline-start: auto; color: var(--c-primary); }
.settings-advanced[open] summary::after { content: "▴" / ""; }
.report-evidence .check-label { overflow-wrap: anywhere; }

/* ===== v2 U1. Navigation notices, open rooms, members (DESIGN-v2-wilderness.md §6.2, §6.5–§6.7) =====
   A room is a calm black terminal log, visibly unlike the private chat's bubbles; everything that says
   "public" is amber (badge, composer notice frame, contact warning); the private-chat lock stays green and
   never appears here. */
.menu-dot { flex: none; width: 8px; height: 8px; margin-inline-start: auto; border-radius: 50%; background: var(--c-primary); box-shadow: 0 0 6px var(--c-glow); }
.menu-alert.is-info { background: var(--c-primary); box-shadow: 0 0 0 2px var(--c-surface), 0 0 6px var(--c-glow); }

/* Public badge (amber outline, globe): "Ruang terbuka · tidak terenkripsi"; the short form under 360 px. */
.public-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px; padding: 2px var(--s2); border: 1px solid var(--c-warning); border-radius: var(--r-pill); background: var(--c-warning-soft); color: var(--c-warning-text); font-size: 13px; font-weight: 700; line-height: 1.3; }
.public-badge .icon { width: 16px; height: 16px; color: var(--c-warning); }
.public-badge .pb-short { display: none; }
@media (max-width: 359.98px) { .public-badge .pb-full { display: none; } .public-badge .pb-short { display: inline; } }

/* Room layout: header over the log (and the member panel from 1024 px). The page itself does not scroll. */
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); max-width: var(--content-max); margin-inline: auto; min-height: 320px; background: var(--c-bg); }
body[data-view="room"] .room-layout.is-preview { height: auto; min-height: 0; }
.room-layout.is-gone { height: auto; display: block; padding: var(--s4) var(--gutter); }
.room-header-host { grid-column: 1 / -1; min-width: 0; }
.room-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.room-log-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.room-log-skeleton { padding: var(--s4) var(--gutter); display: grid; gap: var(--s4); }
.room-preview { margin: var(--s4) auto; width: calc(100% - 2 * var(--gutter)); max-width: 560px; text-align: center; display: grid; justify-items: center; gap: var(--s2); }
.room-preview h2 { font-size: 17px; margin: 0; }
.room-preview p { margin: 0; color: var(--c-muted); }
.room-preview .state-icon { color: var(--c-primary); }
.room-welcome:empty, .room-banner:empty { display: none; }
.room-welcome .welcome-panel { margin: var(--s3) var(--gutter) 0; }
.room-banner .notice { margin: var(--s2) var(--gutter) 0; }
.room-members { display: none; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s3) var(--gutter) var(--s5); background: var(--c-surface); }
.room-layout.is-members .room-members { display: flex; }
@media (max-width: 1023.98px) {
  .room-layout.is-members .room-main { display: none; }
  .room-layout.is-members .room-header-host .rh-actions, .room-layout.is-members .room-header-host .rh-desc, .room-layout.is-members .room-header-host .rh-stats { display: none; }
}
@media (min-width: 1024px) {
  .room-layout { grid-template-columns: minmax(0, 760px) 320px; justify-content: center; max-width: 1080px; border-inline: 1px solid var(--c-border-strong); }
  .room-layout.is-preview { grid-template-columns: minmax(0, 1fr); max-width: 880px; border-inline: 0; }
  .room-members { display: flex; border-left: 1px solid var(--c-border-strong); }
  .room-header .rh-members { display: none; }
}

/* Room header: back + name; badge; description, stats and actions. Phones: three rows (r2 F26). */
.room-header { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: var(--s3) var(--gutter); background: var(--c-surface); border-bottom: 1px solid var(--c-border-strong); }
.rh-title { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.rh-back { flex: none; margin-inline-start: calc(-1 * var(--s2)); }
.rh-names { min-width: 0; }
.rh-parent { margin: 0; font-size: 13px; }
.rh-parent a { color: var(--c-muted); }
.rh-names h1, .rh-name { margin: 0; font-size: 20px; font-weight: 700; color: var(--c-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-badge { min-width: 0; }
.rh-desc { margin: 0; color: var(--c-muted); font-size: 14px; }
.rh-stats { margin: 0; color: var(--c-muted); font-size: 13px; }
.rh-stats:empty { display: none; }
.rh-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.rh-actions[hidden] { display: none; }
@media (min-width: 600px) {
  .room-header { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s4); }
  .room-header > :not(.rh-actions) { grid-column: 1; }
  .rh-actions { grid-column: 2; grid-row: 1 / span 2; align-self: start; justify-content: flex-end; }
}
@media (max-width: 599.98px) {
  .room-header { padding-block: 6px; gap: 6px; }
  .rh-parent, .rh-desc, .rh-stats { display: none; }
  /* The logged-out preview is not a chat: what a visitor may see (W-PO1) stays — description and the stats line. */
  .room-layout.is-preview .rh-desc, .room-layout.is-preview .rh-stats:not(:empty) { display: block; }
  .rh-names h1, .rh-name { font-size: 17px; }
  .rh-actions { justify-content: space-between; }
  .rh-actions .rh-members { flex: 1 1 auto; justify-content: flex-start; }
  .public-badge { white-space: normal; }
}

/* The log: a terminal, not bubbles. "> name" in heading green, the meta line muted, the text plain. */
.room-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding-block: var(--s2) var(--s3); background: var(--c-bg); }
.room-log-top { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s2) var(--gutter); text-align: center; min-height: 32px; }
.room-start { margin: 0; font-weight: 700; color: var(--c-heading); font-size: 13px; }
.room-retention { margin: 0; color: var(--c-muted); font-size: 12px; }
.room-day { align-self: center; }
.room-empty { padding: var(--s4) var(--gutter); text-align: center; color: var(--c-muted); display: grid; justify-items: center; gap: var(--s2); }
.room-empty p { margin: 0; }
.room-line { padding: var(--s2) var(--gutter) var(--s1); border-inline-start: 2px solid transparent; }
.room-line:hover, .room-line:focus-within { background: var(--c-surface); }
.room-line.is-own { border-inline-start-color: var(--c-primary); }
.room-line.is-grouped { padding-top: 0; }
.rl-head { min-width: 0; }
.rl-l1 { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s1) var(--s2); min-width: 0; }
.rl-author { margin: 0; font-size: 15px; min-width: 0; max-width: 100%; }
.rl-name { display: inline-flex; align-items: center; max-width: 100%; min-height: 32px; padding: 0; border: 0; background: none; color: var(--c-heading); font: inherit; font-weight: 700; text-align: start; cursor: pointer; }
.rl-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
button.rl-name:hover .rl-name-text { text-decoration: underline; }
.rl-prompt { color: var(--c-primary); flex: none; margin-inline-end: 1ch; }
.rl-you { font-size: 12px; font-weight: 700; color: var(--c-primary); border: 1px solid var(--c-border-strong); border-radius: var(--r-pill); padding: 0 6px; }
.rl-l2 { margin: 0; font-size: 12px; color: var(--c-muted); }
.rl-body { display: flex; align-items: flex-start; gap: var(--s2); }
.rl-text { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--c-text); }
.rl-menu { flex: none; width: 36px; min-height: 32px; margin-top: -4px; color: var(--c-muted); }
.rl-menu:hover { color: var(--c-primary); }
@media (pointer: coarse) { .rl-menu { width: 44px; min-height: 44px; margin-top: -10px; } .rl-name { min-height: 44px; } }
.room-line .fraud-tip { margin-top: var(--s1); }
.renamed-marker { font-size: 12px; color: var(--c-warning-text); }

/* Relation control (Ajak Bermitra · Menunggu jawaban · Tanggapi · Mitra + Chat pribadi · …) */
.relation { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1); min-width: 0; }
.relation:empty { display: none; }
.rel-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; max-width: 100%; padding: 2px var(--s2); border: 1px solid var(--c-border-strong); border-radius: var(--r-pill); color: var(--c-text); font-size: 12px; font-weight: 700; }
.rel-chip .icon { width: 14px; height: 14px; }
.rel-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-chip.is-partner { border-color: var(--c-success); color: var(--c-success); }
.rel-chip.is-pending { border-style: dashed; }
.rel-chip.is-muted { border-color: var(--c-border-dim); color: var(--c-muted); }
.relation-large { gap: var(--s2); }
.relation-large .rel-chip { min-height: 36px; font-size: 14px; }
/* Phones: line 1 is the name (ellipsized) and the Connect icon button (44 × 44, named "Ajak {name} bermitra");
   no extra line per author group (r2 F26). */
@media (max-width: 599.98px) {
  .room-line .rl-l1 { flex-wrap: nowrap; }
  .room-line .rl-author { flex: 0 1 auto; overflow: hidden; }
  .room-line .rl-you, .room-line .renamed-marker { flex: none; }
  .room-line .renamed-marker { display: none; }
  .room-line .relation { flex: 0 0 auto; flex-wrap: nowrap; margin-inline-start: auto; }
  .room-line .relation .btn { width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .room-line .relation .rb-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .room-line .rel-chip { max-width: 46vw; } /* "Menunggu jawaban" whole at 375 px; the name ellipsizes first */
}

/* Composer: amber-framed notice always visible (short + info toggle on phones), counter, contact warning. */
.room-foot { flex: none; }
.room-composer { display: grid; gap: var(--s2); padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom)); background: var(--c-surface); border-top: 1px solid var(--c-warning-border); }
.rc-new { display: flex; gap: var(--s2); align-items: flex-start; margin: 0; font-size: 13px; color: var(--c-warning-text); }
.rc-new .icon { width: 18px; height: 18px; color: var(--c-warning); }
.rc-notice { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; padding: var(--s1) var(--s3); border: 1px solid var(--c-warning-border); border-radius: var(--r2); background: var(--c-warning-soft); color: var(--c-warning-text); font-size: 13px; }
.rc-notice > .icon { width: 18px; height: 18px; color: var(--c-warning); }
.rc-notice-full { flex: 1 1 0; min-width: 12rem; }
.rc-notice-short, .rc-info { display: none; }
.rc-info { width: 36px; min-height: 36px; color: var(--c-warning); }
.rc-slow { margin: 0; font-size: 13px; color: var(--c-muted); }
.rc-label { font-size: 13px; font-weight: 700; color: var(--c-text); }
.rc-form { display: grid; gap: var(--s1); }
.rc-row { display: flex; gap: var(--s2); align-items: flex-end; }
.rc-input { flex: 1; min-width: 0; min-height: 44px; max-height: 40vh; resize: none; overflow-y: auto; border-color: var(--c-warning-border); }
.rc-send { flex: none; }
.rc-under { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: flex-start; }
.rc-warn { display: flex; gap: var(--s1); align-items: flex-start; flex: 1 1 14rem; margin: 0; font-size: 13px; color: var(--c-warning-text); }
.rc-warn .icon { width: 16px; height: 16px; color: var(--c-warning); margin-top: 2px; }
.rc-count { margin: 0 0 0 auto; font-size: 13px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 599.98px) {
  .rc-notice-full { display: none; }
  .rc-notice-short { display: inline; flex: 1 1 0; min-width: 0; }
  .rc-info { display: inline-flex; width: 44px; min-height: 44px; margin-block: -6px; }
  .rc-notice.is-open .rc-notice-full { display: block; flex-basis: 100%; }
  .rc-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .room-composer { gap: 6px; padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .rc-send .rc-send-text { font-size: 14px; }
}
/* 320–359 px phones (Clean review L2, both themes): a word-sized "Kirim" left the one-line field too narrow for its
   placeholder, which wrapped and was cut. The button is a 44 px icon there; the word stays its accessible name and the
   slow-mode countdown ("Tunggu 9 detik") still shows in words. The placeholder is 15 px there, so the wide monospace
   "Write an open message…" (212 px at 16 px) fits the 210 px field too; typed text keeps its size. */
@media (max-width: 359.98px) {
  .rc-send:not(.is-waiting) { width: 44px; min-width: 44px; padding: 0; }
  .rc-send:not(.is-waiting) .rc-send-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .rc-input::placeholder { font-size: 15px; }
}
/* What replaces the composer: join bar, consent bar, ban, lock. */
.room-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--c-surface); border-top: 1px solid var(--c-border-strong); }
.room-bar > .icon { width: 20px; height: 20px; color: var(--c-primary); }
.room-bar p { flex: 1 1 14rem; margin: 0; }
.room-bar.is-warning { background: var(--c-warning-soft); color: var(--c-warning-text); border-top-color: var(--c-warning); }
.room-bar.is-warning > .icon { color: var(--c-warning); }

/* Members: the roster in the server's order (active first); name → member card. */
.rm-head h1, .rm-head h2 { font-size: 17px; margin: 0 0 var(--s1); }
.rm-intro { margin: 0 0 var(--s2); font-size: 13px; color: var(--c-muted); }
.rm-back { margin-inline-start: calc(-1 * var(--s3)); margin-bottom: var(--s1); }
@media (min-width: 1024px) { .rm-back { display: none; } }
.member-rows { list-style: none; margin: 0; padding: 0; }
.member-row { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: flex-start; justify-content: space-between; padding: var(--s2) 0; border-bottom: 1px solid var(--c-border); }
.mr-main { flex: 1 1 10rem; min-width: 0; }
.mr-since { margin: 0; font-size: 12px; color: var(--c-muted); }
.mr-rel { flex: none; max-width: 100%; }
.member-more { padding-top: var(--s3); display: grid; justify-items: center; gap: var(--s2); }
.member-more:empty { display: none; }
.member-empty { margin: 0; }
.member-chip { min-width: 0; display: grid; gap: 2px; }
.mc-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); min-width: 0; }
.mc-name { max-width: 100%; min-height: 32px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--c-heading); text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.mc-name { cursor: pointer; }
button.mc-name:hover { text-decoration: underline; }
@media (pointer: coarse) { button.mc-name { min-height: 44px; } }
.mc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s2); font-size: 12px; }
.role-chip { border: 1px solid var(--c-border-dim); border-radius: var(--r-pill); padding: 0 6px; color: var(--c-text); }
.mc-place { color: var(--c-muted); }
.activity.is-now { color: var(--c-primary); font-weight: 700; }
.activity.is-week { color: var(--c-muted); }

/* Member card dialog */
.dialog-member .member-card { display: grid; gap: var(--s4); }
.mcd-head { display: flex; gap: var(--s3); align-items: center; min-width: 0; }
.mcd-who { min-width: 0; display: grid; gap: var(--s1); }
.mcd-name { margin: 0; font-weight: 700; font-size: 17px; color: var(--c-heading); overflow-wrap: anywhere; }
.mcd-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s1); font-size: 14px; }
.mcd-list li { display: flex; gap: var(--s2); align-items: center; }
.mcd-list .icon { width: 18px; height: 18px; color: var(--c-primary); }
.mcd-relation:empty, .mcd-link:empty { display: none; }
/* The ⋯ menu of a message: a short list; a bottom sheet on phones. */
.dialog-menu { width: min(360px, calc(100vw - 2 * var(--s4))); }
.action-menu { list-style: none; margin: 0; padding: 0; }
.action-menu .menu-item { min-height: 48px; }
@media (max-width: 599.98px) {
  .dialog-menu { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r2) var(--r2) 0 0; padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== v2 U2. Profiles, reviews, partners, the partnership in private chats (DESIGN-v2-wilderness.md §6.5–§6.8) =====
   Stars and averages in heading green, review text in text green, the honesty note muted; partner chips as in U1
   (green outline = partner, dashed = pending, muted = cooldown/blocked); notes of requests are plain quotes. */
.profile-actions .relation-large .btn { flex: 0 1 auto; }
.profile-cta .relation { justify-content: flex-start; }
.contact-partners-only { display: flex; gap: var(--s2); align-items: flex-start; }
.contact-partners-only .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--c-success); }
.profile-legacy { align-items: center; flex-wrap: wrap; }
.profile-legacy p { flex: 1 1 16rem; margin: 0; }
.profile-consent { border: 1px solid var(--c-border-dim); border-radius: var(--r2); padding: var(--s2) var(--s3); }
.activity.is-hidden { color: var(--c-muted); font-size: 13px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.room-chip { text-decoration: none; padding-inline-end: var(--s3); max-width: 100%; }
.room-chip:hover { border-color: var(--c-primary); color: var(--c-heading); }

/* Tabs (partners, reviews): role="tablist", the selected tab underlined in phosphor green. */
.tab-list { display: flex; gap: var(--s1); border-bottom: 1px solid var(--c-border-strong); margin-bottom: var(--s3); overflow-x: auto; scrollbar-width: none; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: 44px; padding: 0 var(--s3); border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; color: var(--c-muted); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--c-text); }
.tab.is-selected { color: var(--c-heading); border-bottom-color: var(--c-primary); }
.tab-panel:focus-visible { outline-offset: 4px; }
.tab-short { display: none; }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-danger); color: var(--c-danger-ink); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
/* Phones: three buttons filling the row with the short labels and the counts as badges, so no label wraps or
   overlaps at 320 px (§6.7; "Permintaan" + badge needs more than a third of 288 px in 13 px monospace, so the
   widths follow the labels instead of being equal — measured in Chrome at 320 and 375 px). */
@media (max-width: 599.98px) {
  .partner-tabs .tab-list { gap: 0; }
  .partner-tabs .tab { flex: 1 1 auto; min-width: 0; padding: 0 6px; font-size: 13px; }
  .partner-tabs .tab-badge { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
  .partner-tabs .tab-full { display: none; }
  .partner-tabs .tab-short { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
}

/* Reviews */
.review-head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: baseline; }
.review-summary { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; margin: 0; font-weight: 700; color: var(--c-heading); }
.review-summary.is-none { font-weight: 400; color: var(--c-muted); }
.stars { color: var(--c-heading); letter-spacing: 2px; font-size: 16px; white-space: nowrap; }
.review-since { display: inline-flex; gap: var(--s1); align-items: center; margin: 0; font-size: 13px; color: var(--c-muted); }
.review-since .icon { width: 16px; height: 16px; color: var(--c-primary); }
.review-dist { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.review-dist li { display: flex; gap: var(--s2); align-items: center; }
.review-dist .stars { font-size: 12px; letter-spacing: 1px; }
.rd-count { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.review-honesty { display: flex; gap: var(--s2); align-items: flex-start; margin: var(--s3) 0; font-size: 13px; color: var(--c-muted); }
.review-honesty .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--c-muted); }
.review-login { margin: 0; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; }
.review-item { padding: var(--s3) 0; border-top: 1px solid var(--c-border); }
.ri-head { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; font-size: 13px; color: var(--c-muted); }
.ri-by a { color: var(--c-text); font-weight: 700; }
.ri-text { margin: var(--s1) 0 0; color: var(--c-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ri-report { font-size: 13px; color: var(--c-muted); min-height: 36px; display: inline-flex; gap: var(--s1); align-items: center; }
.ri-report .icon { width: 16px; height: 16px; }
.review-more { margin-top: var(--s2); }
.review-short { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; color: var(--c-text); }
.review-short li { display: flex; gap: var(--s2); align-items: baseline; }
.review-short li.is-none { color: var(--c-muted); }
.review-short .stars { font-size: 13px; letter-spacing: 1px; }
.mcd-reviews { padding-top: var(--s2); border-top: 1px solid var(--c-border); }
.yr-list { display: grid; gap: var(--s3); margin: 0; }
.yr-list .yr-row { display: grid; gap: var(--s1); align-items: start; }
.yr-row .btn-row .btn { flex: 0 1 auto; }
.yr-role { margin: 0; font-weight: 700; color: var(--c-text); }
.yr-why { margin: 0; }
.stars-input { margin-top: var(--s2); }
.stars-input .star-options { display: grid; gap: 0; }
.star-option { align-items: center; }
.star-glyphs { color: var(--c-heading); letter-spacing: 2px; min-width: 8ch; }
.star-label { color: var(--c-text); }
@media (min-width: 600px) { .stars-input .star-options { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); column-gap: var(--s4); } }

/* Partners page */
.partners-page { padding-block: var(--s4) var(--s6); }
.partners-consent:empty, .partners-v1note:empty { display: none; }
.partners-consent .room-bar { border: 1px solid var(--c-border-dim); border-radius: var(--r2); margin-bottom: var(--s4); padding-bottom: var(--s3); }
.v1-note { flex-wrap: wrap; align-items: center; }
.v1-note p { flex: 1 1 18rem; margin: 0; }
.partner-list, .request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.partner-row, .request-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2) var(--s3); align-items: start; padding: var(--s3); border: 1px solid var(--c-border-dim); border-radius: var(--r2); background: var(--c-surface); }
.pr-main, .rq-main { min-width: 0; display: grid; gap: var(--s1); }
.pr-name, .rq-name { margin: 0; font-weight: 700; color: var(--c-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-name a, .rq-name a { color: var(--c-heading); }
.pr-since { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; margin: 0; font-size: 13px; color: var(--c-muted); }
.pr-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.pr-actions .pr-menu { margin-inline-start: auto; }
@media (min-width: 720px) {
  .partner-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .pr-actions { grid-column: 3; }
}
@media (max-width: 359.98px) { .pr-actions .rb-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } .pr-actions .btn { min-width: 44px; padding: 0 var(--s2); } }
.rq-head { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; min-width: 0; }
.rq-menu { flex: none; color: var(--c-muted); }
.rq-since { color: var(--c-muted); }
.mc-sep { color: var(--c-muted); }
/* Recently ended partnerships on /partners (UX L16) */
.partners-ended { margin-top: var(--s6); }
.partners-ended h2 { font-size: 18px; margin-bottom: var(--s1); }
.ended-list > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--c-border); }
.ended-list .er-name { margin: 0; font-weight: 600; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.ended-list .er-line { margin: 0; flex: 0 0 auto; }
.your-reviews .yr-window { margin-top: 0; }
.rel-chip.is-new-account { border-color: var(--c-warning); color: var(--c-warning-text); background: var(--c-warning-soft); }
.rel-chip.is-new-account .icon { color: var(--c-warning); }
.rq-context, .rq-expires { margin: 0; font-size: 13px; color: var(--c-muted); }
.rq-status { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: center; margin: 0; font-size: 13px; color: var(--c-muted); }
.rq-note { margin: var(--s1) 0; padding: var(--s2) var(--s3); border-inline-start: 2px solid var(--c-border-strong); background: var(--c-bg); color: var(--c-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-actions { display: grid; gap: var(--s1); margin-top: var(--s1); }
.rq-actions .field-hint { margin: 0; }
.ignore-new { margin-bottom: var(--s3); }
.load-more { justify-self: center; margin-top: var(--s3); }
/* Phones: the three request buttons stack full width below the note (§6.7). */
@media (max-width: 599.98px) {
  .request-item { grid-template-columns: minmax(0, 1fr); }
  .request-item > .avatar { display: none; }
  .rq-buttons { display: grid; grid-template-columns: minmax(0, 1fr); }
  .rq-buttons .btn { width: 100%; }
}

/* Toast actions ([Chat sekarang], [Lihat], [Urungkan]) */
.toast .toast-action { margin-inline-start: auto; min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--c-border-strong); background: var(--c-bg); color: var(--c-heading); white-space: nowrap; }
.toast .toast-action:hover { border-color: var(--c-primary); }
.toast .toast-action + .toast-close { margin-inline-start: 0; }
.toast > span { flex: 1 1 auto; min-width: 0; }

/* Private chat with someone who is no longer a partner: the banner replaces the composer (§6.8). */
.thread-partner:empty { display: none; }
.thread-partner .not-partner { margin: var(--s2) var(--s3); }
.np-body { display: grid; gap: var(--s2); min-width: 0; }
.np-body p { margin: 0; }

/* ===== v2 U3. Proposals, the consent dialog and bar, settings / registration / profile editor additions
   (DESIGN-v2-wilderness.md §1.3, §1.6, §6.2, §6.3) ===== */
.propose, .my-proposals { padding-block: var(--s4) var(--s6); }
.propose > .lead { margin-bottom: var(--s4); }
.consent-bar { border: 1px solid var(--c-border-dim); border-radius: var(--r2); margin-bottom: var(--s4); padding-bottom: var(--s3); }
.similar-box:empty, .form-alert:empty, .consent-status:empty { display: none; }
.similar-box { display: grid; gap: var(--s1); margin: 0; }
.similar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.similar-list a { color: var(--c-heading); }
.form-alert .notice { margin: 0; }
.proposal-done h2 { margin: 0; font-size: 19px; }
.proposal-warnings { margin: 0; padding-inline-start: var(--s4); display: grid; gap: var(--s1); }
.proposal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.proposal-item { display: grid; gap: var(--s2); padding: var(--s3); border: 1px solid var(--c-border-dim); border-radius: var(--r2); background: var(--c-surface); }
.proposal-head { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; justify-content: space-between; }
.proposal-name { margin: 0; font-size: 17px; color: var(--c-heading); overflow-wrap: anywhere; }
.proposal-status { min-height: 28px; font-size: 13px; }
.proposal-item.is-pending .proposal-status { border-style: dashed; }
.proposal-item.is-approved .proposal-status, .proposal-item.is-merged .proposal-status { border-color: var(--c-primary); color: var(--c-heading); }
.proposal-item.is-rejected .proposal-status, .proposal-item.is-withdrawn .proposal-status { background: transparent; border-color: var(--c-border-dim); color: var(--c-muted); }
.proposal-note { padding: var(--s2) var(--s3); border-inline-start: 2px solid var(--c-border-strong); background: var(--c-bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.consent-dialog .consent-docs { margin: 0; }
.consent-dialog .consent-docs a { margin-inline: var(--s1); }
.form-section > .me-role { margin-top: var(--s3); }
.me-listed-note { margin-top: var(--s2); }

/* ===== 21. Theme switch (DESIGN §6.6.3): footer control and the Settings choices =====
   Two toggle buttons (aria-pressed). The chosen one is filled and shows a check mark, never colour alone. */
.footer-theme { grid-column: 1 / -1; padding-top: var(--s3); border-top: 1px solid var(--c-border); }
.theme-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.theme-switch-label { color: var(--c-muted); }
.theme-switch-options { display: inline-flex; flex-wrap: wrap; gap: var(--s1); }
.theme-option { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r-pill); background: var(--c-bg); color: var(--c-text); font-size: 14px; font-weight: 700; }
.theme-option .icon { width: 16px; height: 16px; display: none; }
.theme-option:hover { border-color: var(--c-primary); color: var(--c-primary); }
.theme-option[aria-pressed="true"] { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-heading); }
.theme-option[aria-pressed="true"] .icon { display: inline-block; }
.theme-choices { display: grid; gap: var(--s2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .theme-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme-choice { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3); border: 1px solid var(--c-border-strong); border-radius: var(--r2); background: var(--c-surface); color: var(--c-text); font: inherit; text-align: start; cursor: pointer; }
.theme-choice:hover { border-color: var(--c-primary); }
.theme-choice[aria-pressed="true"] { border: 2px solid var(--c-primary); padding: calc(var(--s3) - 1px); background: var(--c-primary-soft); }
.theme-choice-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.theme-choice-name { font-weight: 700; color: var(--c-heading); }
.theme-choice-desc { font-size: 13px; color: var(--c-muted); }
.theme-choice-check { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c-border-strong); }
.theme-choice-check .icon { width: 16px; height: 16px; visibility: hidden; }
.theme-choice[aria-pressed="true"] .theme-choice-check { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-ink); }
.theme-choice[aria-pressed="true"] .theme-choice-check .icon { visibility: visible; }
/* Previews: a mini Matrix screen (black, two green lines) and a mini Clean page (grey, a white card, a blue pill). */
.theme-swatch { position: relative; flex: none; width: 56px; height: 40px; overflow: hidden; border: 1px solid var(--c-border-dim); border-radius: var(--r1); }
.theme-swatch > span { position: absolute; display: block; }
.theme-swatch.is-matrix { background: var(--sw-matrix-bg); }
.theme-swatch.is-matrix > span:first-child { left: 8px; top: 11px; width: 32px; height: 4px; background: var(--sw-matrix-fg); }
.theme-swatch.is-matrix > span:last-child { left: 8px; top: 22px; width: 20px; height: 4px; background: var(--sw-matrix-dim); }
.theme-swatch.is-clean { background: var(--sw-clean-bg); }
.theme-swatch.is-clean > span:first-child { left: 7px; right: 7px; top: 7px; height: 14px; border-radius: 4px; background: var(--sw-clean-card); }
.theme-swatch.is-clean > span:last-child { left: 7px; bottom: 7px; width: 22px; height: 8px; border-radius: 4px; background: var(--sw-clean-blue); }
@media (forced-colors: active) {
  .theme-option[aria-pressed="true"], .theme-choice[aria-pressed="true"] { border: 2px solid Highlight; }
}
