:root {
  --brand: #e16811;
  --brand-dark: #b84c0a;
  --brand-deep: #71330e;
  --brand-soft: #fff3ea;
  --brand-dark: #b84c0a;
  --ink: #121820;
  --muted: #5e6975;
  --line: #d9e0e6;
  --soft: #f4f7f9;
  --soft-blue: #fff3ea;
  --white: #fff;
  --danger: #c03a4b;
  --danger-soft: #fff0f2;
  --warning: #9a6700;
  --warning-soft: #fff6d8;
  --success: #237a57;
  --success-soft: #eaf7f1;
  --sidebar: 248px;
  --shadow: 0 18px 48px rgba(18, 24, 32, .12);
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
.page-loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; color: var(--ink); background: rgba(255, 255, 255, .86); backdrop-filter: blur(3px); opacity: 1; visibility: visible; transition: opacity .22s ease, visibility .22s ease; }
.page-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loading-card { min-width: 170px; padding: 18px 22px; display: flex; align-items: center; justify-content: center; gap: 11px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(18, 24, 32, .12); font-size: 13px; font-weight: 750; }
.page-loading-spinner { width: 22px; height: 22px; display: inline-block; border: 3px solid #f2d4c0; border-top-color: var(--brand); border-radius: 50%; animation: page-loading-spin .72s linear infinite; }
@keyframes page-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-loading-spinner { animation-duration: 1.4s; } .page-loading { transition: none; } }

