:root {
  --mint-50: #f3f5ff;
  --mint-100: #e9edff;
  --mint-200: #ccd5ff;
  --mint-400: #7890fa;
  --mint-500: #4a6cf7;
  --mint-600: #405fdf;
  --mint-700: #334fca;
  --ink-950: #202430;
  --ink-800: #343a48;
  --ink-650: #626a7a;
  --ink-500: #8b92a1;
  --ink-350: #b3b8c3;
  --line: #e8eaf0;
  --line-strong: #d9dde7;
  --canvas: #f5f6fa;
  --surface: #ffffff;
  --blue: #4a6cf7;
  --blue-soft: #eef1fe;
  --amber: #aa6d15;
  --amber-soft: #fff7e7;
  --danger: #c94d4d;
  --danger-soft: #fff1f1;
  --shadow-sm: 0 2px 10px rgba(38, 48, 78, 0.055);
  --shadow-lg: 0 18px 52px rgba(33, 43, 76, 0.18);
  --sidebar-width: 180px;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 88% 0, rgba(28, 173, 127, 0.08), transparent 26rem),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
h1, h2, h3, p { margin-top: 0; }

.is-hidden { display: none !important; }
.desktop-only { display: inline-flex; }
.clipboard-copy-buffer { position: fixed; top: 0; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.boot-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink-500);
}

.boot-screen p { margin: 0; font-size: 12px; }

.brand-symbol {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, var(--mint-400), var(--mint-700));
  box-shadow: 0 10px 24px rgba(11, 143, 105, 0.22);
  font-size: 25px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-lockup strong { display: block; font-size: 23px; letter-spacing: -0.7px; }
.brand-lockup small { display: block; margin-top: 2px; color: var(--ink-650); font-size: 11px; }
.eyebrow { margin-bottom: 7px; color: var(--mint-600); font-size: 10px; font-weight: 750; letter-spacing: 1.45px; }

/* Authentication */
.auth-shell { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, 0.85fr); }

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  padding: clamp(36px, 6vw, 78px);
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(225, 250, 240, 0.96), rgba(246, 252, 249, 0.94)),
    white;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  border: 1px solid rgba(28, 173, 127, 0.14);
  border-radius: 50%;
  content: "";
}

.auth-story::before { width: 430px; height: 430px; right: -170px; top: -130px; }
.auth-story::after { width: 680px; height: 680px; right: -250px; top: -225px; }
.auth-story .brand-lockup { position: relative; z-index: 1; align-self: flex-start; }
.auth-story-copy { position: relative; z-index: 1; width: min(690px, 100%); margin: auto 0; }
.auth-story-copy h1 { margin-bottom: 22px; font-size: clamp(35px, 4.3vw, 61px); line-height: 1.13; letter-spacing: -2.8px; }
.auth-story-copy > p:last-child { width: min(570px, 100%); margin: 0; color: var(--ink-650); font-size: 15px; line-height: 1.9; }
.trust-strip { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; }
.trust-strip span { padding: 8px 11px; border: 1px solid rgba(11, 143, 105, 0.12); border-radius: 999px; color: var(--mint-700); background: rgba(255, 255, 255, 0.66); font-size: 10px; }

