/* Shared SIHub design. Load after module styles through i18n_head.html.
   Modules use these text tokens so small-screen rules keep the same readable
   scale. Marketing display headings and illustrated/icon sizes stay separate. */
:root {
  --sihub-font-body: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sihub-font-heading: 'Manrope', var(--sihub-font-body);
  --sihub-font-display: 'Courier New', Courier, ui-monospace, monospace;
  --sihub-text-sm: 14px;
  --sihub-text-ui: 15px;
  --sihub-text-base: 16px;
  --sihub-text-h1: clamp(27px, 2.5vw, 32px);
  --sihub-text-h2: 22px;
  --sihub-text-h3: 18px;
  --sihub-ink: #0c3155;
  --sihub-muted: #526b80;
  --sihub-bg: #edf4fa;
  --sihub-grid: #d9e5ef;
  --sihub-surface: #fff;
  --sihub-border: #cfdeea;
  --sihub-accent: #166a68;
  --sihub-accent-dark: #0f5553;
  --sihub-accent-soft: #e7f5f0;
  --sihub-highlight: #d9efe8;
  --sihub-radius: 10px;
  --sihub-control-radius: 7px;
  --sihub-shadow: 0 3px 12px #0c31550d;
  --font: var(--sihub-font-body);
  --heading: var(--sihub-font-heading);
  --bg: var(--sihub-bg);
  --paper: var(--sihub-bg);
  --surface: var(--sihub-surface);
  --white: var(--sihub-surface);
  --ink: var(--sihub-ink);
  --muted: var(--sihub-muted);
  --border: var(--sihub-border);
  --line: var(--sihub-border);
  --accent: var(--sihub-accent);
  --green: var(--sihub-accent);
  --green-dark: var(--sihub-accent-dark);
  --green-soft: var(--sihub-accent-soft);
  --lime: var(--sihub-highlight);
  --sidebar: var(--sihub-ink);
  --hh-navy: var(--sihub-ink);
  --hh-green: var(--sihub-highlight);
  --hh-teal: var(--sihub-accent);
  --hh-border: var(--sihub-border);
  --hh-muted: var(--sihub-muted);
  --tutorial-navy: var(--sihub-ink);
  --tutorial-green: var(--sihub-highlight);
  --tutorial-muted: var(--sihub-muted);
  --tutorial-border: var(--sihub-border);
  --radius: var(--sihub-radius);
  --shadow: var(--sihub-shadow);
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-base);
  color: var(--sihub-ink);
  font-synthesis: none;
}

:root body,
:root body.marketing,
:root body.docs-body,
:root body.auth-body,
:root body.legal-body {
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-base);
  line-height: 1.6;
  color: var(--sihub-ink);
  background: var(--sihub-bg);
  -webkit-font-smoothing: antialiased;
  --green: var(--sihub-accent);
  --lime: var(--sihub-highlight);
  --muted: var(--sihub-muted);
  --border: var(--sihub-border);
}

/* The public canvas follows the pale graph-paper reference. White content
   surfaces remain solid so long text and forms retain their contrast. */
