/* Wasel design system: tokens + base + components.
   Approved 2026-12-05 (medium slate-blue dark + amber). Source of truth for every page.
   Use logical properties only (inline-start/end), so RTL and LTR both work from <html dir>. */

@import url('https://fonts.googleapis.com/css2?family=Readex+Pro:wght@300;400;500;600;700&display=swap');

:root {
  /* Surfaces */
  --bg: #2B3342;            /* page background */
  --surface: #353E4F;       /* cards, fields, other-party bubble, sheets, nav */
  --raised: #424C5F;        /* secondary buttons, icon tiles, progress track */
  --border: #4A5468;        /* 1px borders, dividers */
  --border-dashed: #6B758A; /* "add" buttons, unclear results */

  /* Text */
  --text: #F1F3F7;
  --muted: #BAC2CF;         /* labels, secondary text, original-language line */
  --text-soft: #D5DAE3;     /* long body text inside cards */

  /* Accent (amber) */
  --accent: #F2B45A;
  --accent-hover: #F7CB87;
  --on-accent: #1A1205;     /* text/icons on amber */

  /* Own bubble (me / agent on my behalf) */
  --mine: #4C3F25;
  --mine-text: #F7E7C8;
  --mine-muted: #CDB993;

  /* Home mode cards (the design agent's proposal, chosen by the owner 2026-12-05; the only place
     with gradients and glow). Face to face = light amber card; phone call = deep blue card.
     Contrast checked: dark text on the amber card >= 11:1, white on the button >= 5:1. */
  --talk-card-a: #FFE3B3; --talk-card-b: #FFC46B; --talk-card-edge: #FFD48A;
  --talk-glow: rgba(242, 180, 90, .35);
  --talk-tile-a: #F59E0B; --talk-tile-b: #D9730A;
  --talk-btn-a: #B45309; --talk-btn-b: #92400E;
  --talk-sub: #4A3A1E;
  --call-card-a: #2E3E5E; --call-card-b: #24314C; --call-card-edge: #3F5680;
  --call-tile-a: #2F5FA8; --call-tile-b: #1E4A8C;
  --call-line: #8EC5F5; --call-sub: #C9D3E3;
  --on-mode: #FFFFFF;

  /* Live split screen: the other person's half is LIGHT with dark text (clearly not the owner's
     dark half); their own words on white, ours on a pale amber. */
  --their-bg: #F1F3F7; --their-text: #1B2230;
  --their-own: #FFFFFF; --their-own-edge: #D5DAE3;
  --their-ours: #FBE8C8; --their-ours-text: #3A2A10;

  /* States */
  --ok-bg: #24423A;   --ok: #86EFAC;      /* achieved objective, success */
  --danger-bg: #4E2D33; --danger: #FCA5A5; /* end session, delete */
  --live: #4ADE80;                          /* live dot */

  /* Shape and spacing */
  --r-sm: 12px; --r-md: 14px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 24px; --r-pill: 999px;
  --gutter: 16px;
  --tap: 44px;              /* minimum touch target */
  --btn-h: 56px;            /* primary action height */

  --font: 'Readex Pro', 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { font-size: 14px; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); } a:hover { color: var(--accent-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Layout */
.screen { min-height: 100dvh; display: flex; flex-direction: column; padding: 20px var(--gutter) 24px; gap: 16px; }
.screen__body { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.h1 { margin: 0; font-size: 21px; font-weight: 600; }
.h2 { margin: 0; font-size: 16px; font-weight: 500; }
.label { font-size: 13px; color: var(--muted); }
.hint { font-size: 12px; line-height: 1.7; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { min-height: var(--tap); border: 0; border-radius: var(--r-lg); padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn--primary { height: var(--btn-h); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; }
.btn--secondary { height: 52px; background: var(--raised); color: var(--text); }
.btn--outline { height: 52px; background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--danger { height: var(--tap); border-radius: var(--r-pill); background: var(--danger-bg); color: var(--danger); }
.btn--block { width: 100%; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.btn--add { height: 46px; border-radius: var(--r-md); border: 1px dashed var(--border-dashed); background: transparent; color: var(--text); }

/* Segmented switch (ترجمة | وكالة). Selected = amber. */
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.segmented--pill { border-radius: var(--r-pill); }
.segmented button { height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-weight: 600; }
.segmented--pill button { height: 40px; border-radius: var(--r-pill); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Cards and fields */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.input, .textarea, .select-btn { min-height: 54px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.textarea { padding: 12px 14px; line-height: 1.7; resize: none; }
.input:focus, .textarea:focus { border: 2px solid var(--accent); outline: none; }
.select-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; text-align: start; }
.notice { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); font-size: 13px; line-height: 1.8; color: var(--muted); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.chip--ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.badge-num { width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--raised); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }

/* Chat bubbles: translation BIG, original small underneath in its own dir/lang */
.chat { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.bubble { max-width: 84%; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble__main { font-size: 15px; line-height: 1.6; text-align: start; }
.bubble__orig { font-size: 12.5px; color: var(--muted); text-align: start; }
.bubble--other { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 20px 6px 20px 20px; }
.bubble--mine  { align-self: flex-end; background: var(--mine); border-radius: 6px 20px 20px 20px; }
.bubble--mine .bubble__main { color: var(--mine-text); }
.bubble--mine .bubble__orig { color: var(--mine-muted); }
.bubble--latest { border-color: var(--accent); }
.bubble-label { font-size: 12px; color: var(--muted); }
[dir="ltr"] .bubble--other { border-radius: 6px 20px 20px 20px; }
[dir="ltr"] .bubble--mine  { border-radius: 20px 6px 20px 20px; }

/* Bottom sheet (decision + input bar) */
.sheet { background: var(--surface); border-top: 1px solid var(--border); border-radius: var(--r-2xl) var(--r-2xl) 0 0; padding: 14px var(--gutter) 22px; display: flex; flex-direction: column; gap: 14px; }
.sheet__grip { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--border); align-self: center; }
.countdown { min-width: 40px; height: 40px; border-radius: var(--r-pill); border: 2px solid var(--accent); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.decision-actions { display: flex; gap: 8px; }
.decision-actions .yes { flex: 2; } .decision-actions .no, .decision-actions .later { flex: 1; }
.mic { width: 52px; height: 52px; border-radius: var(--r-pill); border: 0; background: var(--bg); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); display: inline-flex; align-items: center; justify-content: center; }

/* Live dot */
.live-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--live); display: inline-block; }

/* Bottom navigation: 5 items, home in the middle as a raised round button */
.tabbar { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); align-items: end; padding: 10px 8px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; text-decoration: none; color: var(--muted); font-size: 12px; min-height: var(--tap); }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 500; }
.tabbar__home { position: relative; }
.tabbar__bump { width: 58px; height: 58px; margin-top: -30px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px var(--surface), 0 -1px 0 6px var(--border); }
/* Not selected: still set apart from the other tabs (amber ring and icon on the dark ground). */
.tabbar__home:not([aria-current="page"]) { color: var(--text); }
.tabbar__home:not([aria-current="page"]) .tabbar__bump { background: var(--bg); color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 6px var(--surface), 0 -1px 0 6px var(--border); }

/* Switch (role="switch") */
.switch { width: 52px; height: 32px; border-radius: var(--r-pill); border: 0; padding: 3px; background: var(--raised); display: flex; justify-content: flex-end; }
.switch::after { content: ""; width: 26px; height: 26px; border-radius: var(--r-pill); background: #fff; }
.switch[aria-checked="true"] { background: var(--accent); justify-content: flex-start; }
[dir="ltr"] .switch { justify-content: flex-start; } [dir="ltr"] .switch[aria-checked="true"] { justify-content: flex-end; }
