/* Shared appearance with the Android palette. Theme IDs remain stable. */
:root,
:root[data-theme=dark] {
  --bg:#111719; --rail-bg:#0d1315; --surface:#1a2326;
  --surface-soft:#273438; --chat-bg:#131d20; --bubble:#202d31;
  --bubble-out:#24463b; --ink:#f0f5f3; --muted:#aabbb9;
  --accent:#a5e6bd; --on-action:#102c20; --accent-wash:#233d35;
  --line:#35464b; --control-line:#647b7d;
  --violet:#cfc0ff; --violet-wash:#352e49;
  --amber:#f3ce91; --amber-wash:#3d3224;
  --blue:#a6d4ff; --blue-wash:#253a50;
}
:root[data-theme=light] {
  --bg:#eef1ee; --rail-bg:#e4ebe5; --surface:#fffefa;
  --surface-soft:#e9efea; --chat-bg:#f1f4ee; --bubble:#fffefa;
  --bubble-out:#d8eee0; --ink:#1e3029; --muted:#52675d;
  --accent:#286547; --on-action:#fff; --accent-wash:#ddeee2;
  --line:#d1ddd3; --control-line:#7a9685;
  --violet:#634493; --violet-wash:#eee7f9;
  --amber:#80521c; --amber-wash:#faedd7;
  --blue:#265d8d; --blue-wash:#e1effb;
}
:root[data-theme=ocean] {
  --bg:#0c1924; --rail-bg:#09131d; --surface:#152736;
  --surface-soft:#213948; --chat-bg:#0e1f2d; --bubble:#1b3141;
  --bubble-out:#15464e; --ink:#eff8fc; --muted:#adc2d0;
  --accent:#78e3dc; --on-action:#0c3034; --accent-wash:#1b3b47;
  --line:#304858; --control-line:#617f93;
  --violet:#d3c6ff; --violet-wash:#35314c;
  --amber:#f3ce91; --amber-wash:#3e352c;
  --blue:#a9d6ff; --blue-wash:#243d54;
}
:root[data-theme=ocean-light] {
  --bg:#edf4f8; --rail-bg:#e4eef5; --surface:#fff;
  --surface-soft:#e8f0f6; --chat-bg:#f0f6fa; --bubble:#fff;
  --bubble-out:#d6eeec; --ink:#1b3342; --muted:#506c7b;
  --accent:#106974; --on-action:#fff; --accent-wash:#dcf0f0;
  --line:#cfdee8; --control-line:#7695a8;
  --violet:#64488c; --violet-wash:#eee8f9;
  --amber:#80521c; --amber-wash:#f8ecd8;
  --blue:#265d8d; --blue-wash:#e2effb;
}
:root:root {
  --hairline:var(--line); --glass:var(--surface); --glass-line:var(--line);
  --brand-ink:var(--accent); --lime:var(--accent); --accent-ink:var(--on-action);
  --workspace-line:color-mix(in srgb,var(--line) 82%,transparent);
  --workspace-shadow:0 12px 34px color-mix(in srgb,var(--rail-bg) 25%,transparent);
  --workspace-ease:cubic-bezier(.22,.76,.28,1);
}