:root body.marketing,
:root body.docs-body,
:root body.auth-body,
:root body.legal-body {
  background-color: var(--sihub-bg);
  background-image:
    linear-gradient(var(--sihub-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--sihub-grid) 1px, transparent 1px);
  background-size: 30px 30px;
}
:root body.marketing :is(.button-dark, .business-tabs [data-usecase][aria-selected=true]),
:root body.docs-body .button-dark {
  background-color: var(--sihub-ink);
  border-color: var(--sihub-ink);
  color: #fff;
}
:root body.marketing :is(.button-dark, .business-tabs [data-usecase][aria-selected=true]):hover,
:root body.docs-body .button-dark:hover {
  background-color: var(--sihub-accent-dark);
  border-color: var(--sihub-accent-dark);
}
:root body.marketing :is(.button-outline, .business-usecase-panel, .business-capability-grid article),
:root body.docs-body :is(.docs-card, .docs-start-banner) {
  border-color: var(--sihub-border);
}
:root body.marketing .button-outline {
  background: var(--sihub-surface);
  color: var(--sihub-ink);
}
:root body.marketing .button-outline:hover {
  background: var(--sihub-accent-soft);
}
:root body.marketing :is(.announcement, .task-panel-heading, .final-cta, .commerce-hero, .contact-direct),
:root body.docs-body .doc-article pre {
  background-color: var(--sihub-ink);
}
:root body.marketing .business-process-section {
  background-color: #e6f0f8ba;
  border-color: var(--sihub-border);
}
:root body.marketing .business-case-bot-icon {
  background: var(--sihub-accent-soft);
  color: var(--sihub-accent);
}
:root body.docs-body .docs-header {
  background-color: var(--sihub-bg);
  border-color: var(--sihub-border);
}
:root body.docs-body .docs-install-banner {
  background: var(--sihub-surface);
  border-color: var(--sihub-border);
  box-shadow: var(--sihub-shadow);
}
:root body.marketing.commerce-body {
  --commerce-muted: var(--sihub-muted);
}
:root body.marketing.commerce-body .commerce-skip {
  background: var(--sihub-accent-soft);
  border-color: var(--sihub-ink);
}
:root body.marketing.commerce-body :is(.main-nav > a[aria-current=page], .offer-availability a, .offer-contract-note a, .offer-terms a, .offer-explanation summary, .checkout-review .back-link, .contact-intro h1 em, .contact-links > a, .contact-receipt p a, .receipt-new, .result-help a, .privacy-field a) {
  color: var(--sihub-accent);
}
:root body.marketing.commerce-body :is(.button:disabled, .free-plan-card, .subscription-card, .result-order, .bot-section) {
  background-color: var(--sihub-accent-soft);
  border-color: var(--sihub-border);
}
:root body.marketing.commerce-body .button:disabled {
  color: var(--sihub-muted);
}
:root body.marketing.commerce-body :is(.offer-card, .plan-card, .result-panel, .contact-form-panel, .purchased-bot, .billing-table-wrap, .commerce-empty) {
  background-color: var(--sihub-surface);
  border-color: var(--sihub-border);
}
:root body.marketing.commerce-body :is(.offer-type, .offer-price, .offer-features li > span, .offer-periods legend, .offer-usage strong, .billing-table td strong) {
  color: var(--sihub-ink);
}
:root body.marketing.commerce-body :is(.offer-symbol, .offer-bot-icon, .purchased-bot-icon, .receipt-icon) {
  background-color: var(--sihub-accent-soft);
  color: var(--sihub-accent);
}
:root body.marketing.commerce-body :is(.offer-tax, .offer-contract-note, .offer-terms label, .offer-period small, .offer-annual-note, .offer-usage, .checkout-review-features, .commerce-fineprint, .contact-form-note, .result-order small) {
  color: var(--sihub-muted);
}
:root body.marketing.commerce-body :is(.offer-period, .checkout-review-form, .billing-section, .billing-table td, .offer-features) {
  border-color: var(--sihub-border);
}
:root body.marketing.commerce-body :is(.contact-links > a, .billing-help) {
  border-color: var(--sihub-border);
}
:root body.marketing.commerce-body .offer-period:has(input:checked) {
  background: var(--sihub-accent-soft);
  border-color: var(--sihub-accent);
}
:root body.marketing.commerce-body :is(.offer-period input, .offer-terms input, .privacy-field input) {
  accent-color: var(--sihub-accent);
}
:root body.marketing.commerce-body :is(.offer-terms input, .offer-explanation summary):focus-visible {
  outline-color: var(--sihub-accent);
}
:root body.marketing.commerce-body :is(.offer-period:focus-within, .offer-selected) {
  outline-color: var(--sihub-accent);
}
:root body.marketing.commerce-body .offer-savings {
  background: var(--sihub-highlight);
  color: var(--sihub-ink);
}
:root body.marketing.commerce-body :is(.form-field input, .form-field textarea) {
  background: var(--sihub-surface);
  border-color: var(--sihub-border);
  color: var(--sihub-ink);
}
:root body.marketing.commerce-body :is(.form-field input, .form-field textarea):focus {
  border-color: var(--sihub-accent);
}
:root body.marketing.commerce-body .billing-table th {
  background: var(--sihub-accent-soft);
  color: var(--sihub-ink);
}
:root body.marketing.commerce-body .billing-table td {
  color: var(--sihub-muted);
}
:root body.marketing.commerce-body .contact-direct {
  color: #fff;
}
:root body.marketing.commerce-body .contact-icon {
  background: #ffffff1a;
  color: #fff;
}
:root body.marketing.commerce-body .offer-action .button-lime {
  border-color: var(--sihub-border);
}

/* A restrained typewriter accent echoes the reference without changing copy. */
:root body.marketing .eyebrow,
:root body.docs-body .eyebrow,
:root body.legal-body .eyebrow,
:root body.auth-body .eyebrow {
  font-family: var(--sihub-font-display);
}