.auth-panel { display: grid; min-height: 100vh; min-height: 100dvh; padding: 36px; place-items: center; background: rgba(255, 255, 255, 0.72); }
.auth-card { width: min(420px, 100%); }
.mobile-brand { display: none; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 31px; border-bottom: 1px solid var(--line); }
.auth-tab { position: relative; padding: 13px; border: 0; color: var(--ink-500); background: transparent; }
.auth-tab.is-active { color: var(--ink-950); font-weight: 700; }
.auth-tab.is-active::after { position: absolute; right: 14%; bottom: -1px; left: 14%; height: 2px; border-radius: 2px; background: var(--mint-500); content: ""; }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -0.9px; }
.auth-heading p { margin-bottom: 0; color: var(--ink-650); line-height: 1.65; }
.auth-form { display: grid; gap: 17px; }
.field { display: grid; gap: 8px; color: var(--ink-650); font-size: 12px; }
.field input, .field select {
  width: 100%;
  height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  color: var(--ink-950);
  background: white;
}
.field input:focus, .field select:focus { border-color: var(--mint-500); box-shadow: 0 0 0 3px rgba(28, 173, 127, 0.11); }
.code-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.code-field .text-button { min-width: 105px; border: 1px solid var(--mint-200); border-radius: 11px; background: var(--mint-50); }
.agreement-row { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-650); font-size: 11px; line-height: 1.55; }
.agreement-row input { margin-top: 2px; accent-color: var(--mint-600); }
.form-status { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 12px; text-align: center; }
.form-status.is-success { color: var(--mint-700); }
.api-notice { display: none; gap: 5px; margin-top: 18px; padding: 13px; border: 1px solid #f1dfb9; border-radius: 11px; color: var(--amber); background: var(--amber-soft); font-size: 11px; line-height: 1.55; }
.api-notice.is-visible { display: grid; }

/* Shared buttons */
.primary-button, .secondary-button, .disabled-button, .text-button, .icon-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 650;
}
.primary-button { padding: 0 17px; border: 1px solid var(--mint-600); color: white; background: var(--mint-600); }
.primary-button:hover { background: var(--mint-700); }
.secondary-button { padding: 0 16px; border: 1px solid var(--line-strong); color: var(--ink-800); background: white; }
.secondary-button:hover { border-color: var(--mint-200); color: var(--mint-700); }
.disabled-button { padding: 0 16px; border: 1px solid var(--line); color: var(--ink-500); background: #f1f4f3; }
.text-button { min-height: 34px; padding: 0 6px; border: 0; color: var(--mint-700); background: transparent; font-size: 12px; }
.text-button:disabled { color: var(--ink-350); }
.icon-button { width: 39px; padding: 0; border: 1px solid var(--line-strong); color: var(--ink-800); background: white; font-size: 18px; }
.full-button { width: 100%; min-height: 47px; margin-top: 4px; }

/* Application layout */
.customer-shell { min-height: 100vh; }
.desktop-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px 20px;
  overflow-y: auto;
  border-right: 1px solid rgba(8, 112, 84, 0.1);
  background: linear-gradient(180deg, #dff8ee 0%, #eefaf5 46%, #fff 100%);
}
.sidebar-brand { padding: 0 8px 28px; }
.desktop-nav { display: grid; gap: 5px; }
.nav-caption { margin: 15px 12px 5px; color: var(--ink-500); font-size: 9px; font-weight: 750; letter-spacing: 1.15px; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px 13px; border: 0; border-radius: 11px; color: var(--ink-800); background: transparent; text-align: left; }
.nav-item span { display: grid; width: 22px; place-items: center; color: var(--ink-650); font-size: 17px; }
.nav-item b { font-size: 13px; font-weight: 560; }
.nav-item:hover { background: rgba(255, 255, 255, 0.65); }
.nav-item.is-active { color: var(--mint-700); background: white; box-shadow: 0 8px 24px rgba(28, 90, 69, 0.07); }
.nav-item.is-active span { color: var(--mint-600); }
.nav-item.is-active b { font-weight: 700; }
.sidebar-footnote { display: flex; gap: 10px; margin-top: auto; padding: 13px; border: 1px solid rgba(11, 143, 105, 0.13); border-radius: 13px; background: rgba(255, 255, 255, 0.72); }
.sidebar-footnote strong, .sidebar-footnote small { display: block; }
.sidebar-footnote strong { font-size: 11px; }
.sidebar-footnote small { margin-top: 4px; color: var(--ink-500); font-size: 9px; line-height: 1.5; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--mint-500); box-shadow: 0 0 0 4px rgba(28, 173, 127, 0.12); }