/* Navigation and page hierarchy */
.app-shell,.nav-strip {background:var(--rail-bg)}
.main {border-radius:21px;box-shadow:var(--workspace-shadow)}
.brand-orbit {border-radius:11px;box-shadow:inset 0 1px 0 #ffffff40,0 4px 12px #0002}
.nav-strip>.logo::after {font-weight:710;letter-spacing:-.055em}
.nav button {font-size:13px;min-height:44px}
.nav button.active {box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 16%,transparent)}
.nav button.active::before {left:5px;width:2px;height:14px}
.rail-footer {border-color:var(--workspace-line)}
.content {background:radial-gradient(ellipse at 88% 0%,var(--accent-wash),transparent 56%),var(--bg)}
.messenger-mode .content {background:var(--chat-bg)}
.page-heading {gap:16px;margin-bottom:24px}
.page-heading h1 {font-size:clamp(29px,3.1vw,40px);line-height:1.13;letter-spacing:-.045em;font-weight:700}
.page-heading p {max-width:64ch;font-size:14px;line-height:1.6}
.page-heading .eyebrow {display:none}
.topbar {min-height:58px}
.breadcrumb strong {font-size:14px;font-weight:650}
.button,.icon-button {transition:background-color 140ms,border-color 140ms,color 140ms,box-shadow 140ms,transform 160ms var(--workspace-ease)}
.button.primary,.composer-send {box-shadow:inset 0 1px 0 #ffffff36,0 2px 5px #0002}
.icon-button:active:not(:disabled),.nav button:active {transform:scale(.95)}
.button:focus-visible,.nav button:focus-visible {outline:2px solid var(--accent);outline-offset:2px}

/* Inbox and conversation */
.inbox-list {border-inline-end:1px solid var(--workspace-line)}
.inbox-list-head {padding:19px 18px 13px;border-bottom:1px solid var(--workspace-line)}
.inbox-heading {margin-bottom:12px}
.inbox-heading h3 {font-size:30px;letter-spacing:-.05em;font-weight:710}
.inbox-list-count {border-radius:20px;font-variant-numeric:tabular-nums}
.inbox-search-row {border:1px solid var(--workspace-line);border-radius:12px;background:var(--surface-soft)}
.inbox-search-row:focus-within {border-color:var(--control-line);box-shadow:var(--focus-ring)}
.inbox-filterbar {gap:7px;margin-top:9px}
.inbox-unread-toggle,.inbox-filter-toggle {min-height:40px;border-radius:10px}
.conversation-items {padding:6px 8px 10px}
.conversation-entry {margin:2px 0;contain-intrinsic-size:auto 83px}
.conversation-item {min-height:75px;padding:11px 10px;border-radius:12px;gap:11px}
.conversation-item.active {background:var(--accent-wash);border-color:color-mix(in srgb,var(--accent) 23%,var(--line))}
.conversation-item.whatsapp-unread:not(.active) {background:color-mix(in srgb,var(--accent-wash) 42%,var(--surface))}
.conversation-item>.avatar {width:43px;height:43px;border-radius:15px}
.avatar:not(:has(img)) {background:linear-gradient(145deg,var(--accent-wash),var(--surface-soft));color:var(--accent)}
.thread-title-row strong {font-size:14px;font-weight:660}
.thread-title-row time {font-size:11px;font-variant-numeric:tabular-nums}
.thread-preview-row p {font-size:13px;font-weight:440}
.thread-client-stage {border-radius:7px;color:var(--accent);background:var(--accent-wash)}
.thread-client-stage:is([data-client-stage=delivery],[data-client-stage=shipped]) {color:var(--blue);background:var(--blue-wash)}
.thread-client-stage[data-client-stage=awaiting_payment] {color:var(--amber);background:var(--amber-wash)}
.thread-client-stage[data-client-stage=cancelled] {color:var(--danger);background:var(--danger-bg)}
.unread-chat-count {border-radius:999px}
.conversation-entry>.thread-actions {top:5px;right:5px;bottom:auto;z-index:2}
@media (hover:hover) {
  .conversation-entry>.thread-actions {width:30px;height:28px;min-width:30px;min-height:28px}
  .conversation-entry:focus-within:not(:hover)>.thread-actions:not(:focus-visible) {opacity:0}
  .conversation-entry:hover .thread-title-row time,.conversation-entry:has(>.thread-actions:focus-visible) .thread-title-row time {opacity:0}
  .message-meta .message-actions {width:28px;height:26px;min-width:28px;min-height:26px}
}
@media (hover:none) {
  .conversation-item {padding-inline-end:48px}
  .conversation-entry>.thread-actions {top:8px;width:40px;min-width:40px;height:40px;min-height:40px}
}
.chat-area {
  background:radial-gradient(ellipse at 65% 0%,color-mix(in srgb,var(--accent) 7%,transparent),transparent 62%),var(--chat-bg);
}
.chat-heading {background:var(--surface);box-shadow:0 4px 16px #0000000b}
.chat-head {min-height:62px;padding-block:9px}
.chat-title h3 {font-size:16px;font-weight:670}
.chat-quick-actions {padding-bottom:9px;gap:7px}
.chat-quick-actions .button {border-radius:9px;min-height:36px}
.message-list {gap:9px;padding-block:20px}
.message {font-size:15px;line-height:1.5;padding:10px 13px;border-radius:16px 16px 16px 5px}
.message.out {border-radius:16px 16px 5px 16px;border-color:color-mix(in srgb,var(--accent) 13%,transparent)}
.message-meta {margin-top:2px;gap:6px;font-variant-numeric:tabular-nums}
.message-day {font-size:11px;border-radius:999px}
.chat-foot {padding-block:8px 14px}
.message-composer {border-radius:16px;padding:6px;box-shadow:0 6px 22px #00000013}
.composer-line .composer-ai {background:var(--violet-wash);color:var(--violet)}
.composer-line .composer-send {border-radius:11px}
.chat-area>.empty .empty-icon {transform:none;background:var(--accent-wash);color:var(--accent);border-radius:23px}
.chat-area>.empty .empty-icon svg {transform:none}
.empty h3 {font-weight:670}

/* Each working section has a recognisable structure. */
.contacts-panel,.tasks-panel,.section-card,.settings-disclosure {border-radius:17px}
.contacts-grid {background:color-mix(in srgb,var(--bg) 45%,var(--surface))}
.contact-card {border-radius:14px;box-shadow:0 2px 5px #00000008}
.contact-card-open h3 {font-size:16px;font-weight:670}
.contact-card-meta,.contact-sub,.task-meta {font-size:12px}
.tasks-toolbar {gap:12px}
.task-tabs {padding:3px;background:var(--surface-soft);border-radius:12px}
.task-row {padding:14px 18px}
.task-title {font-size:15px;font-weight:650}
.task-row.done .task-title {color:var(--muted)}
.deal-column {padding:12px;background:color-mix(in srgb,var(--surface-soft) 69%,var(--bg))}
.deal-column-title {min-height:36px;padding-bottom:10px}
.deal-column[data-stage=payment] .deal-column-title::before {background:var(--amber)}
.deal-column[data-stage=delivery] .deal-column-title::before {background:var(--blue)}
.deal-column[data-stage=done] .deal-column-title::before {background:var(--accent)}
.deal-card {border-radius:12px;border-top:1px solid var(--line)}
.deal-card .deal-amount,.stat-value {font-variant-numeric:tabular-nums}
.ai-country-tab.selected {background:var(--violet-wash);border-color:var(--violet);color:var(--violet)}
.ai-country-prompt {border-top:2px solid var(--violet)}
.ai-memory-rule {border-inline-start-color:var(--violet)}
.settings-disclosure>summary,.account-row-title h3 {font-weight:650}
.theme-option {border-radius:13px}
.theme-option[aria-pressed=true] {background:var(--accent-wash)}
.modal {border-radius:19px}
.modal-head,.modal-footer {background:var(--surface)}
.modal-head {min-height:62px;padding-block:12px}
.modal-head h2 {font-weight:680}
.modal-footer {gap:8px}
.overlay-backdrop,.drawer-backdrop {backdrop-filter:blur(3px)}
.drawer {border-radius:18px}
.toast {border-inline-start:3px solid var(--accent)}
.login-brand {background:radial-gradient(ellipse at 20% 12%,var(--accent-wash),transparent 68%),var(--surface)}

@media (min-width:761px) and (max-width:1200px) {
  .nav button {font-size:10px;min-height:55px}
}
@media (max-width:760px) {
  .main,.drawer {border-radius:0}
  .nav-strip {background:var(--surface)}
  .nav button {font-size:10px;min-height:52px}
  .inbox-list {border-inline-end:0}
  .inbox-list-head {padding:16px 14px 10px}
  .inbox-heading h3 {font-size:29px}
  .conversation-item {min-height:77px;padding-inline:10px}
  @media (hover:none) {.conversation-item {padding-inline-end:48px}}
  .chat-head {padding-block:7px}
  .chat-quick-actions .button {min-height:40px}
  .chat-foot {padding-bottom:max(8px,env(safe-area-inset-bottom))}
  .message-composer {padding:4px}
  .page-heading {align-items:flex-start;margin-bottom:17px}
  .page-heading p {font-size:13px}
  .task-row {padding:10px 8px;gap:8px}
  .modal {border-radius:17px}
}
@media (prefers-reduced-motion:reduce) {
  .button,.icon-button,.nav button,.conversation-item,.contact-card,.deal-card {transition:none}
  .button:active,.icon-button:active,.nav button:active {transform:none}
}