.quote-signature-page { min-height: 100vh; background: linear-gradient(135deg, #fff7f0 0%, #f4f7f9 48%, #fff0e4 100%); }
.quote-signature-shell { width: min(960px, 100%); margin: 0 auto; padding: 34px 20px 56px; }
.quote-signature-brand { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.quote-signature-brand img { width: 148px; max-height: 42px; object-fit: contain; object-position: left center; }
.quote-signature-brand p { margin: 0; color: var(--brand-dark); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
.quote-signature-card { padding: clamp(24px, 5vw, 48px); background: var(--white); border: 1px solid #f1d6c4; box-shadow: var(--shadow); }
.quote-signature-card h1 { margin: 5px 0 8px; font-size: clamp(28px, 4vw, 38px); }
.quote-signature-intro { color: var(--muted); }
.quote-signature-preview-notice { margin: 24px 0; padding: 13px 15px; color: #7b421e; background: var(--warning-soft); border-left: 4px solid var(--brand); font-size: 13px; }
.quote-signature-meta { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.quote-signature-meta div { min-height: 78px; padding: 14px 16px; border-right: 1px solid var(--line); }
.quote-signature-meta div:last-child { border-right: 0; }
.quote-signature-meta dt { color: var(--muted); font-size: 12px; }
.quote-signature-meta dd { margin: 5px 0 0; font-weight: 800; }
.quote-signature-section { margin-top: 30px; }
.quote-signature-section h2 { margin-bottom: 12px; font-size: 19px; }
.quote-signature-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.quote-signature-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.quote-signature-table th, .quote-signature-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.quote-signature-table th { color: #43505b; background: #f7f9fa; font-size: 12px; }
.quote-signature-table td:nth-child(n+2), .quote-signature-table th:nth-child(n+2) { text-align: right; }
.quote-signature-table tfoot th, .quote-signature-table tfoot td { color: var(--brand-dark); background: var(--soft-blue); border-bottom: 0; font-weight: 850; }
.quote-signature-name { display: grid; gap: 7px; color: #43505b; font-size: 12px; font-weight: 750; }
.quote-signature-name input { min-height: 46px; padding: 10px 12px; color: var(--ink); background: #f7f9fa; border: 1px solid var(--line); }
.quote-signature-pad { position: relative; min-height: 210px; margin-top: 16px; color: #99a3ab; background: repeating-linear-gradient(0deg, transparent 0, transparent 39px, #e7ecef 40px); border: 1px dashed #aeb9c3; touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; -webkit-touch-callout: none; }
.quote-signature-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; -webkit-touch-callout: none; }
.quote-signature-pad span { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 13px; }
.quote-signature-pad.has-signature span { display: none; }
.quote-signature-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 10px; }
.quote-signature-complete { margin-top: 30px; padding: 34px 24px; text-align: center; background: #f3faf6; border: 1px solid #b8dfca; }
.quote-signature-complete-icon { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; color: #19724b; background: #dff3e8; border-radius: 50%; font-size: 28px; font-weight: 850; }
.quote-signature-complete h2 { margin: 0; color: #19724b; font-size: 22px; }
.quote-signature-complete p { margin: 10px 0 0; color: #43505b; }
.quote-signature-complete-time { color: var(--ink) !important; font-weight: 750; }
.quote-signature-complete-hint { color: var(--muted) !important; font-size: 13px; }
@media (max-width: 640px) { .quote-signature-shell { padding: 20px 14px 38px; } .quote-signature-card { padding: 23px 18px; } .quote-signature-brand { align-items: flex-start; flex-direction: column; gap: 8px; } .quote-signature-meta { grid-template-columns: 1fr; } .quote-signature-meta div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); } .quote-signature-meta div:last-child { border-bottom: 0; } .quote-signature-actions { display: grid; grid-template-columns: 1fr; } }

body.session-restore-pending #partner-login-gateway { display: none !important; }
body.session-restore-pending #partner-portal-app.hidden { display: block !important; }

.login-gateway, .access-state-page {
  min-height: 100vh;
  padding: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff7f0 0%, #ffffff 58%, #fff0e4 100%);
}
.auth-gateway-shell { width: min(1020px, 100%); min-height: 650px; display: grid; grid-template-columns: .9fr 1.1fr; background: white; border: 1px solid #f1d6c4; box-shadow: var(--shadow); }
.auth-brand-panel { padding: 52px 46px; display: flex; flex-direction: column; color: #71330e; background: #fff3ea; border-right: 1px solid #f1d6c4; }
.auth-brand-panel img { width: 168px; max-height: 44px; object-fit: contain; object-position: left center; }
.auth-brand-panel .section-kicker { margin-top: 86px; }
.auth-brand-panel h1 { margin: 8px 0 20px; color: #652a08; font-size: 42px; line-height: 1.15; }
.auth-brand-panel > p:not(.section-kicker) { color: #7b5b44; }
.gateway-scope { margin-top: auto; padding: 18px; display: grid; gap: 5px; background: white; border-left: 4px solid var(--brand); }
.gateway-scope strong { color: var(--brand-dark); font-size: 12px; letter-spacing: .12em; }
.gateway-scope span { color: #4d6877; font-size: 12px; }
.auth-entry-panel { padding: 54px 62px; align-self: center; }
.auth-entry-panel h2 { margin: 5px 0 8px; font-size: 34px; }
.gateway-intro { margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.gateway-form { display: grid; gap: 15px; }
.gateway-form label { display: grid; gap: 6px; color: #43505b; font-size: 12px; font-weight: 750; }
.password-input-shell { position: relative; display: block; width: 100%; }
.password-input-shell input { width: 100%; padding-right: 48px; }
.password-visibility-toggle { position: absolute; top: 50%; right: 8px; width: 34px; height: 34px; padding: 7px; display: grid; place-items: center; color: #52616c; background: transparent; border: 0; cursor: pointer; transform: translateY(-50%); }
.password-visibility-toggle:hover, .password-visibility-toggle:focus-visible { color: var(--brand-dark); background: var(--soft-blue); outline: 2px solid rgba(0, 146, 227, .22); }
.password-visibility-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.preferred-area-fieldset { margin: 0; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); }
.preferred-area-fieldset legend { padding: 0 6px; color: #43505b; font-size: 12px; font-weight: 800; }
.preferred-area-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 8px; }
.preferred-area-row > span { padding-bottom: 12px; color: var(--brand-dark); font-size: 12px; font-weight: 900; text-align: center; }
.field-help { margin: -4px 0 0; color: var(--muted); font-size: 11px; }
.captcha-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.captcha-image { min-height: 48px; padding: 8px 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #9a460e; background: repeating-linear-gradient(-18deg, #fff7f1 0, #fff7f1 7px, #f8d8c2 8px, #f8d8c2 9px); border: 1px solid #e2b18e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 24px; font-weight: 900; letter-spacing: .28em; text-shadow: 1px 1px 0 white; user-select: none; }
.captcha-refresh { min-height: 48px; padding: 0 13px; color: var(--brand-dark); background: white; border: 1px solid #e2b18e; font-size: 11px; font-weight: 800; }
.captcha-refresh:hover { background: var(--soft-blue); }
.compact-form { padding: 0; }
.gateway-links { margin-top: 18px; display: flex; justify-content: space-between; gap: 12px; }
.gateway-links button { padding: 0; color: var(--brand-dark); background: transparent; border: 0; font-size: 12px; font-weight: 750; }
.demo-credentials { margin-top: 26px; padding: 14px 16px; display: grid; gap: 3px; color: #4e6674; background: var(--soft-blue); border-left: 3px solid var(--brand); font-size: 11px; }
.demo-credentials strong { color: var(--brand-dark); }
.support-card { padding: 18px; color: #3f5968; background: var(--soft-blue); border: 1px solid #f1d2be; }
.support-card ol { margin: 12px 0 0; padding-left: 20px; }
.access-state-card { width: min(560px, 100%); padding: 44px; text-align: center; background: white; border: 0; box-shadow: var(--shadow); }
.access-state-card > img { width: 150px; max-height: 42px; margin-bottom: 34px; object-fit: contain; }
.access-state-card > p:not(.section-kicker) { color: var(--muted); }
.state-icon { width: 58px; height: 58px; margin: 0 auto 22px; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: 28px; font-weight: 850; }
.pending-status { margin: 28px 0 20px; display: grid; grid-template-columns: 1fr 1.4fr; text-align: left; border: 1px solid var(--line); }
.pending-status span, .pending-status strong { padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 12px; }
.pending-status span { color: var(--muted); background: #f7f9fa; }
.pending-status strong:nth-last-child(-n+2), .pending-status span:nth-last-child(-n+2) { border-bottom: 0; }
.access-state-card .auth-security-note { margin-bottom: 22px; text-align: left; }
.password-change-card { text-align: left; }
.password-change-card > img { display: block; }
.password-change-card .text-button { margin-top: 18px; }
.admin-access-card { max-width: 620px; }
.security-shield { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 18px 18px 28px 28px; font-weight: 900; letter-spacing: .08em; }
.security-check-list { margin: 24px 0; padding: 18px; display: grid; gap: 9px; color: #7b421e; background: var(--soft-blue); border-left: 4px solid var(--brand); text-align: left; font-size: 12px; }
.admin-access-card .field-help { margin-top: 14px; }

.prototype-bar {
  min-height: 42px;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #33404b;
  background: #e8edf1;
  border-bottom: 1px dashed #a8b4be;
  font-size: 16px;
}
.prototype-bar strong { letter-spacing: .04em; }
.prototype-account { margin-left: auto; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.prototype-account-icon { width: 18px; height: 18px; fill: currentColor; }
.prototype-bar #partner-logout { margin-left: 0; }
.prototype-bar label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.prototype-bar select { min-height: 30px; border: 1px solid #aeb9c3; background: var(--white); }

.app-shell { min-height: calc(100vh - 42px); display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  height: 100dvh;
  overflow-y: auto;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
.brand-block { padding: 0 10px 25px; border-bottom: 1px solid var(--line); }
.brand-block img { width: 144px; max-height: 40px; object-fit: contain; object-position: left center; }
.product-name { margin-top: 18px; font-size: 19px; font-weight: 800; line-height: 1.25; }
.product-name span { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.sidebar nav { margin-top: 24px; display: grid; gap: 6px; }
.nav-item {
  width: 100%; min-height: 46px; padding: 0 12px;
  display: flex; align-items: center; gap: 12px;
  color: #53616c; background: transparent; border: 0; text-align: left; font-weight: 700;
}
.nav-item span { color: #87949e; font-size: 11px; letter-spacing: .08em; }
.nav-item b { font: inherit; }
.nav-item:hover { color: var(--brand-dark); background: #fff4ea; }
.nav-item.active { color: #9b3f0b; background: var(--soft-blue); border-left: 3px solid var(--brand); }
.nav-group-toggle { width: 100%; min-height: 46px; padding: 0 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; color: #53616c; background: transparent; border: 0; text-align: left; font-weight: 800; }
.nav-group-toggle > span { color: #87949e; font-size: 11px; letter-spacing: .08em; }
.nav-group-toggle > b { font: inherit; }
.nav-group-toggle > i { color: var(--brand-dark); font-size: 17px; font-style: normal; }
.nav-group-toggle:hover, .nav-group-toggle.open { color: #9b3f0b; background: #fff4ea; }
.nav-submenu { margin: -2px 0 4px 28px; padding: 5px 0 5px 9px; display: grid; gap: 2px; border-left: 1px solid #e8c5aa; }
.nav-subitem { min-height: 36px; padding: 0 9px; font-size: 12px; }
.scope-note { margin-top: auto; padding: 18px; border: 1px solid #f1cbb2; background: var(--soft-blue); }
.scope-note strong { color: var(--brand-dark); font-size: 12px; letter-spacing: .08em; }
.scope-note p { margin: 8px 0 0; color: #7b5c45; font-size: 12px; }

.main-content { min-width: 0; }
@media (min-width: 821px) { .main-content { grid-column: 2; } }
.topbar {
  min-height: 92px;
  padding: 20px 32px;
  display: flex; align-items: center; gap: 18px;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 2px 0 0; font-size: 25px; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }
.menu-button { display: none; }
.eyebrow, .section-kicker { margin-bottom: 4px; color: var(--brand-dark); font-size: 11px; font-weight: 850; letter-spacing: .13em; }

.view { display: none; padding: 30px 32px 56px; }
.view.active { display: block; }
.context-row { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.context-row h2 { margin: 2px 0 0; font-size: 28px; }
.data-stamp, .subtle { margin: 0; color: var(--muted); font-size: 12px; }

.button {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); background: var(--white); color: var(--ink); font-weight: 750;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--white); background: var(--brand); border-color: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { border-color: var(--line); }
.button-quiet { border-color: var(--line); color: var(--muted); background: var(--soft); }
.button:disabled, .row-action:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.text-button { padding: 0; color: var(--brand-dark); border: 0; background: transparent; font-weight: 800; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: white; font-size: 24px; line-height: 1; }
.full-width { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; min-height: 132px; padding: 20px; background: var(--white); border: 1px solid var(--line); }
.metric-card.urgent { border-top: 4px solid var(--danger); }
.metric-card.warning { border-top: 4px solid #e3a700; }
.metric-card.brand { border-top: 4px solid var(--brand); }
.metric-card p { margin: 0; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin: 10px 0 3px; font-size: 35px; line-height: 1; }
.metric-card span { color: var(--muted); font-size: 12px; }

.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.panel { padding: 22px; background: var(--white); border: 1px solid var(--line); }
.panel-header { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-header h3 { margin: 0; font-size: 19px; }
.priority-item { padding: 14px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; border-top: 1px solid var(--line); }
.priority-item:first-child { border-top: 0; }
.priority-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.priority-item button { align-self: center; }
.bar-row { margin-top: 14px; display: grid; grid-template-columns: 92px 1fr 24px; align-items: center; gap: 10px; font-size: 12px; }
.bar-track { height: 8px; background: #e8edf1; }
.bar-fill { height: 100%; background: var(--brand); }
.source-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); }
.source-item { padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-item:nth-child(even) { border-right: 0; }
.source-item strong { display: block; font-size: 22px; }
.source-item span { color: var(--muted); font-size: 12px; }
.region-row { padding: 12px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.region-row:first-child { border-top: 0; }
.region-row span { color: var(--muted); font-size: 12px; }

.view-toggle { display: flex; border: 1px solid var(--line); }
.view-toggle button { min-height: 34px; padding: 0 14px; border: 0; background: white; color: var(--muted); }
.view-toggle button.active { color: white; background: var(--brand); }
.filter-panel { padding: 16px; display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto auto; gap: 10px; align-items: end; background: var(--white); border: 1px solid var(--line); }
.management-filter { margin-bottom: 14px; grid-template-columns: repeat(5, minmax(140px, 1fr)) auto; }
.partner-filter-panel { grid-template-columns: repeat(3, minmax(180px, 1fr)) auto; }
.lead-filter-panel { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; }
.lead-filter-search { grid-column: span 4; }
.lead-filter-status, .lead-filter-source, .lead-filter-tag, .lead-filter-assignment, .lead-filter-role, .lead-filter-city { grid-column: span 2; }
.lead-filter-worker { grid-column: span 3; }
.lead-filter-overdue { grid-column: span 2; justify-content: center; }
.lead-filter-submit { grid-column: span 1; width: 100%; padding: 0 8px; }
.lead-filter-clear { grid-column: span 2; width: 100%; }
.filter-panel label, .modal label, .mobile-content label { display: grid; gap: 6px; color: #43505b; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; color: var(--ink); background: var(--white); border: 1px solid #bcc6ce; border-radius: 5px; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(225, 104, 17, .22); border-color: var(--brand); }
.checkbox-filter { min-height: 40px; display: flex !important; grid-template-columns: auto 1fr; align-items: center; white-space: nowrap; }
.checkbox-filter input, .consent input { width: 17px; min-height: 17px; }
.table-panel { margin-top: 14px; background: var(--white); border: 1px solid var(--line); }
.table-summary { padding: 14px 18px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.table-summary strong { color: var(--ink); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { padding: 12px 14px; color: var(--muted); background: #f7f9fa; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; letter-spacing: .05em; }
td { padding: 14px; border-bottom: 1px solid #edf0f2; font-size: 13px; vertical-align: top; }
tbody tr:hover { background: #f8fbfd; }
.customer-cell strong { display: block; font-size: 14px; }
.customer-cell span, .cell-meta { color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; min-height: 26px; padding: 4px 8px; align-items: center; border: 1px solid var(--line); border-radius: 5px; color: #43505b; background: #f5f7f8; font-size: 11px; font-weight: 750; white-space: nowrap; }
.badge.pending { color: var(--warning); border-color: #edd48c; background: var(--warning-soft); }
.badge.overdue { color: var(--danger); border-color: #efbdc4; background: var(--danger-soft); }
.badge.done { color: var(--success); border-color: #b9dfcf; background: var(--success-soft); }
.badge.priority-tag { color: #8a4c00; border-color: #efc57d; background: #fff4df; }
.tag-color-badge { font-weight: 750; }
.color-picker-field { min-height: 42px; padding: 5px 8px; display: flex; align-items: center; gap: 10px; background: white; border: 1px solid #bcc6ce; }
.color-picker-field input[type="color"] { width: 52px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.color-picker-field output { color: #43505b; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tag-multiselect { position: relative; }
.tag-multiselect > summary { min-height: 42px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: white; border: 1px solid #bcc6ce; cursor: pointer; list-style: none; }
.tag-multiselect > summary::-webkit-details-marker { display: none; }
.tag-multiselect[open] > summary { border-color: var(--brand); outline: 2px solid rgba(0,146,227,.16); }
.tag-multiselect-summary { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tag-selected-count, .tag-placeholder { color: var(--muted); font-size: 11px; }
.tag-chevron { color: var(--brand-dark); font-size: 18px; transition: transform .16s ease; }
.tag-multiselect[open] .tag-chevron { transform: rotate(180deg); }
.tag-multiselect-menu { position: absolute; z-index: 3; top: calc(100% + 4px); left: 0; right: 0; max-height: 210px; padding: 10px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; background: white; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(18,24,32,.14); }
.feature-tag-field { display: grid; gap: 6px; }
.feature-tag-field > span { color: #43505b; font-size: 12px; font-weight: 750; }
.feature-tag-field > small { color: var(--muted); font-size: 11px; }
.tag-option { min-height: 34px; width: auto; padding: 3px 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink); background: white; border: 1px solid var(--line); cursor: pointer; }
.tag-option:hover { border-color: var(--brand); background: var(--soft-blue); }
.tag-option.is-selected { border-color: var(--brand); background: var(--soft-blue); box-shadow: inset 0 0 0 1px var(--brand); }
.tag-option small { color: var(--muted); font-size: 10px; }
.tag-option-state { color: var(--brand-dark); font-size: 10px; font-weight: 800; }
.tag-option:disabled { opacity: .55; cursor: not-allowed; }
.tag-center-filter { margin-bottom: 14px; grid-template-columns: minmax(220px, 360px) 1fr; }
.tag-center-filter p { margin: 0; padding-bottom: 10px; color: var(--muted); font-size: 12px; }
.badge.source { color: var(--brand-dark); border-color: #f4cdb2; background: var(--soft-blue); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-action { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); font-size: 12px; font-weight: 750; }
.row-action:disabled { color: #a6b0b8; background: #f4f6f7; cursor: not-allowed; }
.empty-state { padding: 50px !important; color: var(--muted); text-align: center; }

.notice { margin-bottom: 16px; padding: 14px 16px; color: #254b60; background: var(--soft-blue); border-left: 4px solid var(--brand); font-size: 13px; }
.people-search-panel { margin-bottom: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(280px, 560px) auto; align-items: end; gap: 16px; background: white; border: 1px solid var(--line); }
.people-search-panel label { display: grid; gap: 6px; color: #43505b; font-size: 12px; font-weight: 750; }
.people-search-panel span { padding-bottom: 10px; color: var(--muted); font-size: 12px; }
.people-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.person-card { padding: 20px; background: white; border: 1px solid var(--line); }
.person-card-header { display: flex; justify-content: space-between; gap: 10px; }
.person-card h3 { margin-bottom: 4px; font-size: 18px; }
.person-card p { color: var(--muted); font-size: 12px; }
.area-list { min-height: 58px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.area-list .badge { margin: 0 5px 5px 0; }
.person-footer { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.table-area-list { min-height: 0; margin: 0; padding: 0; border: 0; }

.management-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.management-card { padding: 20px; background: white; border: 1px solid var(--line); }
.management-card-header { display: flex; justify-content: space-between; gap: 12px; }
.management-card h3 { margin-bottom: 4px; font-size: 18px; }
.management-card p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.management-card-stats { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); }
.management-card-stats div { padding: 12px; border-right: 1px solid var(--line); }
.management-card-stats div:last-child { border-right: 0; }
.management-card-stats strong, .management-card-stats span { display: block; }
.management-card-stats span { color: var(--muted); font-size: 10px; }
.management-card-footer { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }

.pagination-bar { margin-top: 14px; min-height: 52px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); background: white; border: 1px solid var(--line); font-size: 12px; }
.pagination-bar > div { display: flex; gap: 6px; }
.pagination-bar button:disabled { color: #a6b0b8; background: #f4f6f7; cursor: not-allowed; }
.pagination-bar .page-summary { color: var(--muted); white-space: nowrap; }

.role-matrix-panel, .partner-table-panel { overflow-x: auto; background: white; border: 1px solid var(--line); }
.role-matrix, .partner-table { min-width: 920px; }
.permission-yes { color: var(--success); font-weight: 800; }
.permission-no { color: #8c98a2; }
.permission-scope { color: var(--brand-dark); font-weight: 750; }
.fixed-link { max-width: 360px; display: block; overflow: hidden; color: var(--brand-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.partner-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.partner-application-panel { margin-bottom: 18px; }
.partner-list-heading { margin-top: 8px; }

.management-tabs { margin-bottom: 14px; padding: 8px; display: flex; gap: 6px; background: white; border: 1px solid var(--line); }
.management-tabs button, .auth-mode-switch button { min-height: 38px; padding: 0 16px; color: var(--muted); background: white; border: 1px solid var(--line); font-weight: 750; }
.management-tabs button.active, .auth-mode-switch button.active { color: white; background: var(--brand); border-color: var(--brand); }
.permission-panel { display: block; }
.panel-action-row { margin-bottom: 12px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: white; border: 1px solid var(--line); }
.panel-action-row h3 { margin-bottom: 3px; }
.panel-action-row p { margin: 0; color: var(--muted); font-size: 12px; }

.auth-flow-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); gap: 14px; align-items: start; }
.auth-flow-note, .auth-preview-shell { padding: 24px; background: white; border: 1px solid var(--line); }
.auth-flow-note h3 { font-size: 22px; }
.auth-flow-note ol { margin: 20px 0 0; padding-left: 22px; }
.auth-flow-note li { margin: 14px 0; color: #43505b; }
.auth-mode-switch { margin-bottom: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.auth-card { max-width: 460px; margin: 0 auto; }
.auth-card h3 { margin-bottom: 6px; font-size: 25px; }
.auth-card > p { color: var(--muted); font-size: 13px; }
.auth-card form { margin-top: 20px; display: grid; gap: 13px; }
.auth-divider { margin: 18px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); }
.auth-security-note { margin-top: 18px; padding: 12px; color: #496270; background: var(--soft-blue); border-left: 3px solid var(--brand); font-size: 11px; }
.account-actions { min-width: 310px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.danger-action { color: var(--danger); border-color: #e5b5bd; }
.danger-button { color: white; background: var(--danger); border: 1px solid var(--danger); }
.audit-filter { margin-bottom: 14px; grid-template-columns: minmax(280px, 1fr) minmax(180px, 280px); }

.wireframe-hub { min-height: 100vh; padding: 54px 28px; background: linear-gradient(135deg, #fff7f0, white 60%, #fff3ea); }
.wireframe-hub-inner { width: min(1120px, 100%); margin: 0 auto; }
.wireframe-hub-brand { width: 170px; margin-bottom: 54px; }
.wireframe-hub h1 { max-width: 760px; margin-bottom: 14px; font-size: clamp(36px, 6vw, 62px); line-height: 1.05; }
.wireframe-hub-intro { max-width: 760px; color: var(--muted); }
.entry-card-grid { margin-top: 38px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.entry-card { min-height: 310px; padding: 28px; display: flex; flex-direction: column; color: var(--ink); background: white; border: 1px solid var(--line); text-decoration: none; transition: .18s ease; }
.entry-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-3px); }
.entry-card-code { color: var(--brand-dark); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.entry-card h2 { margin: 18px 0 8px; font-size: 26px; }
.entry-card p { color: var(--muted); font-size: 13px; }
.entry-card ul { padding-left: 18px; color: #425866; font-size: 12px; }
.entry-card-action { margin-top: auto; color: var(--brand-dark); font-weight: 850; }
.hub-boundary { margin-top: 20px; padding: 18px; color: #365a6d; background: white; border-left: 4px solid var(--brand); font-size: 12px; }

.portal-app-header { position: sticky; top: 0; z-index: 30; min-height: 76px; padding: 12px 24px; display: flex; align-items: center; gap: 18px; background: white; border-bottom: 1px solid var(--line); }
.portal-app-header .brand-block { padding: 0; display: flex; align-items: center; gap: 14px; border: 0; }
.portal-app-header .brand-block img { width: 108px; }
.portal-app-header .product-name { margin: 0; font-size: 19px; white-space: nowrap; }
.portal-app-header .product-version { display: block; margin-top: 3px; color: #71808e; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.portal-user-card { margin-left: auto; display: grid; justify-items: end; gap: 2px; line-height: 1.2; }
.portal-user-account { color: #71808e; font-size: 12px; font-weight: 700; }
.portal-header-logout { flex: 0 0 auto; }
@media (min-width: 821px) {
  .portal-app-header { position: fixed; inset: 0 0 auto; }
  .portal-shell { padding-top: 76px; }
}
.portal-menu-toggle { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); background: white; color: var(--ink); cursor: pointer; font-weight: 700; white-space: nowrap; }
.portal-menu-toggle:hover, .portal-menu-toggle[aria-expanded="true"] { color: var(--brand-dark); background: #fff4ea; }
.portal-menu-toggle:focus-visible { outline: 3px solid rgba(225, 104, 17, .25); outline-offset: 2px; }
.portal-shell { min-height: calc(100vh - 76px); display: block; }
.portal-sidebar { padding: 12px 24px; background: white; border-bottom: 1px solid var(--line); }
.portal-sidebar[hidden] { display: none; }
.portal-sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.portal-user-card { margin-left: auto; display: grid; justify-items: end; gap: 2px; color: #365466; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.portal-user-card span { color: var(--muted); }
.portal-user-card .portal-user-account { color: #71808e; font-weight: 700; }
.portal-main { min-width: 0; }
.portal-view { display: none; padding: 30px; }
.portal-view.active { display: block; }
.task-card-list { display: grid; gap: 10px; }
.task-card { padding: 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--line); }
.task-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.security-setting-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.security-setting-card { padding: 22px; background: white; border: 1px solid var(--line); }
.security-setting-card h3 { margin: 14px 0 7px; }
.security-setting-card p { color: var(--muted); font-size: 12px; }
.security-setting-card form { margin-top: 16px; }
.portal-user-card span:last-child { margin-top: 0; }
.portal-view .task-card strong { display: block; }
.portal-view .empty-state { background: white; border: 1px solid var(--line); }
.metric-card-button { width: 100%; color: var(--ink); border-color: var(--line); text-align: left; cursor: pointer; }
.metric-card-button:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(18, 24, 32, .08); transform: translateY(-2px); }
.metric-card-button:focus-visible { outline: 3px solid rgba(225, 104, 17, .25); outline-offset: 2px; }
.priority-toggle { min-width: 98px; display: inline-flex; align-items: center; gap: 7px; color: #53616c; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.priority-toggle input { width: 17px; min-height: 17px; accent-color: var(--brand); }
.priority-toggle:has(input:checked) { color: var(--danger); }

.join-invite-card { margin-bottom: 20px; padding: 15px; display: grid; grid-template-columns: 1fr; gap: 10px; color: #34576a; background: var(--soft-blue); border-left: 4px solid var(--brand); }
.join-invite-card span, .join-invite-card strong { display: block; font-size: 11px; }
.join-invite-card span { color: var(--muted); }
.join-status-switch { position: fixed; z-index: 5; top: 14px; right: 14px; display: flex; gap: 5px; }
.join-status-switch a { padding: 7px 10px; color: var(--brand-dark); background: white; border: 1px solid var(--line); text-decoration: none; font-size: 10px; font-weight: 800; }
.partner-apply-shell { width: min(1180px, 100%); }
.partner-apply-panel { padding: 42px 50px; }
.partner-readonly-notice { margin-top: 16px; }
.partner-link-panel { max-width: 780px; }
.partner-link-panel h3 { margin: 14px 0 6px; font-size: 24px; }
.partner-link-panel .utm-box { margin: 18px 0; }

.public-intake-page { min-height: 100vh; background: linear-gradient(135deg, #fff8f2 0%, #f4f7f9 58%, #fff0e4 100%); }
.public-intake-header { width: min(960px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0; display: flex; align-items: center; gap: 14px; }
.public-intake-header img { width: 154px; max-height: 42px; object-fit: contain; }
.public-intake-header span { padding-left: 14px; color: #8b5a3a; border-left: 1px solid #edcdb7; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.public-intake-main { padding: 18px 20px 54px; display: grid; place-items: start center; }
.public-intake-frame { width: min(430px, 100%); }
.public-intake-frame .mobile-content { min-height: 0; }
.public-intake-frame .mobile-content h1 { margin: 5px 0 8px; font-size: 25px; }
.form-error { min-height: 24px; margin: 14px 0 0; color: var(--danger); font-size: 12px; }

.form-mode-switch { margin-bottom: 20px; padding: 10px; display: flex; align-items: end; gap: 8px; background: white; border: 1px solid var(--line); }
.form-mode-switch > button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); background: white; color: var(--muted); font-weight: 750; }
.form-mode-switch > button.active { color: white; background: var(--brand); border-color: var(--brand); }
.form-mode-switch label { min-width: 240px; margin-left: auto; display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.url-preview { max-width: 520px; padding: 9px 12px; overflow: hidden; color: var(--muted); background: #e8edf1; border: 1px dashed #a8b4be; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.form-preview-layout { display: grid; grid-template-columns: 390px minmax(300px, 560px); justify-content: center; align-items: start; gap: 34px; }
.mobile-frame { padding: 10px; background: #dfe7ec; border-radius: 28px; box-shadow: var(--shadow); }
.mobile-browser { padding: 10px 12px; overflow: hidden; color: #68737c; background: #eef1f3; border-radius: 19px 19px 0 0; font-size: 10px; white-space: nowrap; }
.mobile-content { min-height: 680px; padding: 28px 22px; background: white; border-radius: 0 0 19px 19px; }
.mobile-content h2 { margin: 5px 0 8px; font-size: 25px; }
.mobile-content > p { color: var(--muted); font-size: 13px; }
.mobile-brand { color: var(--brand) !important; font-weight: 850; letter-spacing: .08em; }
.mobile-content form { margin-top: 24px; display: grid; gap: 14px; }
.mobile-content label span { color: var(--danger); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent { display: grid !important; grid-template-columns: auto 1fr; align-items: start; font-weight: 500 !important; }
.annotation-panel { padding: 30px; background: white; border: 1px solid var(--line); }
.annotation-panel h3 { font-size: 24px; }
.annotation-panel ol { margin: 22px 0; padding-left: 22px; }
.annotation-panel li { margin: 12px 0; }
.boundary-card { margin-top: 28px; padding: 18px; color: #71330e; background: var(--soft-blue); border-left: 4px solid var(--brand); }
.boundary-card strong { color: var(--brand-dark); }
.boundary-card p { margin: 6px 0 0; color: #7b5c45; font-size: 13px; }
.success-state { padding-top: 80px; text-align: center; }
.public-intake-frame:has(.success-state) { padding: 0; background: transparent; border-radius: 19px; }
.public-intake-frame:has(.success-state) .mobile-content { background: white; border-radius: 19px; box-shadow: var(--shadow); }
.success-mark { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; color: white; background: var(--success); border-radius: 50%; font-size: 28px; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 42px 0 0; background: rgba(18,24,32,.38); opacity: 0; pointer-events: none; transition: .18s ease; z-index: 40; }
.drawer-backdrop.open, .modal-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-drawer { position: fixed; z-index: 41; top: 50%; left: 50%; width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 90px); height: auto; padding: 26px; overflow-y: auto; background: white; box-shadow: var(--shadow); transform: translate(-50%, -48%) scale(.98); opacity: 0; pointer-events: none; transition: .18s ease; }
.detail-drawer.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.drawer-header, .modal-header { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.drawer-header { padding-bottom: 18px; }
.drawer-header h2, .modal-header h2 { margin: 0; font-size: 25px; }
.detail-summary { padding: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-bottom: 1px solid var(--line); }
.detail-summary span, .info-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-summary strong, .info-item strong { display: block; margin-top: 4px; font-size: 13px; }
.drawer-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.drawer-section h3 { margin-bottom: 12px; font-size: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { position: relative; margin-left: 6px; padding-left: 22px; border-left: 1px solid #c9d3da; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: -27px; top: 4px; width: 9px; height: 9px; background: var(--brand); border: 3px solid white; box-shadow: 0 0 0 1px var(--brand); border-radius: 50%; }
.timeline-item strong { font-size: 13px; }
.timeline-item p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.timeline-item time { color: #84919b; font-size: 10px; }
.utm-box { padding: 14px; color: #4b5964; background: var(--soft); border: 1px dashed #adb9c2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }

.modal-backdrop { display: grid; place-items: center; z-index: 50; }
.modal { width: 1100px; max-width: calc(100vw - 32px); box-sizing: border-box; height: auto; max-height: calc(100vh - 90px); overflow-y: auto; padding: 24px; background: white; box-shadow: var(--shadow); transform: translateY(12px); transition: .18s ease; }
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { padding-bottom: 16px; }
#modal-body, #portal-order-modal-body { padding-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid > *, .form-grid .wide { min-width: 0; }
.address-area-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.worker-role-field { display: grid; gap: 8px; color: #43505b; font-size: 12px; font-weight: 750; }
.worker-role-options { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px; border: 1px solid var(--line); background: #fafcfd; }
.worker-role-field small { color: var(--muted); font-weight: 500; }
.service-area-editor { padding: 12px; border: 1px solid var(--line); background: #fafcfd; }
.service-area-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #43505b; font-size: 12px; font-weight: 750; }
.service-area-editor .area-list { min-height: 40px; margin-top: 8px; padding-top: 10px; }
.service-area-editor .badge button { margin-left: 6px; padding: 0; color: inherit; background: transparent; border: 0; cursor: pointer; }
.application-detail-grid { margin-top: 16px; }
.modal-footer { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
.candidate-list { display: grid; gap: 8px; }
.candidate-card { padding: 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); }
.candidate-card:has(input:checked) { border-color: var(--brand); background: var(--soft-blue); }
.candidate-card input { width: 17px; min-height: 17px; }
.candidate-card p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.candidate-rank { color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.modal-note { margin-bottom: 16px; padding: 12px; color: #66510a; background: var(--warning-soft); border-left: 3px solid #e0a900; font-size: 12px; }
.field-label { display: inline-block; white-space: nowrap; }
.required-marker { display: inline-block; color: #d62f2f; font-size: .7em; font-weight: 900; margin-left: 3px; white-space: nowrap; }
.money-input { min-height: 42px; display: grid; grid-template-columns: auto 1fr; align-items: center; border: 1px solid #bcc6ce; background: white; }
.money-input span { padding: 0 11px; color: var(--muted); font-size: 12px; font-weight: 800; border-right: 1px solid var(--line); }
.money-input input { min-height: 40px; border: 0; }
.money-input input:focus { outline: 2px solid rgba(0,146,227,.16); outline-offset: -2px; }
.quotation-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: #f7fafc; }
.quotation-result-grid.two-results { grid-template-columns: repeat(2, 1fr); }
.quotation-result-grid > div { min-height: 86px; padding: 14px; display: grid; align-content: center; gap: 7px; border-right: 1px solid var(--line); }
.quotation-result-grid > div:last-child { border-right: 0; }
.quotation-result-grid span { color: var(--muted); font-size: 11px; }
.quotation-result-grid strong { font-size: 18px; }

.inventory-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.inventory-overview-grid { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inventory-list-row { min-height: 66px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.inventory-list-row:first-child { border-top: 0; }
.inventory-list-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.inventory-filter { margin-bottom: 14px; grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(150px, 1fr)); }
.quantity-in { color: var(--success); }
.quantity-out { color: var(--danger); }
.order-inventory-summary { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.order-inventory-summary > div { min-height: 76px; padding: 12px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.order-inventory-summary > div:nth-child(3n) { border-right: 0; }
.order-inventory-summary > div:nth-last-child(-n+3) { border-bottom: 0; }
.order-inventory-summary span { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.modal-table { margin: 14px 0; border: 1px solid var(--line); }
.modal-table table { min-width: 760px; }
#shipment-form, #shipment-order-lines, #shipment-order-lines .table-scroll { width: 100%; min-width: 0; max-width: 100%; }
.modal:has(#shipment-form) { overflow-x: hidden; }
#shipment-order-lines .table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.order-action-footer { flex-wrap: wrap; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; min-width: 260px; padding: 12px 18px; color: white; background: var(--brand-dark); box-shadow: var(--shadow); text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden, .role-hidden { display: none !important; }

.compact-input {
  width: 76px;
  min-width: 64px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.compact-input:disabled { background: var(--soft-gray); color: var(--muted); }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .management-grid { grid-template-columns: repeat(2, 1fr); }
  .lead-filter-panel { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lead-filter-search { grid-column: span 3; }
  .lead-filter-status { grid-column: span 1; }
  .lead-filter-source { grid-column: span 2; }
  .lead-filter-tag, .lead-filter-assignment, .lead-filter-role, .lead-filter-city, .lead-filter-worker, .lead-filter-overdue { grid-column: span 2; }
  .lead-filter-submit, .lead-filter-clear { grid-column: span 3; }
}

@media (max-width: 820px) {
  select {
    min-height: 48px;
    padding: 11px 38px 11px 12px;
    font-size: 16px;
    line-height: 1.35;
  }
  select option { font-size: 16px; }
  .tag-multiselect > summary { min-height: 48px; padding: 10px 12px; font-size: 16px; }
  .tag-selected-count, .tag-placeholder { font-size: 16px; }
  .tag-multiselect-menu { max-height: 280px; gap: 10px; }
  .tag-option { min-height: 44px; padding: 8px 10px; font-size: 15px; }
  .tag-option small, .tag-option-state { font-size: 13px; }
  .login-gateway, .access-state-page { padding: 18px; }
  .auth-gateway-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; padding: 30px; border-right: 0; border-bottom: 1px solid #f1d6c4; }
  .auth-brand-panel .section-kicker { margin-top: 28px; }
  .auth-brand-panel h1 { font-size: 32px; }
  .gateway-scope { margin-top: 22px; }
  .auth-entry-panel { padding: 36px 30px; }
  .prototype-bar { padding: 8px 12px; flex-wrap: wrap; }
  .prototype-bar span { display: none; }
  .prototype-bar label { margin-left: auto; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 35; top: 42px; bottom: 0; left: 0; width: 260px; overflow-y: auto; overscroll-behavior: contain; transform: translateX(-105%); transition: .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-flex; min-height: 38px; align-items: center; border: 1px solid var(--line); background: white; }
  .topbar { padding: 16px; }
  .topbar-actions .button-secondary { display: none; }
  .topbar h1 { font-size: 19px; }
  .view { padding: 22px 16px 42px; }
  .context-row { align-items: flex-start; flex-direction: column; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .inventory-overview-grid { grid-template-columns: 1fr; }
  .filter-panel { grid-template-columns: repeat(2, 1fr); }
  .lead-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-filter-panel > * { grid-column: span 1; }
  .lead-filter-search, .lead-filter-worker, .lead-filter-clear { grid-column: span 2; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .management-grid { grid-template-columns: 1fr; }
  .people-search-panel { grid-template-columns: 1fr; }
  .form-mode-switch { align-items: stretch; flex-direction: column; }
  .form-mode-switch label { width: 100%; margin-left: 0; }
  .form-preview-layout { grid-template-columns: minmax(0, 390px); }
  .auth-flow-layout { grid-template-columns: 1fr; }
  .entry-card-grid { grid-template-columns: 1fr; }
  .portal-shell { display: block; }
  .portal-app-header { padding: 12px 16px; flex-wrap: wrap; }
  .portal-sidebar { padding: 12px 16px; }
  .portal-sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .security-setting-grid { grid-template-columns: 1fr; }
  .annotation-panel { order: 2; }
}

@media (max-width: 520px) {
  .entry-hub .entry-card-grid { grid-template-columns: 1fr; }
  .public-intake-header { width: calc(100% - 36px); padding: 16px 0; }
  .public-intake-header img { width: 136px; }
  .public-intake-header span { display: none; }
  .public-intake-main { padding: 0; display: block; }
  .public-intake-frame { width: 100%; }
  .modal { width: 1100px; max-width: calc(100vw - 16px); padding: 16px; }
  #shipment-form .modal-footer { flex-wrap: wrap; }
  #shipment-form .modal-footer .button { flex: 1 1 140px; }
  .login-gateway, .access-state-page { padding: 0; place-items: stretch; background: white; }
  .auth-gateway-shell { min-height: 100vh; border: 0; box-shadow: none; }
  .access-state-card { min-height: 100vh; }
  .auth-brand-panel { display: none; }
  .auth-entry-panel, .access-state-card { padding: 34px 22px; }
  .pending-status { grid-template-columns: 1fr; }
  .pending-status span, .pending-status strong { border-bottom: 1px solid var(--line) !important; }
  .prototype-bar strong { font-size: 10px; }
  .prototype-bar label { font-size: 10px; }
  .prototype-bar select { width: 150px; }
  .topbar-actions .button { padding: 0 10px; font-size: 12px; }
  .eyebrow { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .inventory-metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { font-size: 28px; }
  .filter-panel { grid-template-columns: 1fr; }
  .lead-filter-panel { grid-template-columns: 1fr; }
  .lead-filter-panel > *, .lead-filter-search, .lead-filter-worker, .lead-filter-clear { grid-column: span 1; }
  .people-grid { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .form-grid, .info-grid, .detail-summary, .address-area-row { grid-template-columns: 1fr; }
  .order-inventory-summary { grid-template-columns: 1fr; }
  .order-inventory-summary > div { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .order-inventory-summary > div:last-child { border-bottom: 0 !important; }
  .quotation-result-grid, .quotation-result-grid.two-results { grid-template-columns: 1fr; }
  .quotation-result-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .quotation-result-grid > div:last-child { border-bottom: 0; }
  .mobile-frame { padding: 0; border-radius: 0; box-shadow: none; }
  .mobile-browser { border-radius: 0; }
  .mobile-content { border-radius: 0; }
  .two-column { grid-template-columns: 1fr; }
  .preferred-area-row { grid-template-columns: 22px 1fr; }
  .preferred-area-row label:last-child { grid-column: 2; }
  .management-tabs { flex-direction: column; }
  .wireframe-hub { padding: 34px 18px; }
  .wireframe-hub-brand { margin-bottom: 34px; }
  .portal-sidebar nav { grid-template-columns: 1fr; }
  .portal-app-header { gap: 10px; }
  .portal-app-header .brand-block img { width: 76px; }
  .portal-app-header .product-name { font-size: 15px; }
  .portal-menu-toggle { order: 3; width: 100%; }
  .portal-view { padding: 22px 16px; }
  .join-invite-card { grid-template-columns: 1fr; }
  .join-status-switch { position: static; padding: 10px; justify-content: center; background: var(--soft-blue); }
}


/* v1.2.0 DEV brand and entry-page composition */
.dev-entry { min-height: 100vh; color: #2b211c; background: #fffaf7; }
.dev-entry-header { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dev-entry-brand { display: flex; align-items: center; gap: 14px; }
.dev-entry-brand img { width: 170px; height: auto; max-height: 48px; object-fit: contain; }
.dev-entry-brand span { padding-left: 14px; color: #8b5a3a; border-left: 1px solid #edcdb7; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.dev-entry-version { padding: 7px 11px; color: #9b3f0b; background: #fff0e4; border: 1px solid #f0c5a6; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.dev-entry-hero { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 42px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: center; gap: 56px; }
.dev-entry-kicker { margin: 0 0 14px; color: #b84c0a; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.dev-entry h1 { max-width: 640px; margin: 0 0 20px; color: #51280f; font-size: clamp(38px, 5vw, 64px); line-height: 1.08; }
.dev-entry-lede { max-width: 580px; margin: 0 0 28px; color: #765a46; font-size: 17px; line-height: 1.8; }
.dev-entry-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dev-entry-actions a { text-decoration: none; }
.dev-entry-preview { position: relative; padding: 28px; background: #fff; border: 1px solid #f0d7c5; box-shadow: 0 22px 55px rgba(138, 69, 20, .12); }
.dev-entry-preview::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 7px; background: #e16811; }
.dev-entry-preview-label { margin: 0 0 18px; color: #9b3f0b; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.dev-entry-preview h2 { margin: 0 0 20px; color: #51280f; font-size: 28px; }
.dev-entry-preview-list { margin: 0; padding: 0; display: grid; gap: 11px; list-style: none; }
.dev-entry-preview-list li { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; color: #654a38; background: #fff8f3; border: 1px solid #f3dfd1; font-size: 13px; }
.dev-entry-preview-list b { color: #b84c0a; }
.dev-entry-flow { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #f0d7c5; border: 1px solid #f0d7c5; }
.dev-entry-flow article { padding: 20px; background: #fff; }
.dev-entry-flow strong { display: block; margin-bottom: 5px; color: #b84c0a; font-size: 24px; }
.dev-entry-flow span { color: #765a46; font-size: 12px; }
.dev-entry-footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 60px; color: #8b6b57; font-size: 12px; }
.dev-entry-footer a { color: #b84c0a; font-weight: 850; }
.dev-entry .button-primary { box-shadow: 0 9px 22px rgba(225, 104, 17, .2); }
.wireframe-hub { background: #fffaf7; }
.wireframe-hub-inner { max-width: 1180px; }
.wireframe-hub-brand { width: 190px; height: auto; max-height: 52px; }
.wireframe-hub h1 { color: #51280f; }
.entry-card { border-color: #f0d7c5; box-shadow: 0 8px 24px rgba(138, 69, 20, .06); }
.entry-card:hover { border-color: #e16811; box-shadow: 0 14px 30px rgba(138, 69, 20, .12); }
.entry-card-code, .entry-card-action { color: #b84c0a; }
.entry-hub-page { min-height: 100vh; background: #fffaf7; }
.entry-hub { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 64px; }
.entry-hub-brand { display: block; width: 190px; height: auto; margin-bottom: 42px; }
.entry-hub .entry-card-grid { margin-top: 0; gap: 18px; }
.entry-hub .entry-card { min-height: 238px; padding: 27px 26px 24px; border-top: 4px solid #e7650c; box-shadow: 0 8px 24px rgba(37, 45, 52, .06); }
.entry-hub .entry-card h2 { margin-top: 18px; }
.entry-hub .entry-card-action { padding-top: 28px; }
.hub-boundary { background: #fff3ea; border-color: #f0d7c5; }
@media (max-width: 820px) {
  .dev-entry-header, .dev-entry-hero, .dev-entry-flow, .dev-entry-footer { width: min(100% - 32px, 640px); }
  .entry-hub { width: min(100% - 32px, 440px); padding-top: 26px; }
  .entry-hub-brand { width: 165px; margin-bottom: 30px; }
  .entry-hub .entry-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .entry-hub .entry-card { min-height: 190px; }
  .dev-entry-header { padding: 18px 0; }
  .dev-entry-brand span { display: none; }
  .dev-entry-hero { padding-top: 38px; grid-template-columns: 1fr; gap: 30px; }
  .dev-entry-lede { font-size: 15px; }
  .dev-entry-flow { grid-template-columns: 1fr; }
}
/* Internal company news */
.portal-news-panel { margin-top: 18px; }
.task-card[href] { text-decoration: none; color: inherit; }
.news-detail-page { background: #f4f7f9; }
.news-detail-shell { max-width: 900px; margin: 0 auto; padding: 40px 20px; display: grid; gap: 16px; }
.news-article { padding: 34px; }
.news-article h1 { margin: 4px 0 8px; font-size: clamp(26px, 4vw, 40px); }
.news-publish-at { color: #607080; font-size: 15px; }
.news-article-summary { border-left: 3px solid #e96a00; padding-left: 12px; color: #455463; }
.news-article-content { margin-top: 28px; line-height: 1.85; overflow-wrap: anywhere; }
.news-article-content img { max-width: 100%; height: auto; border-radius: 5px; }
.news-article-content iframe { width: 100%; min-height: 360px; border: 0; border-radius: 5px; }
@media (max-width: 720px) { .news-article { padding: 22px; } .news-article-content iframe { min-height: 210px; } }