:root :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--sihub-font-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
}
:root :is(.page-heading, .hh-page-heading, .header-title, .hellocash-intro, .tutorial-intro) h1,
:root .sihub-inbox h1,
:root .helper-shell h1 {
  font-family: var(--sihub-font-heading);
  font-size: var(--sihub-text-h1);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
}
:root :is(.panel-header, .hh-card, .calendar-card, .hellocash-card, .list-toolbar, .conversation-placeholder) h2 {
  font-size: var(--sihub-text-h2);
  line-height: 1.35;
}
:root :is(.panel, .hh-card, .calendar-card, .hellocash-card) h3 {
  font-size: var(--sihub-text-h3);
  line-height: 1.4;
}
:root :is(.page-heading, .hh-page-heading, .header-title) p {
  font-size: var(--sihub-text-base);
  line-height: 1.65;
}
:root :is(.eyebrow, .hh-eyebrow, .kicker, .sidebar-label, .hh-nav-caption) {
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-sm);
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: .055em;
}
:root :is(.brand, .hh-brand, .tutorial-brand) {
  font-family: var(--sihub-font-heading);
  letter-spacing: -.035em;
}

/* A common action and field treatment across public pages and workspaces. */
:root :is(.button, .hh-button),
:root body.marketing .button {
  min-height: 44px;
  max-inline-size: 100%;
  border-radius: var(--sihub-control-radius);
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-ui);
  font-weight: 650;
  line-height: 1.4;
  padding: 11px 16px;
  gap: 8px;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}
