:root {
  --ink: #18211d;
  --muted: #66706b;
  --line: #ddd7ca;
  --surface: #fffdf8;
  --soft: #f1eee6;
  --brand: #244735;
  --brand-strong: #14231b;
  --brand-soft: #edf2ea;
  --deep: #101b16;
  --paper: #f4efe6;
  --champagne: #b39363;
  --champagne-soft: #e7d7b8;
  --lavender: #d9c8e9;
  --graphite: #2b3036;
  --danger: #b91c1c;
  --warn: #9b6f2d;
  --shadow: 0 18px 46px rgba(38, 35, 26, .08);
  --panel-shadow: 0 22px 52px rgba(43, 36, 24, .09);
  --grid-line: rgba(255, 255, 255, .36);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 74% 14%, rgba(179,147,99,.14), transparent 34%),
    linear-gradient(135deg, #f6f2e9 0%, #ece8df 100%);
  background-size: 58px 58px, 58px 58px, auto, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.button.primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px rgba(36,71,53,.16); }
.button.primary:hover { background: #1d3c2d; }
.button.ghost { background: rgba(255,253,248,.94); color: var(--ink); border-color: var(--line); }
.button.danger { background: #fff1f1; color: var(--danger); border-color: #f4b7b7; }
.button.compact { min-height: 32px; padding: 0 10px; font-size: 13px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: #e9efe8; color: var(--deep); font-weight: 850; }
.deseno-wordmark { min-width: 118px; height: 42px; border: 1px solid rgba(179,147,99,.28); border-radius: 999px; display: inline-grid; place-items: center; background: #fffdf8; color: var(--deep); font-family: Arial, "Noto Sans TC", sans-serif; font-size: 19px; font-weight: 900; letter-spacing: 0; padding: 0 16px; box-shadow: 0 10px 28px rgba(34,30,20,.12); }
.brand span { display: block; color: #a9b4ad; font-size: 12px; margin-top: 2px; }
.app-shell { display: grid; grid-template-columns: 274px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar-backdrop { position: fixed; inset: 0; background: rgba(16, 22, 28, .45); opacity: 0; pointer-events: none; z-index: 70; transition: opacity .22s ease; }
.sidebar { background: linear-gradient(145deg, #1c2a20 0%, var(--deep) 62%, #0c1712 100%); color: #f8fbfa; padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; box-shadow: 18px 0 44px rgba(22,28,22,.08); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-menu-toggle { display: none; }
.sidebar-close { display: none; }
.nav-list { display: grid; gap: 6px; }
.nav-item { min-height: 43px; border: 0; border-radius: 8px; background: transparent; color: #d7e2e1; padding: 10px 12px; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--champagne); }
.nav-group { display: grid; gap: 5px; padding: 7px; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: rgba(255,255,255,.035); }
.nav-group.is-active { border-color: rgba(215,194,153,.24); background: rgba(255,255,255,.06); }
.nav-group-title { padding: 3px 5px; color: #c7b68e; font-size: 12px; font-weight: 850; letter-spacing: .02em; }
.nav-subitem { min-height: 38px; padding-left: 18px; font-size: 14px; }
.main { min-width: 0; padding: 22px; }
.topbar, .section-tools, .topbar-actions, .modal-header, .modal-actions, .button-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.topbar { margin-bottom: 18px; align-items: flex-start; display: grid; grid-template-columns: minmax(220px, 1fr) auto; }
.page-heading { min-width: 0; }
.heading-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.version-pill { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.92); color: var(--muted); padding: 5px 9px; font-size: 12px; font-weight: 760; }
.topbar-actions { justify-content: flex-end; }
.eyebrow { margin: 0 0 4px; color: var(--brand); font-size: 12px; font-weight: 850; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; margin-bottom: 0; }
h2 { font-size: 18px; }
.search, .field input, .field select, .field textarea, .language-switcher { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.96); color: var(--ink); padding: 9px 10px; width: 100%; }
.search { width: min(360px, 34vw); }
.language-switcher { width: 86px; }
.file-label input { display: none; }
.view { display: none; }
.view.is-visible { display: block; }
.stats-grid, .content-grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.content-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); }
.panel, .record-list, .stat, .modal form, .report-card { background: rgba(255,253,248,.96); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--panel-shadow); padding: 16px; }
.stat { color: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.stat:hover { transform: translateY(-2px); border-color: var(--champagne); box-shadow: 0 18px 44px rgba(43, 36, 24, .12); }
.stat.is-passive { cursor: default; opacity: 1; }
.stat.is-passive:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.stat strong { font-size: 27px; display: block; }
.stat span, .meta { color: var(--muted); font-size: 13px; }
.stat-detail { display: block; min-height: 18px; margin-top: 4px; line-height: 1.35; }
.stat small { display: block; margin-top: 12px; color: var(--brand); font-size: 12px; font-weight: 760; }
.dashboard-view.is-visible { display: grid; gap: 14px; }
.dashboard-stats { grid-template-columns: repeat(8, minmax(118px, 1fr)); gap: 10px; margin-bottom: 0; }
.dashboard-stats .stat { min-height: 106px; padding: 12px; display: grid; align-content: start; }
.dashboard-stats .stat strong { margin-top: 2px; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.1; overflow-wrap: anywhere; }
.dashboard-stats .stat small { margin-top: 8px; }
.dashboard-stats .stat.primary { border-color: #9caf91; background: linear-gradient(135deg, #f8fbf4, #fffdf8); }
.dashboard-stats .stat.warn { border-color: var(--champagne-soft); background: #fff9ec; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); grid-template-areas: "insights insights" "flow queue" "flow finance" "operations operations" "alerts alerts" "progress progress"; gap: 14px; align-items: start; }
.dashboard-panel { padding: 14px; }
.dashboard-flow { grid-area: flow; }
.dashboard-queue { grid-area: queue; }
.dashboard-finance { grid-area: finance; }
.dashboard-operations { grid-area: operations; }
.dashboard-insights { grid-area: insights; }
.dashboard-alerts { grid-area: alerts; }
.dashboard-progress { grid-area: progress; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.dashboard-kanban { grid-template-columns: repeat(6, minmax(112px, 1fr)); gap: 10px; }
.stage-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.stage-head h3 { margin: 0; font-size: 14px; }
.stage-head span { min-width: 28px; min-height: 24px; border-radius: 999px; background: #fff; border: 1px solid var(--line); display: inline-grid; place-items: center; color: var(--brand); font-weight: 850; font-size: 12px; }
.stage-empty { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); padding: 9px; font-size: 13px; text-align: center; }
.stage-more { width: 100%; margin-top: 2px; }
.dashboard-queue-list { max-height: 292px; overflow: auto; padding-right: 2px; }
.mini-card-kicker { display: block; color: var(--brand); font-size: 12px; font-weight: 760; margin-bottom: 4px; }
.dashboard-mini-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dashboard-mini-metric, .dashboard-alert { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; display: grid; gap: 4px; text-align: left; color: inherit; }
.dashboard-alert { cursor: pointer; }
.dashboard-alert:hover { border-color: #9ccbc5; background: #eef6f5; }
.dashboard-mini-metric span, .dashboard-alert span, .dashboard-mini-metric small, .dashboard-alert small { color: var(--muted); font-size: 12px; }
.dashboard-mini-metric strong, .dashboard-alert strong { font-size: 18px; overflow-wrap: anywhere; }
.dashboard-alert-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dashboard-alerts .dashboard-alert-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(188px, 1fr); grid-template-columns: none; gap: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scroll-snap-type: x proximity; }
.dashboard-progress-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scroll-snap-type: x proximity; }
.dashboard-insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dashboard-insight-card { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; min-width: 0; }
.dashboard-insight-card h3 { margin: 0 0 8px; font-size: 15px; }
.dashboard-insight-card .analysis-row { grid-template-columns: minmax(86px, 1fr) 34px minmax(76px, 1.2fr); gap: 8px; padding: 7px 0; }
.dashboard-insight-card .analysis-row strong { overflow-wrap: anywhere; }
.dashboard-operation-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; }
.dashboard-operation-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; color: inherit; padding: 12px; text-align: left; display: grid; gap: 5px; cursor: pointer; transition: border-color .16s ease, transform .16s ease, background .16s ease; }
.dashboard-operation-card:hover { border-color: #9ccbc5; background: #eef6f5; transform: translateY(-1px); }
.dashboard-operation-card span { color: var(--muted); font-size: 12px; font-weight: 760; line-height: 1.35; }
.dashboard-operation-card strong { font-size: 25px; line-height: 1; color: var(--brand); }
.dashboard-operation-card small { min-height: 32px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.35; }
.dashboard-operation-card em { color: var(--brand); font-size: 12px; font-style: normal; font-weight: 800; }
.dashboard-operation-card.is-empty { opacity: .72; }
.dashboard-operation-card.is-empty strong { color: var(--muted); }
.progress-item { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; display: grid; gap: 4px; scroll-snap-align: start; }
.progress-item strong { color: var(--brand); font-size: 13px; }
.progress-item span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.record { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .8fr) minmax(120px, .7fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record strong { display: block; overflow-wrap: anywhere; }
.record-button { width: 100%; border-top: 0; border-right: 0; border-left: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.record-button:hover { background: #f8fafb; }
.record-action { pointer-events: none; }
#rma-list .record.rma-record { grid-template-columns: minmax(0, 1.4fr) auto; align-items: stretch; padding: 15px 14px; }
.rma-record.is-warn { background: #fffdf6; }
.rma-record.is-danger { background: #fff5f4; }
.rma-title { font-size: 17px; line-height: 1.35; }
.rma-meta { color: var(--ink); opacity: .95; font-size: 13px; }
.rma-subtitle { display: inline-block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.rma-kpi-group { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.rma-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rma-kpi-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 3px; min-width: 120px; background: #fff; }
.rma-kpi-row span { color: var(--muted); font-size: 12px; font-weight: 760; }
.rma-kpi-row strong { font-size: 14px; }
.rma-danger strong { color: var(--danger); }
.rma-warn strong { color: var(--warn); }
.rma-positive strong { color: #0f766e; }
.list-toolbar { min-height: 44px; padding: 0 14px 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.list-toolbar strong { color: var(--ink); }
.list-limit-notice { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid #d9e5e3; background: #f3faf8; color: var(--muted); border-radius: 6px; font-weight: 760; font-size: 13px; }
.remote-pager { margin: 10px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.empty-state { padding: 18px 14px; }
.is-hidden { display: none !important; }
.stat:focus-visible, .record-button:focus-visible { outline: 3px solid rgba(15, 118, 110, .25); outline-offset: 2px; }
.badge { display: inline-flex; width: fit-content; max-width: 100%; border-radius: 999px; padding: 4px 9px; background: #eef6f5; color: var(--brand); font-size: 12px; font-weight: 760; }
.badge.warn { background: #fff7ed; color: var(--warn); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.stage { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; min-height: 132px; }
.stage-card, .mini-card { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.stage-card.is-overdue { border-color: #f0cf9c; background: #fffaf2; }
.stage-card strong, .stage-card span, .mini-card strong, .mini-card span { display: block; overflow-wrap: anywhere; }
.stage-card strong, .mini-card strong { line-height: 1.25; }
.stage-card .meta, .mini-card .meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stage-card-tags { display: flex !important; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.stage-card-tags em { border-radius: 999px; background: #eef6f5; color: var(--brand); padding: 3px 7px; font-size: 11px; font-style: normal; font-weight: 760; }
.stage-card-tags em.warn { background: #fff7ed; color: var(--warn); }
.stack { display: grid; gap: 10px; }
.modal { width: min(780px, calc(100vw - 30px)); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 20px 70px rgba(0,0,0,.23); }
.modal::backdrop { background: rgba(16,24,32,.48); }
.modal form { max-height: calc(100dvh - 34px); overflow-y: auto; position: relative; }
.modal-header { position: sticky; top: -16px; z-index: 20; margin: -16px -16px 14px; padding: 14px 16px 12px; background: #fff; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.modal-header .icon-button { flex: 0 0 auto; font-size: 22px; font-weight: 820; line-height: 1; color: var(--ink); box-shadow: 0 6px 16px rgba(16,24,32,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field.inline-field { min-width: 190px; grid-template-columns: auto minmax(140px, 1fr); align-items: center; }
.field span, .field label, .portal-scope legend { color: var(--muted); font-size: 13px; font-weight: 740; }
.field:has(input:required:not([type="hidden"])) > span:first-child::after,
.field:has(select:required) > span:first-child::after,
.field:has(textarea:required) > span:first-child::after,
.structured-address:has(input:required:not([type="hidden"])) > legend::after,
.portal-scope:has(input:required) > legend::after {
  content: "必填";
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff1f1;
  color: #b91616;
  border: 1px solid #f1c7c7;
  font-size: 11px;
  font-weight: 850;
  vertical-align: middle;
}
.consent-line:has(input:required) > span::after {
  content: " 必填";
  color: #b91616;
  font-size: 12px;
  font-weight: 900;
}
.portal-form.was-validated input:invalid,
.portal-form.was-validated select:invalid,
.portal-form.was-validated textarea:invalid {
  border-color: #d94b4b;
  box-shadow: 0 0 0 3px rgba(217,75,75,.12);
}
.field input[type="file"] { padding: 12px; min-height: 52px; background: #f8fafb; }
.phone-control { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; }
.phone-control select, .phone-control input { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 10px; width: 100%; }
.spacer { flex: 1; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.login-page, .portal-page { background: var(--deep); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.login-brand { color: var(--ink); margin-bottom: 22px; }
.login-brand span { color: var(--muted); }
.login-form { display: grid; gap: 13px; }
.login-error { min-height: 20px; color: var(--danger); font-size: 13px; }
.app-feedback { position: fixed; right: 20px; bottom: 20px; z-index: 160; width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid #b8dcd8; border-radius: 8px; background: #eef6f5; color: #17463f; box-shadow: 0 16px 42px rgba(14,36,34,.2); font-weight: 780; line-height: 1.45; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.app-feedback.is-visible { opacity: 1; transform: translateY(0); }
.app-feedback.is-loading { background: #f7f1e8; border-color: #e0c993; color: #6b4b1e; }
.app-feedback.is-error { background: #fff0f0; border-color: #efb7b7; color: #9b2c2c; }
.button.is-busy, .button:disabled { cursor: wait; opacity: .7; }
.login-hint { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; color: var(--muted); display: grid; gap: 4px; font-size: 13px; }
.portal-page { background: #f7f4ef; }
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, .8fr) minmax(520px, 1.2fr); }
.portal-hero { position: relative; isolation: isolate; background: linear-gradient(145deg, #101c1b 0%, #17312e 58%, #0e1817 100%); color: #fff; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; gap: 28px; overflow: hidden; }
.portal-hero::after { content: ""; position: absolute; inset: auto -18% -28% 16%; height: 46%; background: radial-gradient(circle, rgba(216,184,123,.2), transparent 64%); z-index: -1; pointer-events: none; }
.portal-shell:not(.portal-home) .portal-hero { justify-content: flex-start; }
.portal-home { --home-panel-top: clamp(42px, 4vw, 58px); grid-template-columns: minmax(500px, 1.08fr) minmax(460px, .92fr); background: #f7f4ef; }
.portal-home .portal-hero { --home-header-offset: clamp(98px, 8vw, 128px); --home-visual-height: min(42vh, 390px); justify-content: flex-start; overflow: hidden; padding: clamp(26px, 3.4vw, 42px) clamp(34px, 4vw, 58px) clamp(34px, 4vw, 58px); background: #f7f4ef; color: var(--ink); }
.portal-home .portal-hero::after { inset: var(--home-header-offset) 0 0; height: auto; background: linear-gradient(180deg, rgba(247,244,239,.08) 0%, rgba(247,244,239,.08) 32%, rgba(247,244,239,.96) 52%, #f7f4ef 100%); z-index: 0; }
.portal-home .portal-hero > * { position: relative; z-index: 1; }
.portal-hero-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.portal-home .portal-hero-header { align-items: center; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.96); border: 1px solid rgba(220,227,232,.86); backdrop-filter: blur(10px); box-shadow: 0 14px 34px rgba(24,32,38,.08); }
.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand span { display: block; color: rgba(232,240,238,.74); font-size: 13px; }
.portal-home .portal-brand span { color: var(--muted); }
.portal-home .deseno-wordmark { border-color: #e7ddd0; box-shadow: 0 10px 28px rgba(64,58,44,.1); }
.portal-header-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.portal-language-actions { flex: 0 0 auto; }
.portal-language-actions .language-switcher { width: 86px; }
.portal-admin-link { width: fit-content; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.portal-home-link { width: fit-content; min-height: 42px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; line-height: 1; }
.portal-home-link svg { width: 20px; height: 20px; flex: 0 0 auto; }
.portal-home-link:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.42); }
.floating-home-icon { position: fixed; left: 18px; bottom: 18px; z-index: 60; width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; background: var(--brand); color: #fff; border: 1px solid rgba(255,255,255,.42); box-shadow: 0 14px 36px rgba(0,0,0,.22); text-decoration: none; }
.floating-home-icon svg { width: 24px; height: 24px; }
.floating-home-icon:hover { background: #0f6f66; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.portal-hero-copy { margin-top: auto; }
.portal-home .portal-hero-copy { margin-top: calc(var(--home-visual-height) + clamp(34px, 4.5vh, 58px)); max-width: 660px; }
.portal-home .portal-hero h1 { font-size: clamp(36px, 4vw, 52px); line-height: 1.08; max-width: 760px; text-wrap: balance; }
.portal-title-line { display: block; white-space: nowrap; }
.portal-home .portal-top-actions { margin-top: 0; }
.portal-home #portal-version-pill { flex: 0 0 auto; background: rgba(255,255,255,.92); }
.portal-page-title { margin-top: clamp(46px, 12vh, 132px); margin-left: clamp(0px, 3vw, 48px); max-width: 560px; }
.warranty-page .portal-hero, .repair-page .portal-hero, .track-page .portal-hero { gap: 20px; padding: clamp(28px, 3vw, 40px); }
.warranty-page .portal-page-title, .repair-page .portal-page-title, .track-page .portal-page-title { margin-top: clamp(26px, 6vh, 58px); margin-left: clamp(0px, 2vw, 32px); }
.warranty-page .portal-hero h1, .repair-page .portal-hero h1, .track-page .portal-hero h1 { margin-bottom: 10px; }
.warranty-page .portal-hero p:not(.eyebrow), .repair-page .portal-hero p:not(.eyebrow), .track-page .portal-hero p:not(.eyebrow) { line-height: 1.55; }
.portal-hero h1 { font-size: 38px; margin-bottom: 14px; }
.portal-hero p:not(.eyebrow) { color: rgba(235,244,241,.84); line-height: 1.7; max-width: 560px; }
.portal-home .portal-hero p:not(.eyebrow) { color: #4f5b63; font-size: 18px; }
.portal-home .eyebrow { color: var(--brand); }
.portal-contact-card { width: min(100%, 560px); margin: clamp(8px, 2.4vh, 24px) 0 0 clamp(0px, 2vw, 32px); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 16px; background: rgba(255,255,255,.08); box-shadow: 0 18px 48px rgba(0,0,0,.18); display: grid; gap: 10px; }
.portal-contact-card h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.portal-contact-card p { margin: 0; color: rgba(235,244,241,.82); line-height: 1.58; font-size: 14px; }
.portal-contact-card .eyebrow { color: #90d8ce; font-size: 12px; }
.portal-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-contact-actions a { min-height: 38px; padding: 9px 12px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.12); color: #fff; font-weight: 850; text-decoration: none; line-height: 1.2; }
.portal-contact-actions a:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.42); }
.portal-hero-visual { margin: clamp(22px, 5vh, 54px) 0 0; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.34); background: rgba(255,255,255,.06); }
.portal-home .portal-hero-visual { position: absolute; inset: var(--home-header-offset) 0 auto 0; height: var(--home-visual-height); margin: 0; border: 0; border-radius: 0; box-shadow: none; z-index: -1; background: #f7f1e8; }
.portal-hero-visual picture { display: block; width: 100%; }
.portal-hero-visual img { display: block; width: 100%; height: auto; aspect-ratio: 1945 / 808; object-fit: cover; background: #f7f1e8; }
.portal-home .portal-hero-visual img { height: 100%; aspect-ratio: auto; object-position: center right; }
.portal-panel { padding: 34px; overflow: auto; }
.portal-home .portal-panel { position: relative; display: flex; flex-direction: column; justify-content: flex-start; gap: 22px; padding: var(--home-panel-top) clamp(42px, 6vw, 76px) clamp(42px, 6vw, 76px); background: #fff; border-left: 1px solid #e8ded1; }
.portal-home .portal-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(247,244,239,.72), rgba(255,255,255,0) 34%); pointer-events: none; }
.portal-home .portal-panel > * { position: relative; }
.portal-panel-head { min-height: 86px; display: grid; align-content: end; }
.portal-home .portal-panel-head { min-height: auto; align-content: start; }
.portal-panel-head h2 { font-size: 28px; margin: 0; }
.portal-home .portal-panel-head h2 { font-size: clamp(30px, 3vw, 42px); line-height: 1.16; color: var(--graphite); }
.portal-auth, .portal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.otp-verification { display: grid; gap: 10px; padding: 14px; border: 1px solid #d9d8d0; border-radius: 8px; background: #f8f7f2; }
.otp-verification p { margin: 4px 0 0; }
.otp-verification-actions { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto; gap: 10px; align-items: end; }
.otp-verification-actions .field { gap: 5px; }
.portal-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal-note { color: var(--muted); margin-bottom: 18px; }
.portal-form { display: grid; gap: 20px; background: rgba(255,255,255,.94); border: 1px solid rgba(220,227,232,.86); border-radius: 8px; padding: 22px; box-shadow: 0 22px 70px rgba(24, 32, 38, .09); }
.warranty-page .portal-panel, .repair-page .portal-panel { padding: clamp(24px, 2.4vw, 34px); }
.warranty-page .portal-form, .repair-page .portal-form { gap: 14px; padding: 18px; }
.warranty-page .portal-form h2, .repair-page .portal-form h2 { margin: 2px 0 0; }
.warranty-page .form-grid, .repair-page .form-grid { gap: 10px; }
.warranty-page .field, .repair-page .field { gap: 5px; }
.portal-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 16px; align-content: start; }
.portal-service-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.portal-service-grid .portal-entry:nth-child(3) { grid-column: 1 / -1; min-height: 150px; }
.portal-member-zone { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.portal-member-head h2 { font-size: 22px; margin: 0; }
.portal-member-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.portal-entry-wide { grid-column: 1 / -1; min-height: 138px; }
.portal-entry { position: relative; min-height: 216px; border: 1px solid rgba(220,227,232,.9); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 16px 48px rgba(64,58,44,.08); padding: 22px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; overflow: hidden; }
.portal-entry::before { content: "✓"; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, rgba(15,118,110,.15), rgba(216,184,123,.2)); border: 1px solid rgba(15,118,110,.16); box-shadow: inset 0 0 0 10px rgba(255,255,255,.58); display: grid; place-items: center; color: var(--brand); font-size: 22px; font-weight: 900; line-height: 1; }
.portal-entry::after { content: "›"; position: absolute; right: 20px; bottom: 18px; color: var(--brand); font-size: 30px; line-height: 1; opacity: .72; }
.portal-entry:nth-child(2)::before { content: "↻"; background: linear-gradient(135deg, rgba(216,184,123,.22), rgba(15,118,110,.12)); color: #9b6f1f; }
.portal-entry:nth-child(3)::before { content: "⌕"; background: linear-gradient(135deg, rgba(217,200,233,.42), rgba(15,118,110,.1)); color: #6a5784; }
.portal-entry:nth-child(4)::before { content: "★"; background: linear-gradient(135deg, rgba(43,48,54,.14), rgba(216,184,123,.2)); color: #8a6a2b; }
.portal-entry:hover { transform: translateY(-3px); border-color: rgba(15,118,110,.35); background: #fff; box-shadow: 0 24px 58px rgba(24, 32, 38, .13); }
.portal-entry h2 { font-size: 25px; margin: 18px 0 8px; }
.portal-entry p { color: var(--muted); line-height: 1.7; margin: 0; }
.warranty-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.warranty-summary article { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafb; }
.warranty-summary strong, .warranty-summary span { display: block; }
.warranty-summary span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.portal-scope { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.portal-scope label, .consent-line { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.consent-line input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; flex: 0 0 18px; accent-color: var(--brand); }
.consent-line span { min-width: 0; line-height: 1.45; }
.field.consent-line { min-height: 28px; }
.privacy-consent-block { display: grid; gap: 12px; border: 1px solid rgba(11,128,111,.22); background: rgba(241,250,248,.72); border-radius: 8px; padding: 16px; }
.privacy-consent-line, .marketing-consent-line { align-items: flex-start; font-weight: 760; color: var(--ink); }
.marketing-consent-line { color: var(--muted); font-weight: 680; }
.privacy-link { color: var(--brand); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.service-notice-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.series-custom-input { margin-top: 8px; }
.loaner-terms { background: #f8fafb; display: grid; gap: 8px; padding: 12px 14px 14px; }
.loaner-terms legend { padding: 0 6px; color: var(--ink); font-size: 15px; }
.loaner-terms .meta { margin: 0; line-height: 1.7; }
.loaner-terms .consent-line { padding-top: 6px; }
.shipping-notice { background: #fffaf2; border-color: #f0cf9c; display: grid; gap: 12px; padding: 14px; }
.shipping-notice legend { padding: 0 6px; color: var(--warn); font-size: 15px; font-weight: 850; }
.shipping-notice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shipping-notice article { min-width: 0; border: 1px solid #f4ddb9; border-radius: 8px; background: #fff; padding: 12px; }
.shipping-notice h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.shipping-notice p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.shipping-notice p:last-child { margin-bottom: 0; }
.shipping-notice .consent-line { padding-top: 2px; align-items: flex-start; }
.shipping-notice .consent-line span { color: var(--ink); font-weight: 780; }
.portal-result { min-height: 40px; display: inline-flex; align-items: center; color: var(--brand); font-weight: 760; }
.portal-result:not(:empty) { display: inline-grid; gap: 8px; align-items: start; line-height: 1.55; }
.portal-result.is-error { color: #b42318; }
.portal-result .result-action { width: fit-content; margin-top: 2px; }
.portal-page-visual { width: min(100%, 620px); margin-top: clamp(24px, 6vh, 52px); border-color: rgba(255,255,255,.28); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.portal-page-visual img { aspect-ratio: 1945 / 808; object-fit: cover; }
.warranty-promo-card { display: grid; text-decoration: none; color: #fff; position: relative; overflow: visible; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.warranty-promo-card:hover, .warranty-promo-card:focus-visible { transform: translateY(-2px); border-color: rgba(247, 206, 112, .7); box-shadow: 0 30px 86px rgba(0,0,0,.38); outline: none; }
.warranty-promo-card img { width: 100%; aspect-ratio: 1792 / 1017; object-fit: cover; border-radius: 8px 8px 0 0; }
.warranty-promo-card span { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 16px; background: linear-gradient(135deg, #f6d67b, #9d641f); color: #15100a; font-weight: 900; box-shadow: 0 -1px 0 rgba(255,255,255,.18) inset; }
.repair-info-card img { aspect-ratio: 1945 / 808; object-fit: cover; }
.structured-address { border: 0; padding: 0; margin: 0; }
.structured-address legend { color: var(--muted); font-size: 13px; font-weight: 740; padding: 0 0 6px; }
.address-grid { grid-template-columns: 1fr 1fr 140px; }
.address-grid .field.full { grid-column: 1 / -1; }
.tracking-form { margin-bottom: 16px; }
.tracking-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 16px; }
.tracking-card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.tracking-card-head h2 { margin: 0 0 4px; font-size: 28px; }
.tracking-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tracking-summary article { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; }
.tracking-summary span, .tracking-summary strong { display: block; }
.tracking-summary span { color: var(--muted); font-size: 12px; font-weight: 740; }
.tracking-summary strong { margin-top: 4px; overflow-wrap: anywhere; }
.tracking-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; }
.timeline-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 2px solid #b8c5cc; background: #fff; }
.timeline-item.is-done { background: #eef6f5; border-color: #b8dcd8; }
.timeline-item.is-done .timeline-dot { background: var(--brand); border-color: var(--brand); }
.timeline-item strong, .timeline-item span { display: block; }
.timeline-item span { margin-top: 2px; color: var(--muted); font-size: 13px; }
.tracking-note { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; padding: 12px; }
.tracking-note p { margin: 5px 0 0; color: var(--muted); line-height: 1.7; }
.rma-next-action { background: #fff; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.rma-next-action.is-overdue { border-color: #f0cf9c; background: #fffaf2; }
.rma-next-action p { margin: 6px 0 0; line-height: 1.6; }
.next-action-flags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.next-action-flags span { border-radius: 999px; background: #eef6f5; color: var(--brand); padding: 5px 9px; font-size: 12px; font-weight: 760; }
.deseno-official-footer { background: #f7f4ef; color: #4a463f; border-top: 1px solid #d8d0c5; }
.fraud-strip { min-height: 64px; padding: 12px clamp(22px, 5vw, 52px); background: #b91616; color: #fff; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 16px; text-align: left; font-weight: 760; letter-spacing: 0; }
.fraud-strip-text { display: grid; gap: 3px; min-width: 0; }
.fraud-strip-text strong { display: block; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.12; letter-spacing: .02em; }
.fraud-strip-text small { display: block; color: rgba(255,255,255,.84); font-size: clamp(12px, 1.1vw, 14px); line-height: 1.35; font-weight: 650; }
.fraud-strip-icon { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #b91616; display: inline-grid; place-items: center; font-size: 17px; line-height: 1; flex: 0 0 auto; padding-left: 2px; }
.official-footer-main { max-width: 1180px; margin: 0 auto; padding: 34px 28px 30px; display: grid; grid-template-columns: minmax(170px, .75fr) minmax(260px, 1fr) minmax(360px, 1.35fr) auto; gap: 26px; align-items: start; }
.official-footer-main h3 { margin: 0 0 12px; font-size: 15px; color: #2f2b25; }
.official-footer-main nav:not(.official-social) { display: flex; gap: 15px; flex-wrap: wrap; }
.official-footer-main a { color: #4a463f; text-decoration: none; font-size: 14px; }
.official-footer-main a:hover, .official-copy a:hover { color: var(--brand); }
.official-contact p { margin: 0; line-height: 1.7; font-size: 14px; }
.official-social { display: grid; grid-template-columns: repeat(4, 38px); gap: 14px; justify-content: flex-end; align-items: center; }
.official-social a { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 850; font-size: 12px; box-shadow: 0 8px 18px rgba(64,58,44,.12); transition: transform .18s ease, box-shadow .18s ease; }
.official-social a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,35,35,.18); color: #fff; }
.official-social a:nth-child(1) { background: #1877f2; }
.official-social a:nth-child(2) { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 45%, #8134af 75%, #515bd4 100%); }
.official-social a:nth-child(3) { background: #06c755; }
.official-social a:nth-child(4) { background: #ff0000; }
.official-copy { border-top: 1px solid #bfb7aa; padding: 18px 28px 22px; text-align: center; font-size: 14px; font-weight: 680; }
.official-copy a { color: #27a9e0; text-decoration: none; }
.report-sheet .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.traffic-panel { display: grid; gap: 14px; margin-bottom: 14px; }
.traffic-control-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.traffic-control-bar h2 { margin: 0 0 4px; }
.traffic-controls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-field { min-width: 180px; margin: 0; }
.traffic-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.traffic-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 7px; }
.traffic-card span, .traffic-card small { color: var(--muted); font-size: 13px; }
.traffic-card strong { font-size: 24px; overflow-wrap: anywhere; }
.traffic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.traffic-table-wrap { width: 100%; overflow-x: auto; }
.traffic-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.traffic-table th, .traffic-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.traffic-table th { color: var(--muted); font-size: 12px; background: #f4f7f8; }
.framework-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.framework-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 10px; }
.framework-card h3 { margin: 0; font-size: 18px; }
.framework-card ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.sop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sop-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.sop-card h3 { margin: 8px 0 0; font-size: 18px; }
.sop-card strong { display: block; margin-bottom: 4px; color: var(--ink); }
.sop-card p { margin: 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.source-chip { width: fit-content; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--brand); background: #eef6f5; font-size: 12px; font-weight: 760; }
.muted-chip { color: var(--muted); background: #f4f7f8; }
.subsection-title { margin: 18px 0 10px; }
.settings-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; display: grid; gap: 14px; }
.settings-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.settings-head h3 { margin: 0 0 4px; font-size: 18px; }
.catalog-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.catalog-summary > div { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; display: grid; gap: 5px; min-width: 0; }
.catalog-summary span { color: var(--muted); font-size: 13px; }
.catalog-summary strong { font-size: 22px; overflow-wrap: anywhere; }
.catalog-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.catalog-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.catalog-table th, .catalog-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.catalog-table th { background: #f4f7f8; color: var(--muted); font-size: 12px; white-space: nowrap; }
.catalog-table tr:last-child td { border-bottom: 0; }
.catalog-table td { font-size: 14px; }
.catalog-product-name { min-width: 220px; white-space: normal; overflow-wrap: anywhere; }
.catalog-series-list { display: grid; gap: 10px; max-height: 430px; overflow: auto; padding-right: 2px; }
.catalog-series-card { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; display: grid; gap: 10px; }
.catalog-series-card h4 { margin: 7px 0 4px; font-size: 17px; overflow-wrap: anywhere; }
.catalog-series-card p { margin: 0; }
.catalog-series-tags { display: grid; gap: 6px; }
.catalog-series-tags span { display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.settings-table { display: grid; gap: 10px; }
.settings-row { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.4fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; }
.settings-row strong, .settings-row span { display: block; }
.account-row { grid-template-columns: minmax(190px, .9fr) minmax(220px, 1fr) auto; }
.audit-list { display: grid; gap: 8px; }
.audit-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(180px, .8fr) minmax(260px, 1.4fr); gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; align-items: start; }
.audit-row strong, .audit-row span { display: block; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; }
.portal-setting-preview { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; }
.portal-setting-preview img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.portal-setting-preview strong, .portal-setting-preview span { display: block; }
.modal-hero-preview { width: 100%; max-height: 280px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.media-manager { gap: 12px; }
.media-manager-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.media-manager-head h3 { margin-bottom: 3px; }
.media-upload-button input { display: none; }
.media-preview-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; align-items: center; }
.media-preview-row img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.media-preview-row span { overflow-wrap: anywhere; }
.media-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-height: 340px; overflow: auto; padding-right: 2px; }
.media-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; overflow: hidden; }
.media-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 118, 110, .16); }
.media-card.is-broken img { background: repeating-linear-gradient(45deg, #f8fafb, #f8fafb 8px, #eef3f4 8px, #eef3f4 16px); }
.media-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #f8fafb; }
.media-card-body { padding: 10px; display: grid; gap: 7px; }
.media-card-body strong, .media-card-body span { display: block; overflow-wrap: anywhere; }
.media-card-body span, .media-empty { color: var(--muted); font-size: 12px; }
.profile-card { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 14px; display: grid; gap: 10px; }
.profile-card-clickable { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.profile-card-clickable:hover, .profile-card-clickable:focus-visible { transform: translateY(-2px); border-color: #9ccbc5; box-shadow: 0 18px 44px rgba(24, 32, 38, .1); outline: none; }
.profile-edit-hint { color: var(--brand); font-size: 12px; font-weight: 780; }
.profile-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.profile-card h3 { margin: 8px 0 0; font-size: 20px; }
.profile-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-facts span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--muted); font-size: 13px; }
.repeat-editor { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; display: grid; gap: 10px; }
.repeat-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.repeat-head span { color: var(--muted); font-size: 13px; font-weight: 740; }
.repeat-rows { display: grid; gap: 8px; }
.repeat-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.repeat-row .repeat-value { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 10px; width: 100%; }
.repeat-delete { color: var(--danger); }
.audience-builder { margin-bottom: 16px; }
.audience-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.audience-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.audience-head h3 { margin: 0 0 4px; font-size: 18px; }
.audience-stats { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 10px; }
.audience-stats article { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; }
.audience-stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 740; }
.audience-stats strong { display: block; margin-top: 4px; font-size: 24px; }
.audience-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; }
.active-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 28px; }
.analysis-row { display: grid; grid-template-columns: minmax(110px, 1fr) 44px minmax(100px, 1.6fr); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.analysis-row:last-child { border-bottom: 0; }
.bar-track { height: 8px; border-radius: 999px; background: #e7eeee; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.policy-preview { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 14px; display: grid; gap: 8px; }
.policy-preview div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.policy-preview span, .policy-preview p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.product-preview { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 14px; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: center; }
.product-preview-image { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.product-preview-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-preview h3 { margin: 8px 0 6px; font-size: 22px; overflow-wrap: anywhere; }
.fault-upload-section { display: grid; gap: 10px; }
.upload-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fault-upload-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fault-upload-row { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.fault-upload-row > span { color: var(--muted); font-size: 13px; font-weight: 760; }
.fault-upload-row input[type="file"] { width: 100%; min-height: 42px; padding: 8px; background: #fff; }
.fault-upload-preview { min-height: 132px; border: 1px dashed #cddae2; border-radius: 8px; background: #fff; color: var(--muted); display: grid; place-items: center; gap: 6px; padding: 8px; text-align: center; overflow: hidden; }
.fault-upload-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: #eef3f4; }
.fault-upload-preview span { display: block; width: 100%; color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.warranty-upgrade-box { grid-column: 1 / -1; border: 1px solid #b8dcd8; border-radius: 8px; background: #eef6f5; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.warranty-upgrade-box[hidden] { display: none; }
.warranty-upgrade-box p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.warranty-upgrade-box .field { grid-column: 1 / -1; }
.warranty-upgrade-box .button { align-self: start; white-space: nowrap; }
.modal-extra { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; display: grid; gap: 10px; }
.modal-extra h3 { margin: 0; font-size: 16px; }
.rma-editor { grid-column: 1 / -1; width: 100%; min-width: 0; display: grid; gap: 12px; }
#form-fields > .rma-form-section,
.rma-editor > .rma-form-section,
.rma-form-section { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 13px; display: grid; gap: 12px; }
.rma-customer-section { background: #fff7ed; border-color: #f0cf9c; }
.rma-request-section { background: #f4f8fb; border-color: #c8d8e3; }
.rma-service-section { background: #eef6f5; border-color: #b8dcd8; }
.rma-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.rma-section-head h3 { margin: 0; font-size: 16px; }
.rma-section-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 620px; }
.rma-section-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; align-items: start; }
.rma-section-grid .field { gap: 4px; }
.rma-section-grid .field.is-wide { grid-column: span 2; }
.rma-section-grid .field.full { grid-column: 1 / -1; }
.rma-section-grid .field span { font-size: 12px; }
.rma-section-grid input, .rma-section-grid select, .rma-section-grid textarea { min-height: 38px; padding: 8px 10px; }
.rma-section-grid .field.is-compact input, .rma-section-grid .field.is-compact select { min-height: 34px; padding: 6px 9px; font-size: 14px; }
.rma-section-grid textarea { min-height: 72px; resize: vertical; }
.relation-back-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: #eef6f5; border-color: #b8dcd8; }
.relation-back-panel strong { display: block; overflow-wrap: anywhere; }
.case-registration-panel { background: #fff; }
.case-registration-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.case-registration-head p { margin: 5px 0 0; }
.case-history-list { display: grid; gap: 8px; }
.case-history-item { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px; display: grid; gap: 4px; }
.case-history-item strong, .case-history-item span, .case-history-item small { overflow-wrap: anywhere; }
.case-history-item span, .case-history-item small { color: var(--muted); }
.customer-history { background: #fbfcfd; }
.customer-history-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.customer-history-head h3 { margin: 0 0 4px; }
.customer-history-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-history-stats span { border-radius: 999px; background: #eef6f5; color: var(--brand); padding: 5px 10px; font-size: 12px; font-weight: 760; }
.customer-insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.customer-insight-grid article { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; display: grid; gap: 4px; }
.customer-insight-grid span, .customer-insight-grid small { color: var(--muted); font-size: 12px; }
.customer-insight-grid strong { font-size: 16px; overflow-wrap: anywhere; }
.history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.history-panel { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; display: grid; gap: 8px; align-content: start; }
.history-panel h4 { margin: 0; font-size: 14px; }
.history-row { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 9px; text-align: left; cursor: pointer; }
.history-row:hover { border-color: #9ccbc5; background: #eef6f5; }
.history-row strong, .history-row span { display: block; overflow-wrap: anywhere; }
.history-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 10px; }
.attachment-card { min-height: 150px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; display: grid; gap: 7px; align-content: start; text-decoration: none; color: inherit; }
.attachment-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eef3f4; }
.attachment-card strong { overflow-wrap: anywhere; font-size: 13px; }
.attachment-card span { color: var(--muted); font-size: 12px; }
.file-icon { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; background: #eef6f5; color: var(--brand); display: grid; place-items: center; font-weight: 850; }
.service-photo-panel { background: #fff; }
.service-photo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.service-photo-head h3 { margin: 0 0 4px; }
.compact-summary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.service-photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.service-photo-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; display: grid; gap: 7px; align-content: start; min-width: 0; text-decoration: none; color: inherit; }
.service-photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eef3f4; border: 1px solid var(--line); }
.service-photo-card strong, .service-photo-card span { display: block; overflow-wrap: anywhere; }
.service-photo-card span { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.service-photo-card.is-link:hover, .service-photo-card.is-link:focus-visible { border-color: #9ccbc5; background: #f8fafb; outline: none; }
.inline-preview-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(14, 24, 29, .58); display: grid; place-items: center; padding: 18px; }
.inline-preview-window { width: min(900px, 100%); max-height: min(90dvh, 900px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.inline-preview-window > header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.inline-preview-window > header h2 { margin: 0; font-size: 18px; }
.tracking-preview-card { padding: 16px; display: grid; gap: 12px; }
.customer-visible-block { border: 1px solid #b8dcd8; border-radius: 8px; background: #f8fcfb; padding: 12px; display: grid; gap: 10px; }
.customer-visible-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.customer-visible-head strong { font-size: 16px; }
.customer-visible-head p { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }
.payment-invoice-form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; display: grid; gap: 12px; }
.payment-invoice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payment-invoice-grid .field.full { grid-column: 1 / -1; }
.payment-invoice-form .portal-actions { align-items: center; }
.collection-section { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.collection-record-list { display: grid; gap: 14px; }
.collection-record-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.76); }
.collection-record-card .tracking-card-head { margin-top: 0; }
.collection-record-card .customer-visible-block { margin-top: 0; }
.collection-result-head { margin-bottom: 4px; }
.invoice-notice { display: block; margin-top: 6px; color: #8a5b12; background: #fff8e8; border: 1px solid #f0d59b; border-radius: 8px; padding: 8px 10px; line-height: 1.55; }
.quote-preview-list { display: grid; gap: 8px; }
.quote-preview-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, .8fr); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px 10px; }
.quote-preview-row span, .quote-preview-row small { overflow-wrap: anywhere; }
.quote-preview-row small { color: var(--muted); }
.quote-preview-total { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; font-weight: 850; }
.quote-preview-total strong { color: var(--brand); font-size: 20px; }
.loyalty-record-section { background: #fff; border-color: var(--line); }
.loyalty-record-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.loyalty-record-card { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 12px; display: grid; gap: 5px; min-width: 0; }
.loyalty-record-card strong, .loyalty-record-card span, .loyalty-record-card small { overflow-wrap: anywhere; }
.loyalty-record-card span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.loyalty-record-card small { color: #7b8a94; font-size: 12px; line-height: 1.45; }
.modal-product-image { width: min(320px, 100%); aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.finance-dashboard { display: grid; gap: 16px; }
.finance-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.finance-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 7px; color: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.finance-card:hover, .finance-card:focus-visible { transform: translateY(-2px); border-color: #9ccbc5; box-shadow: 0 18px 44px rgba(24, 32, 38, .1); outline: none; }
.finance-card span, .finance-card small { color: var(--muted); font-size: 13px; }
.finance-card strong { font-size: 24px; overflow-wrap: anywhere; }
.finance-card em { color: var(--brand); font-size: 12px; font-style: normal; font-weight: 760; }
.finance-detail-modal { display: grid; gap: 12px; }
.finance-detail-list { display: grid; gap: 10px; max-height: min(62vh, 620px); overflow: auto; padding-right: 4px; }
.finance-detail-row { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; color: inherit; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(140px, .7fr) minmax(160px, .8fr); gap: 12px; text-align: left; cursor: pointer; align-items: start; }
.finance-detail-row:hover, .finance-detail-row:focus-visible { border-color: #9ccbc5; background: #f8fafb; outline: none; }
.finance-detail-money { display: grid; gap: 3px; justify-items: end; color: var(--muted); font-size: 13px; }
.finance-detail-money strong { color: var(--ink); font-size: 16px; }
.finance-rank-panel { display: grid; gap: 12px; }
.finance-rank-list { display: grid; gap: 8px; }
.finance-rank-row { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; color: inherit; display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, auto); gap: 12px; text-align: left; align-items: center; cursor: pointer; }
.finance-rank-row:hover, .finance-rank-row:focus-visible { border-color: #9ccbc5; background: #f8fafb; outline: none; }
.finance-rank-row strong, .finance-rank-row span { display: block; overflow-wrap: anywhere; }
.finance-rank-row > div:last-child { text-align: right; }
.finance-editor { background: #fbfcfd; }
.finance-editor-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.finance-editor-head h3 { margin: 0 0 4px; }
.invoice-editor-block { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: grid; gap: 12px; }
.finance-table-wrap { width: 100%; overflow-x: auto; padding-bottom: 4px; }
.finance-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.finance-table th, .finance-table td { border-bottom: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; }
.finance-table th { color: var(--muted); font-size: 12px; background: #f4f7f8; }

/* AI OP visual system alignment */
.main {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
}
.topbar {
  border: 1px solid rgba(221,215,202,.78);
  border-top: 4px solid rgba(179,147,99,.72);
  border-radius: 8px;
  background: rgba(255,253,248,.72);
  box-shadow: 0 18px 50px rgba(43,36,24,.08);
  padding: 16px;
}
.heading-row h1,
.portal-hero h1,
.portal-panel-head h2,
.panel h2,
.report-card h2,
.settings-panel h2,
.settings-panel h3 {
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-weight: 760;
}
.heading-row::before {
  content: "";
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--champagne));
}
.eyebrow,
.mini-card-kicker,
.source-chip,
.finance-card em,
.stat small,
.portal-entry-tag {
  color: #28654f;
}
.panel,
.record-list,
.settings-panel,
.audience-panel,
.finance-card,
.traffic-card,
.framework-card,
.sop-card,
.tracking-card,
.portal-form,
.portal-entry,
.modal-extra,
.rma-form-section,
.profile-card,
.catalog-series-card,
.warranty-summary article,
.tracking-summary article,
.dashboard-mini-metric,
.dashboard-alert,
.dashboard-insight-card,
.progress-item {
  background: linear-gradient(180deg, rgba(255,253,248,.98), rgba(255,250,240,.94));
  border-color: rgba(221,215,202,.92);
}
.panel,
.record-list,
.settings-panel,
.audience-panel,
.tracking-card {
  border-top: 3px solid rgba(179,147,99,.58);
}
.stat {
  background: linear-gradient(140deg, rgba(255,253,248,.98), rgba(248,243,232,.94));
  border-color: rgba(221,215,202,.94);
}
.record,
.stage,
.stage-card,
.mini-card,
.rma-kpi-row,
.catalog-table-wrap,
.finance-table-wrap,
.traffic-table-wrap,
.policy-preview,
.product-preview,
.history-panel,
.customer-insight-grid article,
.attachment-card,
.service-photo-card,
.loyalty-record-card,
.quote-preview-row,
.customer-visible-block,
.invoice-notice {
  background: rgba(255,253,248,.92);
  border-color: rgba(221,215,202,.92);
}
.record-button:hover,
.finance-detail-row:hover,
.finance-rank-row:hover,
.history-row:hover,
.dashboard-alert:hover,
.service-photo-card.is-link:hover {
  border-color: rgba(179,147,99,.78);
  background: rgba(249,244,232,.96);
}
.traffic-table th,
.catalog-table th,
.finance-table th {
  background: #e7dfd2;
  color: #3d473f;
  border-bottom-color: #d5cbbd;
}
.traffic-table td,
.catalog-table td,
.finance-table td,
.record {
  border-bottom-color: rgba(213,203,189,.85);
}
.badge,
.stage-card-tags em,
.customer-history-stats span,
.next-action-flags span,
.source-chip {
  background: #edf2ea;
  color: #28654f;
  border: 1px solid rgba(77,111,91,.16);
}
.badge.warn,
.stage-card-tags em.warn {
  background: #fff6e2;
  color: #8b6429;
  border-color: rgba(179,147,99,.32);
}
.bar-track {
  background: #ded8ca;
}
.bar-fill {
  background: linear-gradient(90deg, var(--brand), var(--champagne));
}
.modal::backdrop,
.inline-preview-overlay {
  background: rgba(14, 24, 19, .62);
}
.modal-header,
.inline-preview-window > header,
.modal-actions {
  background: rgba(255,253,248,.98);
  border-color: rgba(221,215,202,.95);
}
.login-page,
.portal-page {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(135deg, #f4efe6, #e9e3d7);
  background-size: 58px 58px, 58px 58px, auto;
}
.login-card {
  background: rgba(255,253,248,.98);
  border: 1px solid rgba(221,215,202,.92);
  border-top: 4px solid var(--champagne);
}
.portal-page {
  color: var(--ink);
}
.portal-hero {
  background: linear-gradient(145deg, #1b2b22 0%, #102119 64%, #0a1510 100%);
}
.portal-home,
.portal-home .portal-hero,
.portal-home .portal-panel,
.deseno-official-footer {
  background: var(--paper);
}
.portal-home .portal-panel {
  border-left-color: rgba(221,215,202,.92);
}
.portal-home .portal-hero-header {
  background: rgba(255,253,248,.94);
  border-color: rgba(221,215,202,.92);
  box-shadow: 0 18px 42px rgba(43,36,24,.1);
}
.portal-entry {
  box-shadow: 0 18px 44px rgba(43,36,24,.08);
}
.portal-entry:hover {
  border-color: rgba(179,147,99,.82);
  box-shadow: 0 28px 62px rgba(43,36,24,.13);
}
.portal-entry::before {
  background: linear-gradient(135deg, rgba(36,71,53,.16), rgba(179,147,99,.2));
  border-color: rgba(36,71,53,.18);
  color: var(--brand);
}
.portal-entry:nth-child(2)::before,
.portal-entry:nth-child(4)::before {
  color: #8b6429;
}
.portal-entry::after {
  color: #47765f;
}
.portal-contact-card,
.portal-home-link,
.portal-admin-link {
  border-color: rgba(231,215,184,.28);
  background: rgba(255,253,248,.1);
}
.floating-home-icon {
  background: var(--brand);
  box-shadow: 0 14px 32px rgba(16,27,22,.28);
}
.shipping-notice {
  background: #fff8e8;
  border-color: var(--champagne-soft);
}
.shipping-notice article {
  border-color: rgba(179,147,99,.3);
  background: rgba(255,253,248,.86);
}
.privacy-consent-block,
.warranty-upgrade-box,
.timeline-item.is-done,
.relation-back-panel,
.rma-service-section,
.customer-visible-block {
  background: #eef3ea;
  border-color: rgba(77,111,91,.24);
}
.rma-customer-section {
  background: #fff7e8;
  border-color: rgba(179,147,99,.36);
}
.rma-request-section {
  background: #f6f1e8;
  border-color: rgba(221,215,202,.95);
}
.fraud-strip {
  background: linear-gradient(90deg, #941616, #c01818);
}
.official-copy,
.deseno-official-footer {
  border-color: rgba(191,183,170,.82);
}
.finance-approval-panel,
.invoice-editor-block {
  border-color: rgba(179,147,99,.4);
  background: rgba(255,248,232,.72);
}
.finance-table td input { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: #fff; }
.finance-table td .money-input { text-align: right; }
.finance-table td strong, .finance-table td span { display: block; }
.finance-editor .finance-table th:last-child,
.finance-editor .finance-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 52px;
  min-width: 52px;
  background: #fff;
  text-align: center;
  box-shadow: -8px 0 12px rgba(15, 31, 38, .06);
}
.finance-editor .finance-table th:last-child { background: #f4f7f8; }
.finance-editor .finance-table td:last-child .button { min-width: 36px; padding-inline: 9px; }
.rma-print-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-color: rgba(20, 132, 119, .32);
  background: linear-gradient(135deg, rgba(20, 132, 119, .08), #fff);
}
.rma-print-panel h3 { margin: 4px 0 6px; }
.print-action-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.print-action-grid .button {
  min-width: 156px;
  min-height: 44px;
  font-weight: 800;
}
.finance-approval-panel {
  border-color: rgba(190, 135, 35, .34);
  background: linear-gradient(135deg, rgba(255, 247, 232, .92), #fff);
}
.finance-approval-panel.needs-action { border-color: rgba(211, 47, 47, .28); }
.finance-approval-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.finance-approval-head h3 { margin: 4px 0 6px; }
.finance-approval-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}
.finance-approval-fields .field { gap: 4px; }
.finance-approval-fields .field.is-wide { grid-column: span 2; }
.finance-approval-fields .field span { font-size: 12px; }
.finance-approval-fields input,
.finance-approval-fields select {
  min-height: 38px;
  padding: 8px 10px;
}
.field.field-error input,
.field.field-error select,
.field.field-error textarea {
  border-color: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, .14);
}
.finance-approval-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.finance-approval-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .82);
}
.finance-approval-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}
.finance-approval-metrics strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.finance-approval-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.finance-review-guide {
  border-color: rgba(20, 132, 119, .2);
  background: #f8fcfb;
}
.finance-totals { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.finance-totals article { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; }
.finance-totals span { display: block; color: var(--muted); font-size: 12px; }
.finance-totals strong { display: block; margin-top: 4px; font-size: 18px; }
.finance-records { display: grid; gap: 12px; }
.blog-command-panel { margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.blog-command-panel h3 { margin-bottom: 5px; }
.blog-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.blog-stats span { border-radius: 999px; background: #eef6f5; color: var(--brand); padding: 6px 10px; font-size: 12px; font-weight: 760; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.blog-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; display: grid; }
.blog-card > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #eef3f4; }
.blog-card-body { padding: 14px; display: grid; gap: 10px; }
.blog-card-top, .blog-meta-line { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.blog-card h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.blog-meta-line { color: var(--muted); font-size: 12px; }
.tall-textarea { min-height: 220px; line-height: 1.7; }
.blog-page { background: #eef3f4; }
.blog-public-hero { min-height: 420px; background: var(--deep); color: #fff; padding: 42px min(6vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.blog-public-hero.compact { min-height: auto; padding-bottom: 34px; }
.blog-public-copy { grid-column: 1 / -1; max-width: 980px; align-self: end; padding-top: 74px; }
.blog-public-copy h1 { font-size: 60px; line-height: 1.1; max-width: 900px; margin-bottom: 20px; }
.blog-public-copy h1 span { display: block; }
.blog-hero-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.blog-hero-tags span { border: 1px solid rgba(215, 181, 111, .52); color: #f8f0df; background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 800; }
.blog-public-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.blog-public-shell { max-width: 1180px; margin: 0 auto; padding: 34px 28px 50px; }
.blog-public-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 18px; }
.blog-public-head h2 { margin: 0; font-size: 30px; }
.blog-public-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.blog-public-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.blog-public-card a { color: inherit; text-decoration: none; display: grid; gap: 12px; padding: 14px; min-height: 100%; }
.blog-public-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.blog-public-card h3 { margin: 0; font-size: 20px; line-height: 1.4; }
.blog-public-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.blog-post-layout { max-width: 920px; margin: 0 auto; padding: 34px 28px 54px; }
.blog-post-article { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 18px; }
.blog-post-head h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.18; margin: 14px 0 8px; }
.blog-post-cover { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.blog-post-body { color: #29343b; font-size: 17px; line-height: 1.9; }
.blog-post-body p { margin-bottom: 18px; }
.blog-source-box, .blog-post-cta { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 16px; display: grid; gap: 10px; }
.blog-source-box h3, .blog-post-cta h2 { margin-bottom: 2px; }
.blog-source-box a, .blog-source-box span { color: var(--muted); overflow-wrap: anywhere; }
.blog-post-cta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.blog-post-cta p { margin: 0; color: var(--muted); }
.privacy-page { background: #f5f2ec; }
.privacy-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; display: grid; gap: 18px; }
.privacy-hero, .policy-document { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.privacy-hero { padding: clamp(22px, 4vw, 38px); display: grid; gap: 14px; }
.privacy-brand { align-self: start; text-decoration: none; color: var(--ink); }
.privacy-hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; margin: 0; }
.privacy-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; }
.privacy-meta-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafb; min-width: 0; }
.privacy-meta-grid dt { color: var(--muted); font-size: 13px; font-weight: 850; }
.privacy-meta-grid dd { margin: 5px 0 0; color: var(--ink); font-weight: 800; overflow-wrap: anywhere; }
.policy-document { padding: clamp(20px, 4vw, 36px); color: #263139; font-size: 16px; line-height: 1.86; }
.policy-document h2 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 14px; line-height: 1.2; }
.policy-document h3 { font-size: 22px; margin: 28px 0 10px; }
.policy-document h4 { font-size: 18px; margin: 22px 0 8px; }
.policy-document p, .policy-document ul { margin: 0 0 14px; }
.policy-document ul { padding-left: 1.25em; }
.policy-document a, .privacy-meta-grid a { color: var(--brand); }
@media (max-width: 940px) { .app-shell, .portal-shell, .content-grid, .framework-grid, .sop-grid, .traffic-grid, .portal-entry-grid, .audience-filter-grid, .audience-stats, .profile-grid, .catalog-summary, .finance-totals, .history-grid, .customer-insight-grid, .rma-next-action, .portal-setting-preview, .media-preview-row, .official-footer-main, .blog-public-grid, .blog-post-cta, .tracking-summary, .shipping-notice-grid, .loyalty-record-list, .fault-upload-list { grid-template-columns: 1fr; } .portal-hero { min-height: auto; gap: 28px; padding: 26px; } .portal-home .portal-panel { justify-content: flex-start; } .portal-hero h1 { font-size: 32px; } .portal-hero-visual { margin-top: 6px; } .portal-hero-visual img { aspect-ratio: 900 / 374; } .record, .stats-grid, .kanban, .form-grid, .warranty-summary, .profile-facts, .product-preview, .attachment-grid, .settings-row, .audit-row, .checkbox-grid, .phone-control, .otp-verification-actions { grid-template-columns: 1fr; } .repeat-row { grid-template-columns: minmax(0, 1fr) 40px; } .search { width: 100%; } .official-social, .blog-public-nav, .next-action-flags { justify-content: flex-start; } .fraud-strip { min-height: 56px; padding: 10px 22px; justify-content: space-between; } .blog-command-panel, .blog-public-head { display: grid; } .blog-public-hero { min-height: auto; grid-template-columns: 1fr; padding: 26px; } .blog-public-copy { padding-top: 34px; } .blog-public-copy h1 { font-size: 42px; } .blog-post-layout, .blog-public-shell { padding: 24px 16px 38px; } }
@media (min-width: 721px) and (max-width: 940px) {
  .portal-home .portal-hero { --home-header-offset: 108px; --home-visual-height: 340px; }
  .portal-home .portal-hero-copy { margin-top: calc(var(--home-visual-height) + 34px); }
  .portal-contact-card { margin-top: 4px; padding: 14px; }
  .portal-contact-actions a { flex: 1 1 180px; }
}
@media (max-width: 1280px) {
  .dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "insights" "flow" "queue" "finance" "operations" "alerts" "progress"; }
  .dashboard-kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-alert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1500px) and (min-width: 941px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .search { width: min(420px, 40vw); }
}
@media (max-width: 940px) {
  .app-shell {
    display: block;
    position: relative;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, calc(100vw - 56px));
    max-width: 320px;
    transform: translateX(-100%);
    z-index: 80;
    box-shadow: 0 0 24px rgba(0,0,0,.32);
    border-right: 1px solid rgba(255,255,255,.08);
    overflow-y: auto;
    transition: transform .22s ease;
  }
  body.admin-sidebar-open .sidebar { transform: translateX(0); }
  body.admin-sidebar-open .admin-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .admin-menu-toggle { display: inline-flex; min-height: 36px; padding: 0 12px; }
  .sidebar-close { display: inline-flex; }
  .main { padding: 18px; }
  .topbar { grid-template-columns: 1fr; }
  .topbar-actions { justify-content: flex-start; width: 100%; }
  .portal-page-title { margin: 8px 0 0; }
  .portal-contact-card { margin: 0; width: 100%; }
  .topbar-actions .button, .topbar-actions .file-label { flex: 1 1 140px; }
  .topbar-actions { overflow-x: auto; padding-bottom: 2px; }
  .heading-row { flex-wrap: nowrap; }
  .heading-row h1 { font-size: clamp(23px, 7vw, 28px); }
  .search { width: 100%; }
  .portal-home .portal-panel { padding-top: 26px; }
  .portal-panel-head { min-height: auto; align-content: start; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-mini-metrics, .dashboard-alert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .sidebar { padding: 16px; gap: 16px; width: min(292px, calc(100vw - 34px)); max-width: 320px; }
  .privacy-shell { width: min(100% - 20px, 760px); padding: 16px 0 34px; }
  .privacy-meta-grid { grid-template-columns: 1fr; }
  .privacy-hero, .policy-document { padding: 18px; }
  .nav-list { grid-template-columns: 1fr; }
  .nav-item { min-height: 38px; padding: 8px 10px; font-size: 14px; }
  .nav-group { grid-column: 1 / -1; }
  .nav-group-title { grid-column: 1 / -1; }
  .nav-subitem { padding-left: 10px; }
  .main { padding: 14px; }
  .heading-row { flex-wrap: wrap; }
  h1 { font-size: 26px; }
  .dashboard-stats, .dashboard-kanban, .dashboard-mini-metrics, .dashboard-alert-list, .dashboard-insight-grid, .dashboard-operation-grid { grid-template-columns: 1fr; }
  .dashboard-stats .stat { min-height: auto; }
  .finance-detail-row { grid-template-columns: 1fr; }
  .finance-detail-money { justify-items: start; }
  .finance-rank-row { grid-template-columns: 1fr; }
  .finance-rank-row > div:last-child { text-align: left; }
  .payment-invoice-grid { grid-template-columns: 1fr; }
  .dashboard-panel { padding: 12px; }
  .shipping-notice { padding: 12px; }
  .version-pill { font-size: 11px; }
}
@media (max-width: 720px) {
  .portal-hero, .blog-public-hero { overflow-x: hidden; }
  .portal-home .portal-hero { --home-header-offset: 126px; --home-visual-height: 230px; gap: 14px; padding: 18px 18px 28px; }
  .portal-home .portal-hero h1 { font-size: clamp(25px, 6.4vw, 28px); line-height: 1.16; margin-bottom: 10px; }
  .portal-title-line { white-space: nowrap; }
  .portal-home .portal-hero-copy { margin-top: calc(var(--home-visual-height) + 14px); }
  .deseno-wordmark { min-width: 108px; height: 38px; font-size: 17px; padding-inline: 12px; }
  .portal-hero-header { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .portal-home .portal-hero-header { display: grid; grid-template-columns: 1fr; align-items: start; padding: 10px; background: rgba(255,255,255,.97); }
  .portal-brand { align-items: flex-start; flex-wrap: nowrap; width: 100%; min-width: 0; }
  .portal-brand > div:last-child { flex: 1 1 170px; min-width: 0; }
  .portal-brand strong, .portal-brand span { overflow-wrap: anywhere; }
  .portal-header-meta { width: 100%; justify-content: space-between; margin-left: 0; }
  .portal-top-actions, .blog-public-nav { width: auto; justify-content: flex-start; }
  .portal-home #portal-version-pill { width: fit-content; max-width: calc(100% - 84px); margin-top: 0; }
  .portal-language-actions .language-switcher { width: 74px; min-height: 38px; padding: 7px 8px; font-size: 14px; }
  .portal-page-title h1, .blog-public-copy h1 { max-width: 100%; overflow-wrap: anywhere; }
  .portal-contact-card { padding: 12px; gap: 8px; }
  .portal-contact-card h2 { font-size: 18px; }
  .portal-contact-card p { font-size: 13px; line-height: 1.48; }
  .portal-contact-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .portal-contact-actions a { min-height: 42px; width: 100%; }
  .portal-hero-visual { margin-top: 8px; }
  .portal-home .portal-panel { padding: 24px 18px; gap: 14px; }
  .portal-panel-head h2 { font-size: 26px; }
  .portal-entry-grid { gap: 12px; }
  .portal-entry { min-height: 150px; padding: 16px 18px; justify-content: flex-start; gap: 14px; }
  .portal-entry h2 { font-size: 23px; margin: 4px 0 2px; }
  .portal-entry p { font-size: 15px; line-height: 1.55; }
  .source-chip { padding: 3px 8px; font-size: 11px; }
  .portal-home-link { min-height: 44px; padding: 10px 12px; }
  .floating-home-icon { left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .blog-public-copy h1 { font-size: 34px; }
  .blog-hero-tags span { font-size: 13px; padding: 7px 10px; }
  .official-social { grid-template-columns: repeat(4, 42px); gap: 12px; justify-content: flex-start; }
  .official-social a { width: 42px; height: 42px; font-size: 12px; }
  .fraud-strip { min-height: 54px; padding: 10px 18px; gap: 12px; }
  .fraud-strip-text strong { font-size: 18px; line-height: 1.12; }
  .fraud-strip-text small { font-size: 12px; line-height: 1.25; }
  .fraud-strip-icon { width: 32px; height: 32px; font-size: 15px; }
  .official-footer-main { padding: 28px 22px 26px; gap: 24px; }
  .official-footer-main h3 { font-size: 18px; margin-bottom: 10px; }
  .official-footer-main nav:not(.official-social) { gap: 12px 16px; }
  .official-footer-main a { font-size: 15px; }
  .official-contact p { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
  .official-copy { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); font-size: 12px; line-height: 1.5; }
}
.registered-assets-box { margin: 14px 0 20px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 14px; }
.registered-assets-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.registered-assets-head p { margin: 7px 0 0; line-height: 1.55; }
.registered-assets-result { margin-top: 12px; }
.registered-assets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.registered-asset-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; padding: 12px; text-align: left; cursor: pointer; display: grid; gap: 7px; min-height: 96px; }
.registered-asset-card:hover, .registered-asset-card.is-selected { border-color: #0f766e; background: #f1faf8; box-shadow: 0 12px 26px rgba(15,118,110,.09); }
.registered-asset-card strong { line-height: 1.35; overflow-wrap: break-word; }
.registered-asset-card span { color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: break-word; }
.proof-upload-field[hidden] { display: none !important; }
@media (max-width: 1280px) {
  .dashboard-stats,
  .dashboard-kanban,
  .dashboard-mini-metrics,
  .dashboard-alert-list,
  .dashboard-progress-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 36vw);
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    padding: 2px 2px 10px;
  }
  .dashboard-stats.is-dragging,
  .dashboard-kanban.is-dragging,
  .dashboard-mini-metrics.is-dragging,
  .dashboard-alert-list.is-dragging,
  .dashboard-progress-list.is-dragging {
    cursor: grabbing;
    user-select: none;
  }
  .dashboard-stats > *,
  .dashboard-kanban > *,
  .dashboard-mini-metrics > *,
  .dashboard-alert-list > *,
  .dashboard-progress-list > * {
    min-width: 0;
    scroll-snap-align: start;
  }
  .dashboard-stats .stat,
  .stage,
  .dashboard-mini-metric,
  .dashboard-alert {
    min-height: 118px;
  }
  .dashboard-stats .stat strong,
  .stage-card strong,
  .mini-card strong,
  .dashboard-mini-metric strong,
  .dashboard-alert strong,
  .progress-item strong {
    overflow-wrap: break-word;
    word-break: normal;
  }
}
@media (max-width: 720px) {
  .dashboard-stats,
  .dashboard-kanban,
  .dashboard-mini-metrics,
  .dashboard-alert-list,
  .dashboard-progress-list {
    grid-auto-columns: minmax(244px, 84vw);
  }
  .registered-assets-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(238px, 86vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }
  .registered-asset-card { scroll-snap-align: start; }
}
@media (max-width: 1180px) {
  .main { padding: 18px; }
  .topbar { grid-template-columns: 1fr; gap: 12px; }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(128px, max-content);
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 8px;
    -webkit-overflow-scrolling: touch;
  }
  .topbar-actions .search { min-width: min(420px, 64vw); width: 100%; }
  .topbar-actions .button,
  .topbar-actions .file-label,
  .topbar-actions .language-switcher { width: 100%; }
  .record {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    align-items: start;
  }
  .record > div:nth-child(3) { grid-column: 1 / -1; }
  .record-action { align-self: center; }
  .content-grid { grid-template-columns: 1fr; }
  .modal { width: min(860px, calc(100vw - 24px)); }
  .modal form { max-height: calc(100dvh - 24px); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 1180px) {
  .app-shell { grid-template-columns: 86px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; gap: 18px; }
  .sidebar .brand { justify-content: center; }
  .sidebar .brand > div:last-child,
  .nav-group-title { display: none; }
  .nav-item { min-height: 48px; padding: 9px 8px; text-align: center; font-size: 12px; line-height: 1.25; }
  .nav-subitem { padding-left: 8px; }
  .nav-group { padding: 5px; }
  .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "insights" "flow" "queue" "finance" "operations" "alerts" "progress"; }
  .record-list { padding: 12px; }
}
@media (max-width: 720px) {
  body {
    background:
      linear-gradient(var(--grid-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
      linear-gradient(135deg, #f6f2e9, #ece8df);
    background-size: 42px 42px, 42px 42px, auto;
  }
  .main { padding: 12px; }
  .topbar { position: sticky; top: 0; z-index: 55; margin: -12px -12px 12px; padding: 12px; background: rgba(255,253,248,.96); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; backdrop-filter: blur(12px); }
  .page-heading .eyebrow { display: none; }
  .heading-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .heading-row h1 { font-size: 23px; line-height: 1.18; }
  .heading-row .version-pill { grid-column: 1 / -1; width: fit-content; }
  .topbar-actions { grid-auto-columns: minmax(118px, max-content); gap: 8px; }
  .topbar-actions .search { min-width: min(280px, 74vw); }
  .topbar-actions .button,
  .topbar-actions .file-label,
  .topbar-actions .language-switcher { min-height: 38px; padding-inline: 10px; font-size: 14px; }
  .section-tools { display: grid; grid-template-columns: 1fr; align-items: start; gap: 10px; margin-bottom: 10px; }
  .section-tools .button-row,
  .section-tools > .button,
  .section-tools > label { width: 100%; }
  .section-tools .button,
  .section-tools .field { width: 100%; }
  .panel, .record-list, .stat, .report-card { padding: 12px; border-radius: 8px; }
  .record-list { display: grid; gap: 10px; background: transparent; border: 0; box-shadow: none; padding: 0; }
  .list-toolbar, .remote-pager, .order-frequency-panel { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; margin: 0; }
  .record {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24,32,38,.05);
  }
  .record strong { font-size: 16px; line-height: 1.35; }
  .record .meta { font-size: 12px; line-height: 1.45; }
  .record > div:nth-child(2) { display: flex; flex-wrap: wrap; gap: 6px; }
  .record-action {
    width: 100%;
    pointer-events: none;
    min-height: 36px;
    margin-top: 2px;
    background: #f8fafb;
  }
  #rma-list .record.rma-record { grid-template-columns: 1fr; padding: 12px; }
  .rma-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rma-section-grid { grid-template-columns: 1fr; }
  .rma-section-grid .field.is-wide { grid-column: auto; }
  .service-photo-grid { grid-template-columns: 1fr; }
  .inline-preview-overlay { padding: 0; place-items: stretch; }
  .inline-preview-window { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .tracking-preview-card { padding: 12px; }
  .quote-preview-row { grid-template-columns: 1fr; align-items: start; }
  .quote-preview-total { align-items: flex-start; }
  .dashboard-panel { padding: 12px; }
  .dashboard-queue-list { max-height: none; overflow: visible; }
  .mini-card, .stage-card { margin-bottom: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .modal form {
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: 12px;
  }
  .modal-header {
    top: -12px;
    margin: -12px -12px 12px;
    padding: 12px;
    border-radius: 0;
  }
  .modal-actions {
    position: sticky;
    bottom: -12px;
    z-index: 18;
    margin: 12px -12px -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
  }
  .modal-actions .button { flex: 1 1 104px; }
  .customer-insight-grid,
  .history-grid,
  .finance-approval-fields,
  .finance-approval-metrics,
  .finance-totals,
  .attachment-grid,
  .catalog-summary { grid-template-columns: 1fr; }
  .finance-approval-fields .field.is-wide { grid-column: auto; }
  .finance-approval-head,
  .rma-print-panel { grid-template-columns: 1fr; }
  .finance-approval-head { display: block; }
  .finance-approval-actions,
  .print-action-grid { justify-content: stretch; }
  .finance-approval-actions .button,
  .print-action-grid .button { flex: 1 1 100%; }
  .finance-table-wrap,
  .catalog-table-wrap,
  .traffic-table-wrap { margin-inline: -2px; }
}
@media (max-width: 390px) {
  .main { padding: 10px; }
  .topbar { margin: -10px -10px 10px; padding: 10px; }
  .rma-kpis { grid-template-columns: 1fr; }
  .dashboard-stats,
  .dashboard-kanban,
  .dashboard-mini-metrics,
  .dashboard-alert-list,
  .dashboard-progress-list { grid-auto-columns: minmax(226px, 88vw); }
  .button { white-space: normal; text-align: center; }
}
/* Public-service pages: keep the form journey compact and touch-friendly on tablets and phones. */
@media (min-width: 721px) and (max-width: 940px) {
  .portal-shell:not(.portal-home) .portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 20px;
    padding: 28px;
  }
  .portal-shell:not(.portal-home) .portal-page-title,
  .portal-shell:not(.portal-home) .portal-contact-card,
  .portal-shell:not(.portal-home) .portal-page-visual {
    grid-column: 1 / -1;
  }
  .portal-shell:not(.portal-home) .portal-top-actions { justify-content: flex-end; }
  .portal-shell:not(.portal-home) .portal-contact-card { width: min(680px, 100%); padding: 16px; }
  .portal-shell:not(.portal-home) .portal-contact-actions a { flex: 1 1 220px; }
  .portal-shell:not(.portal-home) .portal-page-visual { width: min(760px, 100%); margin-top: 4px; }
  .portal-shell:not(.portal-home) .portal-panel { padding: 28px; }
  .portal-shell:not(.portal-home) .portal-form { padding: 20px; }
  .blog-public-hero { padding: 30px; }
  .blog-public-copy { padding-top: 18px; }
  .official-footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .official-social { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .portal-shell:not(.portal-home) .portal-hero {
    gap: 18px;
    padding: 20px 18px 22px;
  }
  .portal-shell:not(.portal-home) .portal-brand { gap: 10px; }
  .portal-shell:not(.portal-home) .portal-brand strong { font-size: 18px; line-height: 1.2; }
  .portal-shell:not(.portal-home) .portal-brand span { font-size: 12px; line-height: 1.35; }
  .portal-shell:not(.portal-home) .portal-top-actions {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
  }
  .portal-shell:not(.portal-home) .portal-top-actions .language-switcher { flex: 0 0 82px; width: 82px; }
  .portal-shell:not(.portal-home) .portal-top-actions .portal-home-link { flex: 1 1 auto; justify-content: center; }
  .portal-shell:not(.portal-home) .portal-page-title { margin-top: 2px; }
  .portal-shell:not(.portal-home) .portal-page-title h1 { font-size: clamp(28px, 8vw, 34px); line-height: 1.14; margin-bottom: 8px; }
  .portal-shell:not(.portal-home) .portal-page-title p:not(.eyebrow) { font-size: 16px; line-height: 1.58; }
  .portal-shell:not(.portal-home) .portal-contact-card { padding: 14px; gap: 8px; }
  .portal-shell:not(.portal-home) .portal-contact-card h2 { font-size: 19px; }
  .portal-shell:not(.portal-home) .portal-contact-card p { font-size: 13px; line-height: 1.52; }
  .portal-shell:not(.portal-home) .portal-page-visual { width: 100%; margin-top: 2px; }
  .portal-shell:not(.portal-home) .portal-page-visual img,
  .portal-shell:not(.portal-home) .repair-info-card img { aspect-ratio: 16 / 9; object-fit: cover; }
  .portal-shell:not(.portal-home) .warranty-promo-card img { aspect-ratio: 16 / 10; object-fit: cover; }
  .portal-shell:not(.portal-home) .portal-panel { padding: 18px 14px 28px; }
  .portal-shell:not(.portal-home) .portal-form { gap: 16px; padding: 16px; }
  .portal-shell:not(.portal-home) .portal-actions { display: grid; grid-template-columns: 1fr; margin-bottom: 8px; }
  .portal-shell:not(.portal-home) .portal-actions .button { width: 100%; min-height: 46px; }
  .portal-shell:not(.portal-home) .portal-result { min-height: 0; }
  .portal-form .field input,
  .portal-form .field select,
  .portal-form .field textarea { min-height: 46px; font-size: 16px; }
  .portal-form .field textarea { min-height: 112px; }
  .blog-public-hero { min-height: auto; padding: 22px 18px; gap: 20px; }
  .blog-public-copy { padding-top: 6px; }
  .blog-public-copy h1 { font-size: 32px; line-height: 1.14; }
  .blog-public-head { gap: 8px; }
  .blog-post-layout, .blog-public-shell { padding: 20px 14px 32px; }
  .policy-document { font-size: 15px; line-height: 1.75; }
}
@media print { .sidebar, .topbar, .section-tools, .view:not(#reports-view) { display: none !important; } .app-shell, .main, #reports-view { display: block !important; padding: 0; } .panel, .report-card { box-shadow: none; break-inside: avoid; } }

.module-order-controls { display: inline-flex; gap: 4px; margin-left: auto; }
.module-order-controls .icon-button { width: 30px; min-width: 30px; height: 30px; }
.payment-record-row { display: grid; grid-template-columns: minmax(140px, 1fr) 140px 130px 150px 34px; gap: 8px; align-items: center; margin: 8px 0; }
@media (max-width: 720px) { .payment-record-row { grid-template-columns: 1fr 1fr; } }