.workspace { min-height: 100vh; min-height: 100dvh; margin-left: var(--sidebar-width); }
.workspace-header { position: sticky; top: 0; z-index: 20; display: flex; min-height: 76px; align-items: center; gap: 14px; padding: 10px 32px; border-bottom: 1px solid rgba(220, 229, 225, 0.88); background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(16px); }
.mobile-header-brand { display: none; }
.header-copy p { margin-bottom: 3px; color: var(--mint-600); font-size: 8px; font-weight: 750; letter-spacing: 1.3px; }
.header-copy h1 { margin: 0; font-size: 17px; letter-spacing: -0.3px; }
.header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.account-chip { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 4px 11px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: white; }
.account-chip i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--mint-700); background: var(--mint-100); font-size: 11px; font-style: normal; font-weight: 750; }
.account-chip span { max-width: 120px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-content { width: min(1500px, 100%); margin: 0 auto; padding: 31px 32px 48px; }
.view-panel { display: none; }
.view-panel.is-active { display: block; animation: view-in 180ms ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.global-banner { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #f1dfb9; border-radius: 11px; color: var(--amber); background: var(--amber-soft); font-size: 12px; line-height: 1.55; }

/* Page structure */
.hero-card { display: flex; min-height: 190px; align-items: flex-end; justify-content: space-between; gap: 26px; padding: clamp(26px, 4vw, 43px); overflow: hidden; border: 1px solid var(--mint-200); border-radius: 20px; background: linear-gradient(127deg, #e7faf3 0%, #fff 72%); box-shadow: var(--shadow-sm); }
.hero-card h2 { max-width: 700px; margin-bottom: 10px; font-size: clamp(24px, 3vw, 37px); line-height: 1.25; letter-spacing: -1.2px; }
.hero-card p:last-child { margin-bottom: 0; color: var(--ink-650); }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 21px; }
.page-intro h2 { margin-bottom: 7px; font-size: clamp(25px, 3vw, 33px); letter-spacing: -1px; }
.page-intro > div > p:last-child { max-width: 730px; margin-bottom: 0; color: var(--ink-650); line-height: 1.65; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 17px; }

.metric-grid, .summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 17px 0; }
.metric-card, .summary-card { min-height: 125px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.metric-card span, .summary-card span { color: var(--ink-650); font-size: 11px; }
.metric-card strong, .summary-card strong { display: block; margin: 17px 0 7px; font-size: 28px; letter-spacing: -0.8px; }
.metric-card small, .summary-card small { color: var(--ink-500); font-size: 10px; }
.summary-card.is-negative { border-color: #efcaca; background: #fff8f8; }
.summary-card.is-negative strong { color: var(--danger); }
.summary-card.is-warning { border-color: #f1dfb9; background: #fffaf0; }
.current-account-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-divider-heading { margin: 34px 0 15px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-divider-heading h3 { margin: 0 0 6px; font-size: 18px; }
.section-divider-heading p:last-child { margin: 0; color: var(--ink-500); font-size: 11px; line-height: 1.6; }
.two-column-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.surface-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.stack-list { display: grid; gap: 9px; }
.stack-item { display: flex; min-height: 63px; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; background: #f8faf9; }
.stack-item-mark { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--mint-700); background: var(--mint-100); font-size: 12px; font-weight: 750; }
.stack-item-main { min-width: 0; flex: 1; }
.stack-item-main strong, .stack-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-item-main strong { font-size: 12px; }
.stack-item-main small { margin-top: 4px; color: var(--ink-500); font-size: 10px; }
.empty-state { display: grid; min-height: 128px; place-content: center; justify-items: center; color: var(--ink-500); text-align: center; }
.empty-state strong { color: var(--ink-650); font-size: 12px; }
.empty-state small { max-width: 320px; margin-top: 6px; font-size: 10px; line-height: 1.55; }

/* Filters and lists */
.filter-card { display: grid; align-items: end; gap: 11px; margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow-sm); }
.product-filters { grid-template-columns: 155px 155px minmax(220px, 1fr) auto auto; }
.order-filters { grid-template-columns: 155px 155px auto auto; }
.compact-filters { grid-template-columns: 190px 190px auto; }
.customer-filters { width: fit-content; grid-template-columns: auto; }
.filter-card label { display: grid; gap: 7px; color: var(--ink-650); font-size: 10px; }
.filter-card input, .filter-card select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; color: var(--ink-950); background: white; }
.filter-card input:focus, .filter-card select:focus { border-color: var(--mint-500); box-shadow: 0 0 0 3px rgba(28, 173, 127, 0.1); }
.result-meta { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink-500); font-size: 10px; }
.result-meta > span:first-child { color: var(--ink-800); font-size: 11px; }
.product-grid, .customer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card, .customer-card, .renewal-card { position: relative; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.product-card { display: flex; min-height: 265px; flex-direction: column; }
.product-card-head { display: flex; align-items: flex-start; gap: 10px; }
.product-card-head > div { min-width: 0; flex: 1; }
.product-card h3, .renewal-card h3 { margin-bottom: 6px; font-size: 15px; line-height: 1.45; }
.product-card-head p, .renewal-card p { margin: 0; color: var(--ink-500); font-size: 10px; }
.product-points { display: -webkit-box; margin: 16px 0; overflow: hidden; color: var(--ink-650); font-size: 11px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag, .supplier-badge, .readonly-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; color: var(--mint-700); background: var(--mint-50); font-size: 9px; font-weight: 650; }
.product-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.product-card-actions > * { flex: 1; text-decoration: none; }
.unavailable-note { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-500); background: #f5f6f9; font-size: 10px; white-space: nowrap; }
.purchase-link-control { position: relative; min-width: 0; }
.purchase-link-control > .primary-button { width: 100%; text-decoration: none; }
.personal-link-toggle { display: none; }
.purchase-link-popover {
  position: absolute;
  z-index: 65;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(390px, calc(100vw - 42px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  visibility: hidden;
  opacity: 0;
  background: white;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}
.purchase-link-popover::before {
  position: absolute;
  right: 0;
  bottom: -11px;
  left: 0;
  height: 12px;
  content: "";
}
.purchase-link-popover::after { position: absolute; right: 24px; bottom: -6px; width: 11px; height: 11px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: white; content: ""; transform: rotate(45deg); }
.purchase-link-control:hover .purchase-link-popover,
.purchase-link-control:focus-within .purchase-link-popover,
.purchase-link-control.is-open .purchase-link-popover { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); }
.personal-link-content { min-height: 124px; }
.personal-link-loading { display: grid; min-height: 124px; place-items: center; color: var(--ink-500); font-size: 11px; }
.personal-link-preview { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 14px; align-items: center; }
.personal-link-preview img { display: block; width: 124px; height: 124px; border: 1px solid var(--line); border-radius: 8px; background: white; object-fit: contain; }
.personal-link-preview > div { display: grid; min-width: 0; gap: 7px; }
.personal-link-preview strong { color: var(--ink-950); font-size: 12px; }
.personal-link-preview small { color: var(--ink-500); font-size: 9px; }
.personal-link-preview a { display: -webkit-box; max-height: 54px; overflow: hidden; color: var(--blue); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.personal-link-preview button,
.personal-link-error button { min-height: 31px; border: 1px solid var(--mint-200); border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 10px; }
.personal-link-error { display: grid; min-height: 124px; align-content: center; gap: 10px; color: var(--danger); font-size: 11px; text-align: center; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; color: var(--ink-650); background: #f1f4f3; font-size: 9px; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.is-positive { color: var(--mint-700); background: var(--mint-50); }
.status-pill.is-warning { color: var(--amber); background: var(--amber-soft); }
.status-pill.is-negative { color: var(--danger); background: var(--danger-soft); }
.status-pill.is-info { color: var(--blue); background: var(--blue-soft); }

.data-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.data-card-head { display: flex; min-height: 47px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 17px; border-bottom: 1px solid var(--line); color: var(--ink-800); font-size: 11px; }
.data-card-head small { color: var(--ink-500); }
.responsive-table { overflow-x: auto; }
table { width: 100%; min-width: 920px; border-collapse: collapse; }
th { padding: 13px 15px; color: var(--ink-650); background: #fafcfb; font-size: 10px; font-weight: 650; text-align: left; white-space: nowrap; }
td { padding: 14px 15px; border-top: 1px solid #edf1ef; color: var(--ink-800); font-size: 11px; line-height: 1.5; vertical-align: middle; }
.policy-party-cell { min-width: 100px; max-width: 220px; white-space: normal; overflow-wrap: anywhere; }
tbody tr:hover { background: #fbfdfc; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.money { font-variant-numeric: tabular-nums; font-weight: 680; }
.table-action { padding: 6px 9px; border: 1px solid var(--mint-200); border-radius: 8px; color: var(--mint-700); background: var(--mint-50); font-size: 10px; }
.mobile-card-list { display: none; }
.pager { display: flex; min-height: 54px; align-items: center; justify-content: flex-end; gap: 7px; padding: 9px 14px; }
.pager:empty { display: none; }
.pager button { min-width: 74px; height: 33px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-800); background: white; font-size: 10px; }
.pager button:disabled { opacity: 0.42; }
.pager span { margin: 0 5px; color: var(--ink-500); font-size: 10px; }

.segmented-tabs { display: inline-flex; gap: 3px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.segmented-tabs button { min-height: 34px; padding: 0 15px; border: 0; border-radius: 8px; color: var(--ink-650); background: transparent; font-size: 11px; }
.segmented-tabs button.is-active { color: var(--mint-700); background: var(--mint-100); font-weight: 700; }
.renewal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.renewal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.renewal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; padding: 14px; border-radius: 11px; background: #f8faf9; }
.renewal-meta span, .detail-grid dt { display: block; color: var(--ink-500); font-size: 9px; }
.renewal-meta strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 11px; }
.renewal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.readonly-callout { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #f1dfb9; border-radius: 12px; color: var(--amber); background: var(--amber-soft); font-size: 11px; line-height: 1.55; }
.readonly-callout strong { flex: 0 0 auto; }
.current-account-callout { border-color: var(--mint-200); color: var(--mint-700); background: var(--mint-50); }
.current-account-callout.is-reconciling { border-color: #f1dfb9; color: var(--amber); background: var(--amber-soft); }
.current-account-callout.is-debt { border-color: #efcaca; color: var(--danger); background: #fff4f4; }
.withdrawal-rule-callout { border-color: var(--mint-200); color: var(--mint-700); background: var(--mint-50); }
.withdrawal-month-card { margin-bottom: 14px; }
.withdrawal-action:disabled { cursor: not-allowed; opacity: 0.48; }
.entry-direction-credit { color: var(--mint-700); }
.entry-direction-debit { color: var(--danger); }

.customer-card-head { display: flex; align-items: center; gap: 11px; }
.customer-avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--mint-700); background: var(--mint-100); font-size: 13px; font-weight: 750; }
.customer-card h3 { margin: 0 0 4px; font-size: 14px; }
.customer-card p { margin: 0; color: var(--ink-500); font-size: 10px; }
.customer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.customer-stat { padding: 10px 7px; border-radius: 10px; background: #f8faf9; text-align: center; }
.customer-stat strong, .customer-stat span { display: block; }
.customer-stat strong { font-size: 13px; }
.customer-stat span { margin-top: 4px; color: var(--ink-500); font-size: 8px; }

.invite-layout, .profile-layout { display: grid; grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr); gap: 16px; }
.invite-card { position: relative; min-height: 360px; padding: 28px; overflow: hidden; border-radius: 20px; color: white; background: linear-gradient(145deg, var(--mint-500), #086448); box-shadow: var(--shadow-lg); }
.invite-card .eyebrow { color: rgba(255, 255, 255, 0.72); }
.invite-card h2 { max-width: 330px; font-size: 27px; line-height: 1.25; letter-spacing: -0.8px; }
.invite-card > p:not(.eyebrow) { max-width: 380px; color: rgba(255, 255, 255, 0.78); line-height: 1.65; }
.invite-mark { position: absolute; right: -20px; top: -62px; color: rgba(255, 255, 255, 0.08); font-size: 240px; font-weight: 200; }
.invite-link-box { position: relative; margin: 34px 0 12px; padding: 13px; overflow-wrap: anywhere; border: 1px solid rgba(255, 255, 255, 0.23); border-radius: 11px; background: rgba(255, 255, 255, 0.1); font-size: 10px; line-height: 1.5; }
.invite-card .primary-button { position: relative; border-color: white; color: var(--mint-700); background: white; }

.profile-card { display: grid; min-height: 330px; place-content: center; justify-items: center; padding: 27px; border: 1px solid var(--mint-200); border-radius: 20px; background: linear-gradient(150deg, var(--mint-50), white); box-shadow: var(--shadow-sm); text-align: center; }
.profile-avatar { display: grid; width: 82px; height: 82px; place-items: center; border: 6px solid white; border-radius: 26px; color: white; background: linear-gradient(145deg, var(--mint-400), var(--mint-700)); box-shadow: 0 12px 28px rgba(11, 143, 105, 0.2); font-size: 26px; font-weight: 750; }
.profile-card h2 { margin: 18px 0 7px; }
.profile-card p { margin-bottom: 16px; color: var(--ink-500); }
.profile-details dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.profile-details dl > div { min-height: 73px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-details dl > div:nth-child(2n) { border-right: 0; }
.profile-details dt { margin-bottom: 7px; color: var(--ink-500); font-size: 9px; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: 11px; }
.real-name-card { margin-top: 16px; }
.real-name-state-note { margin: -2px 0 16px; color: var(--ink-650); font-size: 11px; line-height: 1.65; }
.real-name-application-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.real-name-application-meta > div { min-width: 0; padding: 12px 13px; border-right: 1px solid var(--line); }
.real-name-application-meta > div:last-child { border-right: 0; }
.real-name-application-meta dt { margin-bottom: 6px; color: var(--ink-500); font-size: 9px; }
.real-name-application-meta dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: 11px; }
.real-name-form { padding-top: 18px; border-top: 1px solid var(--line); }
.real-name-form-grid, .real-name-company-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.real-name-company-fields { margin-top: 13px; padding: 14px; border: 1px solid #dfe5f8; border-radius: 8px; background: #f8faff; }
.real-name-form label { display: grid; min-width: 0; gap: 7px; color: var(--ink-650); font-size: 10px; }
.real-name-form input, .real-name-form select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; color: var(--ink-950); background: white; }
.real-name-form input:focus, .real-name-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 108, 247, .1); }
.real-name-security-note { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--mint-200); border-radius: 8px; color: var(--mint-700); background: var(--mint-50); font-size: 10px; line-height: 1.6; }
.real-name-security-note strong { flex: 0 0 auto; }
.real-name-form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.real-name-form-actions button { min-width: 150px; }
.real-name-form-status { margin: 8px 0 0; text-align: right; }
.mobile-more-grid { display: none; }

/* Detail drawer and toast */
.drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(20, 34, 29, 0.28); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; z-index: 75; top: 0; right: 0; bottom: 0; width: min(650px, 95vw); overflow-y: auto; background: white; box-shadow: -24px 0 60px rgba(22, 53, 43, 0.18); transform: translateX(105%); transition: transform 190ms ease; }
.detail-drawer.is-open { transform: translateX(0); }
.detail-drawer > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(13px); }
.detail-drawer h2 { margin: 0; font-size: 20px; }
.drawer-content { padding: 23px 24px 38px; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { margin-bottom: 11px; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.detail-grid > div { min-height: 69px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid > div:nth-child(2n) { border-right: 0; }
.detail-grid dd { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: 11px; line-height: 1.5; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: min(430px, calc(100vw - 32px)); padding: 11px 15px; border-radius: 10px; color: white; background: rgba(23, 35, 31, 0.92); box-shadow: var(--shadow-lg); font-size: 11px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.mobile-bottom-nav { display: none; }

@media (max-width: 1180px) {
  .metric-grid, .summary-grid, .current-account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid, .customer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-filters, .order-filters { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .product-filters .search-field, .order-filters .search-field { grid-column: span 2; }
}

@media (max-width: 820px) {
  body { background: var(--canvas); }
  .auth-shell { display: block; min-height: 100vh; min-height: 100dvh; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; padding: 28px 20px; background: linear-gradient(180deg, #ddf8ed 0, var(--canvas) 240px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; }
  .mobile-brand .brand-symbol { width: 36px; height: 36px; border-radius: 12px; font-size: 21px; }
  .mobile-brand strong { font-size: 21px; }
  .auth-card { padding: 24px 20px; border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 20px; background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow-lg); }

  .desktop-sidebar { display: none; }
  .workspace { margin-left: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .workspace-header { min-height: 63px; padding: 9px 16px; }
  .mobile-header-brand { display: flex; align-items: center; gap: 7px; }
  .mobile-header-brand .brand-symbol { width: 31px; height: 31px; border-radius: 10px; font-size: 18px; box-shadow: none; }
  .mobile-header-brand strong { font-size: 18px; }
  .header-copy { display: none; }
  .account-chip { display: none; }
  .desktop-only { display: none; }
  .workspace-content { padding: 18px 14px 25px; }

  .mobile-bottom-nav { position: fixed; z-index: 45; right: 0; bottom: 0; left: 0; display: grid; min-height: calc(61px + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); padding: 5px 6px env(safe-area-inset-bottom); border-top: 1px solid rgba(219, 228, 224, 0.94); background: rgba(255, 255, 255, 0.96); box-shadow: 0 -8px 25px rgba(28, 57, 47, 0.06); backdrop-filter: blur(15px); }
  .mobile-bottom-nav button { display: grid; place-items: center; gap: 2px; border: 0; color: var(--ink-500); background: transparent; }
  .mobile-bottom-nav button span { font-size: 18px; line-height: 1; }
  .mobile-bottom-nav button b { font-size: 9px; font-weight: 550; }
  .mobile-bottom-nav button.is-active { color: var(--mint-700); }
  .mobile-bottom-nav button.is-active b { font-weight: 750; }

  .hero-card { min-height: 210px; align-items: flex-start; flex-direction: column; padding: 24px 20px; border-radius: 18px; }
  .hero-card h2 { font-size: 25px; }
  .hero-card .primary-button { margin-top: auto; }
  .metric-grid, .summary-grid, .current-account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card, .summary-card { min-height: 111px; padding: 15px; border-radius: 14px; }
  .metric-card strong, .summary-card strong { margin: 14px 0 5px; font-size: 23px; }
  .two-column-grid, .invite-layout, .profile-layout { grid-template-columns: 1fr; }
  .surface-card { padding: 16px; border-radius: 15px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 17px; }
  .page-intro h2 { font-size: 26px; }
  .page-intro .disabled-button { width: 100%; }

  .filter-card, .product-filters, .order-filters, .compact-filters, .customer-filters { grid-template-columns: 1fr 1fr; padding: 13px; }
  .customer-filters { width: 100%; grid-template-columns: 1fr; }
  .filter-card .search-field, .product-filters .search-field, .order-filters .search-field, .customer-filters .search-field { grid-column: 1 / -1; }
  .product-grid, .customer-grid, .renewal-list { grid-template-columns: 1fr; }
  .product-card { min-height: 230px; }
  .result-meta { align-items: flex-start; flex-direction: column; gap: 3px; padding: 5px 1px 10px; }
  .responsive-table { display: none; }
  .mobile-card-list { display: grid; gap: 10px; padding: 12px; }
  .mobile-data-card { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
  .mobile-data-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 11px; }
  .mobile-data-card h3 { margin-bottom: 5px; font-size: 13px; line-height: 1.45; }
  .mobile-data-card p { margin: 0; color: var(--ink-500); font-size: 9px; }
  .mobile-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
  .mobile-data-grid span, .mobile-data-grid strong { display: block; }
  .mobile-data-grid span { color: var(--ink-500); font-size: 8px; }
  .mobile-data-grid strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 10px; }
  .mobile-data-card footer { display: flex; justify-content: flex-end; margin-top: 12px; }
  .pager { justify-content: center; }
  .renewal-meta { grid-template-columns: 1fr; }
  .readonly-callout { flex-direction: column; gap: 4px; }
  .invite-card { min-height: 330px; padding: 24px 20px; }
  .invite-card h2 { font-size: 24px; }
  .profile-card { min-height: 270px; }
  .profile-details dl { grid-template-columns: 1fr; }
  .profile-details dl > div { border-right: 0; }
  .real-name-application-meta { grid-template-columns: 1fr 1fr; }
  .real-name-application-meta > div:nth-child(2) { border-right: 0; }
  .real-name-application-meta > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .real-name-form-grid, .real-name-company-fields { grid-template-columns: 1fr; }
  .real-name-security-note { flex-direction: column; gap: 4px; }
  .real-name-form-actions button { width: 100%; }
  .real-name-form-status { text-align: center; }
  .mobile-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
  .mobile-more-grid button { display: flex; min-height: 62px; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-800); background: white; text-align: left; }
  .mobile-more-grid button span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--mint-700); background: var(--mint-100); }
  .detail-drawer { width: 100%; top: 8vh; border-radius: 20px 20px 0 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div { border-right: 0; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .filter-card, .product-filters, .order-filters, .compact-filters, .customer-filters { grid-template-columns: 1fr; }
  .filter-card .search-field, .product-filters .search-field, .order-filters .search-field, .customer-filters .search-field { grid-column: auto; }
  .metric-grid, .summary-grid { grid-template-columns: 1fr 1fr; }
}

/* Legacy PC information architecture, retained on top of the current safe API contract. */
body { background: var(--canvas); }
.brand-symbol { border-radius: 8px; background: var(--blue); box-shadow: 0 6px 16px rgba(74, 108, 247, 0.2); }
.eyebrow { color: var(--blue); }
.primary-button { border-color: var(--blue); background: var(--blue); }
.primary-button:hover { border-color: var(--mint-700); background: var(--mint-700); }
.secondary-button:hover { border-color: var(--mint-200); color: var(--blue); }
.text-button { color: var(--blue); }
.topbar-link { min-height: 30px; padding: 0 7px; border: 0; color: var(--ink-650); background: transparent; font-size: 12px; }
.topbar-link:hover { color: var(--blue); }
.home-service-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.home-service-grid button { display: grid; min-height: 112px; align-content: center; justify-items: center; gap: 6px; padding: 14px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-800); background: white; box-shadow: var(--shadow-sm); text-align: center; }
.home-service-grid button:hover { border-color: var(--mint-200); box-shadow: 0 5px 18px rgba(74, 108, 247, 0.1); transform: translateY(-1px); }
.home-service-grid button > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--mint-50); font-size: 17px; }
.home-service-grid strong { font-size: 13px; }
.home-service-grid small { color: var(--ink-500); font-size: 9px; line-height: 1.4; }
.coming-soon-card { display: grid; min-height: 350px; place-content: center; justify-items: center; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow-sm); text-align: center; }
.coming-soon-card > span { display: grid; width: 72px; height: 72px; place-items: center; margin-bottom: 18px; border-radius: 50%; color: var(--blue); background: var(--mint-50); font-size: 38px; }
.coming-soon-card h2 { margin-bottom: 8px; font-size: 20px; }
.coming-soon-card p { margin-bottom: 22px; color: var(--ink-500); }
.product-offer-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfe; }
.product-offer-row > div:first-child { display: grid; min-width: 0; grid-template-columns: auto auto; align-items: center; gap: 2px 9px; }
.product-offer-row span { color: var(--ink-500); font-size: 9px; }
.product-offer-row strong { color: var(--ink-800); font-size: 12px; }
.product-offer-row small { grid-column: 1 / -1; color: var(--ink-500); font-size: 9px; }
.nav-group { margin: 0; padding: 0; }
.nav-item small { margin-left: auto; color: var(--ink-350); font-size: 8px; font-weight: 500; }

@media (min-width: 821px) {
  .auth-shell { grid-template-columns: minmax(480px, 1.25fr) minmax(390px, 0.75fr); background: var(--blue); }
  .auth-story { padding: clamp(38px, 5vw, 72px); background: linear-gradient(135deg, #4a6cf7 0%, #5a78ef 100%); }
  .auth-story::before, .auth-story::after { border-color: rgba(255, 255, 255, 0.15); }
  .auth-story .brand-symbol { color: var(--blue); background: white; box-shadow: none; }
  .auth-story .brand-lockup strong, .auth-story-copy h1 { color: white; }
  .auth-story .brand-lockup small, .auth-story-copy > p:last-child { color: rgba(255, 255, 255, 0.78); }
  .auth-story-copy h1 { max-width: 720px; font-size: clamp(34px, 4vw, 52px); letter-spacing: -1.8px; }
  .auth-story .eyebrow { color: rgba(255, 255, 255, 0.68); }
  .trust-strip span { border-color: rgba(255, 255, 255, 0.22); color: white; background: rgba(255, 255, 255, 0.1); }
  .auth-panel { padding: 36px; background: var(--blue); }
  .auth-card { padding: 34px 36px; border-radius: 7px; background: white; box-shadow: 0 20px 55px rgba(25, 42, 112, 0.24); }
  .auth-heading h2 { font-size: 24px; }

  .desktop-sidebar { padding: 0 10px 14px; border-right: 1px solid var(--line); background: white; }
  .sidebar-brand { min-height: 55px; margin: 0 -10px 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: white; }
  .sidebar-brand .brand-symbol { width: 32px; height: 32px; border-radius: 7px; font-size: 18px; }
  .sidebar-brand strong { font-size: 18px; }
  .sidebar-brand small { font-size: 8px; }
  .desktop-nav { display: block; }
  .nav-home { margin-bottom: 5px; }
  .nav-caption { display: flex; align-items: center; gap: 7px; margin: 10px 8px 3px; color: var(--ink-650); font-size: 10px; font-weight: 700; letter-spacing: 0; }
  .nav-caption span { display: inline-grid; width: 14px; place-items: center; color: var(--blue); }
  .nav-item { min-height: 31px; gap: 8px; padding: 6px 8px 6px 29px; border-radius: 5px; color: var(--ink-650); }
  .nav-home { padding-left: 10px; }
  .nav-item > span { width: 17px; color: var(--ink-500); font-size: 14px; }
  .nav-item b { font-size: 11px; font-weight: 500; }
  .nav-item:hover { color: var(--blue); background: #f7f8fc; }
  .nav-item.is-active { color: var(--blue); background: var(--mint-50); box-shadow: none; }
  .nav-item.is-active b { font-weight: 700; }
  .nav-item.is-active small { color: var(--mint-500); }
  .sidebar-footnote { margin: 14px 2px 0; padding: 9px; border-radius: 6px; }
  .sidebar-footnote strong { font-size: 9px; }
  .sidebar-footnote small { font-size: 8px; }

  .workspace-header { min-height: 55px; padding: 7px 24px; border-bottom: 1px solid var(--line); background: white; backdrop-filter: none; }
  .header-copy p { color: var(--blue); }
  .header-copy h1 { font-size: 15px; }
  .account-chip { min-height: 31px; padding: 2px 8px 2px 3px; border: 0; }
  .account-chip i { width: 25px; height: 25px; color: var(--blue); background: var(--mint-50); }
  .header-actions { gap: 4px; }
  .header-actions .icon-button { width: 31px; min-height: 31px; border-radius: 5px; font-size: 15px; }
  .workspace-content { width: min(1520px, 100%); padding: 20px 24px 38px; }

  .hero-card { min-height: 104px; padding: 19px 22px; border-color: var(--line); border-radius: 7px; background: linear-gradient(110deg, var(--mint-50), white 68%); }
  .hero-card h2 { margin-bottom: 6px; font-size: 22px; letter-spacing: -0.5px; }
  .page-intro { margin-bottom: 14px; }
  .page-intro h2 { margin-bottom: 4px; font-size: 22px; letter-spacing: -0.4px; }
  .page-intro > div > p:last-child { font-size: 11px; }
  .metric-grid, .summary-grid { gap: 10px; margin: 12px 0; }
  .metric-card, .summary-card { min-height: 96px; padding: 14px 16px; border-radius: 7px; }
  .metric-card strong, .summary-card strong { margin: 10px 0 4px; font-size: 23px; }
  .surface-card { padding: 16px; border-radius: 7px; }
  .stack-item { min-height: 54px; border-radius: 5px; background: #f8f9fc; }

  .filter-card { gap: 9px; margin-bottom: 10px; padding: 12px 14px; border-radius: 7px; }
  .filter-card input, .filter-card select { height: 34px; border-radius: 5px; }
  .primary-button, .secondary-button, .disabled-button, .text-button, .icon-button { min-height: 34px; border-radius: 5px; }
  .result-meta { min-height: 34px; }
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-card { min-height: auto; padding: 16px 18px; border-radius: 7px; }
  .product-card-head { align-items: center; }
  .product-card h3 { margin-bottom: 4px; font-size: 15px; }
  .product-points { margin: 10px 0 0; -webkit-line-clamp: 2; }
  .product-card-actions { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
  .product-card-actions > * { flex: 0 0 auto; }
  .tag, .supplier-badge, .readonly-badge { border-radius: 4px; }
  .data-card, .profile-card, .invite-card { border-radius: 7px; }
  .segmented-tabs { margin-bottom: 10px; border-radius: 6px; }
  .segmented-tabs button { min-height: 30px; border-radius: 4px; }
  .segmented-tabs button.is-active { color: var(--blue); }
  .renewal-card, .customer-card { border-radius: 7px; }
  .invite-card { background: linear-gradient(145deg, var(--blue), #3454cf); }
  .invite-card .primary-button { color: var(--blue); }
  .profile-card { border-color: var(--mint-200); background: linear-gradient(150deg, var(--mint-50), white); }
  .profile-avatar { border-radius: 50%; background: var(--blue); box-shadow: 0 10px 24px rgba(74, 108, 247, 0.2); }
}

@media (max-width: 1180px) and (min-width: 821px) {
  .home-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .auth-panel { background: linear-gradient(180deg, var(--blue) 0, #5c79ef 240px); }
  .mobile-brand { color: white; }
  .mobile-brand .brand-symbol { color: var(--blue); background: white; }
  .auth-card { border-radius: 10px; background: white; }
  .workspace-header { border-bottom-color: var(--line); background: white; }
  .mobile-header-brand .brand-symbol { background: var(--blue); }
  .mobile-bottom-nav button.is-active { color: var(--blue); }
  .home-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .home-service-grid button { min-height: 105px; border-radius: 9px; }
  .hero-card { border-color: var(--mint-200); background: linear-gradient(145deg, var(--mint-50), white); }
  .product-offer-row { align-items: stretch; flex-direction: column; }
  .product-card-actions { display: grid; grid-template-columns: 1fr; margin-top: 0; padding-top: 10px; }
  .purchase-link-control { width: 100%; }
  .purchase-link-popover { right: -1px; }
  .coming-soon-card { min-height: 310px; border-radius: 12px; }
}

/* The one customer portal stays touch-operable instead of depending on hover. */
@media (hover: none), (pointer: coarse) {
  .purchase-link-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .purchase-link-control > .primary-button { width: auto; }
  .personal-link-toggle { display: inline-flex; width: 100%; align-items: center; justify-content: center; }
  .purchase-link-popover {
    position: static;
    display: none;
    width: 100%;
    grid-column: 1 / -1;
    margin-top: 2px;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .purchase-link-control.is-open .purchase-link-popover { display: block; transform: none; }
  .purchase-link-popover::before, .purchase-link-popover::after { display: none; }
}

/* Keep common tablet widths free of the old two-column login overflow. */
@media (min-width: 821px) and (max-width: 959px) {
  .auth-shell { display: block; min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
  .auth-story { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; padding: 28px 20px; background: linear-gradient(180deg, var(--blue) 0, #5c79ef 280px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; color: white; }
  .mobile-brand .brand-symbol { width: 36px; height: 36px; border-radius: 12px; color: var(--blue); background: white; font-size: 21px; box-shadow: none; }
  .mobile-brand strong { font-size: 21px; }
  .auth-card { padding: 28px 26px; border-radius: 10px; background: white; box-shadow: var(--shadow-lg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