:root :is(.button.small, .button-small),
:root body.marketing :is(.button.small, .button-small) {
  min-height: 38px;
  padding: 8px 12px;
  font-size: var(--sihub-text-sm);
}
:root .button.icon-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  font-size: 24px;
}
:root :is(.button.primary, .hh-button-dark, .hh-button-green),
:root .postfach-body .button:not(.secondary):not(.icon-button) {
  background: var(--sihub-accent);
  border-color: var(--sihub-accent);
  color: #fff;
}
:root :is(.button.primary, .hh-button-dark, .hh-button-green):hover,
:root .postfach-body .button:not(.secondary):not(.icon-button):hover {
  background: var(--sihub-accent-dark);
  border-color: var(--sihub-accent-dark);
}
:root :is(.button.secondary, .hh-button:not(.hh-button-dark):not(.hh-button-green)) {
  background: var(--sihub-surface);
  border-color: #b9ccd8;
  color: var(--sihub-accent);
}
:root .sihub-inbox .page-heading .button {
  background: var(--sihub-surface);
  border-color: #b9ccd8;
  color: var(--sihub-accent);
}
:root :is(.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea),
:root .hh-form-grid :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-base);
  line-height: 1.5;
  border-color: #ccd6de;
  border-radius: var(--sihub-control-radius);
  padding: 11px 12px;
  min-inline-size: 0;
}
:root :is(.field-label, .field label, .checkbox-label) {
  font-family: var(--sihub-font-body);
  font-size: var(--sihub-text-ui);
  line-height: 1.5;
}
:root :is(.field-hint, .sidebar-note, .hh-subtle, .hh-footnote) {
  font-size: var(--sihub-text-sm);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
:root :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 3px solid #81a9c0;
  outline-offset: 3px;
}
:root :is(.field textarea.code, pre, code, .code, .code-block, .hub-event-data) {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Shared shell rhythm, navigation and quiet card surfaces. */
:root :is(.panel, .agent-card, .stat-card, .hh-card, .hh-stat, .calendar-card, .hellocash-card,
  .helper-summary, .tutorial-card, .browser-workflow-card, .registration-card,
  .team-panel, .team-run-card, .team-action-card, .contact-form-panel, .result-panel,
  .subscription-card, .auth-card, .docs-card, .bot-setup-panel),
:root body.marketing :is(.feature-card, .product-feature-card, .tax-role-card,
  .offer-card, .plan-card, .contact-panel, .billing-panel, .business-task-panel,
  .business-usecase-panel) {
  border-color: var(--sihub-border);
  border-radius: var(--sihub-radius);
  box-shadow: var(--sihub-shadow);
}
:root :is(.settings-dialog, .calendar-event-dialog, .modal, dialog) {
  border-radius: var(--sihub-radius);
}
:root :is(.helper-board, .sihub-inbox .inbox-board) {
  border-color: var(--sihub-border);
  border-radius: var(--sihub-radius);
  box-shadow: var(--sihub-shadow);
}
:root :is(.nav-link, .hh-nav-link) {
  border-radius: var(--sihub-control-radius);
  font-size: var(--sihub-text-ui);
  line-height: 1.5;
  font-weight: 500;
  color: #c3d0dc;
}
:root :is(.nav-link.active, .hh-nav-link.is-active) {
  background: var(--sihub-highlight);
  color: #1b3a51;
  font-weight: 650;
}
:root :is(.nav-link, .hh-nav-link):hover {
  background: #294258;
  color: #fff;
}
:root :is(.nav-link.active, .hh-nav-link.is-active):hover {
  background: var(--sihub-highlight);
  color: #1b3a51;
}
:root .hh-sidebar {
  width: 280px;
  background: var(--sihub-ink);
  overflow-y: auto;
  scrollbar-width: thin;
}
:root .hh-sidebar > * { flex-shrink: 0; }
:root .hh-content { margin-inline-start: 280px; }
:root :is(.topbar, .hh-topbar) { min-height: 72px; }
:root .hh-nav-caption { color: #a3b6c7; }
:root .hh-workspace { background: #223a50; border-color: #344d63; }
:root :is(.hh-workspace small, .hh-sidebar-note p, .hh-sidebar-bottom) { color: #b5c6d4; }
:root .hh-card { background: var(--sihub-surface); }
:root :is(.folder-button.is-active, .hh-tab.is-active) {
  background: var(--sihub-accent-soft);
  color: var(--sihub-accent);
}
:root .helper-shell .inbox-header { align-items: flex-start; }
:root .helper-shell .header-actions { padding-block-start: 8px; }
:root .helper-board { grid-template-columns: 190px 300px minmax(0, 1fr); }
:root .helper-board .folder-button { font-size: var(--sihub-text-ui); }

/* The mailbox uses the existing case list and a dedicated mail conversation. */
:root .sihub-mailbox .inbox-board {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: min(850px, calc(100dvh - 265px));
  min-height: 540px;
  gap: 0;
  overflow: hidden;
  align-items: stretch;
  border: 1px solid var(--sihub-border);
  background: var(--sihub-surface);
}
:root .sihub-mailbox .inbox-board > [hidden] { display: none; }
:root .sihub-mailbox .team-case-panel {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  border: 0;
  border-inline-end: 1px solid var(--sihub-border);
  border-radius: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
:root .sihub-mailbox .team-case-panel > :is(header, aside, .list-toolbar) { flex-shrink: 0; }
:root .sihub-mailbox .inbox-list-panel { flex: 1; }
:root .sihub-mailbox .thread-list { max-height: none; min-height: 100px; }
:root .sihub-mailbox .conversation-panel {
  display: block;
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: var(--sihub-surface);
}
:root .sihub-mailbox .conversation-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
}
:root .sihub-mailbox :is(.thread-customer, .thread-subject) { font-size: var(--sihub-text-ui); }
:root .sihub-mailbox .message-body { font-size: var(--sihub-text-base); }

/* Keep language fallback fonts and RTL positioning without changing code. */
html:lang(ar) {
  --sihub-font-body: 'Noto Sans Arabic', 'DM Sans', system-ui, sans-serif;
  --sihub-font-heading: var(--sihub-font-body);
}
html:lang(ar) body { line-height: 1.7; }
html:lang(ar) :is(.eyebrow, .hh-eyebrow, .kicker, .hh-nav-caption) { letter-spacing: 0; }

@media (max-width: 1350px) and (min-width: 1101px) {
  :root .helper-board { grid-template-columns: 180px 260px minmax(0, 1fr); }
}
@media (max-width: 1200px) {
  :root .hh-sidebar { width: 260px; }
  :root .hh-content { margin-inline-start: 260px; }
}
@media (max-width: 1100px) {
  :root .helper-board { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1000px) and (min-width: 541px) {
  :root .hh-sidebar { width: 74px; }
  :root .hh-content { margin-inline-start: 74px; }
}
@media (max-width: 900px) {
  :root .sihub-mailbox .inbox-board {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 540px;
  }
  :root .sihub-mailbox .team-case-panel { border-inline-end: 0; }
  :root .sihub-mailbox .conversation-panel { display: none; grid-column: 1; }
  :root .sihub-mailbox .has-selection .team-case-panel { display: none; }
  :root .sihub-mailbox .has-selection .conversation-panel { display: block; }
  :root .sihub-mailbox .mobile-back { display: inline-flex; }
}
@media (max-width: 760px) {
  :root .helper-board { grid-template-columns: minmax(0, 1fr); }
  :root .helper-shell .header-actions { padding-block-start: 0; }
  :root .helper-shell .header-actions .button { flex: 1 1 auto; }
  :root .helper-board .folder-button { min-height: 44px; font-size: var(--sihub-text-sm); }
  :root .helper-shell .header-title h1 { font-size: var(--sihub-text-h1); }
  :root .helper-shell .header-title p { font-size: var(--sihub-text-base); }
  :root .helper-board .inbox-sidebar > .input { font-size: var(--sihub-text-base); }
}
@media (max-width: 540px) {
  :root .hh-sidebar { width: auto; }
  :root .hh-content { margin-inline-start: 0; }
  :root .hh-topbar {
    min-height: 66px;
    height: auto;
    padding-block: 12px;
    flex-wrap: wrap;
    gap: 12px;
  }
  :root .hh-topbar > div { min-inline-size: 0; max-inline-size: 100%; }
  :root .hh-topbar-actions { flex-wrap: wrap; gap: 8px; }
  :root .sihub-mailbox :is(.conversation-header, .messages, .reply-form) { padding: 20px 16px; }
}
