/* 認證報價中心 — Design System
   風格：專業 B2B、淺色高級感、藍青主色、卡片分層、細緻陰影
   ============================================================ */
:root {
  --ink: #0e1b2c;
  --ink-2: #33445c;
  --ink-3: #6b7c93;
  --line: #dfe6ef;
  --line-soft: #eaeff6;
  --bg: #f3f6fa;
  --card: #ffffff;
  --brand: #0b4f8a;
  --brand-2: #0d6ab8;
  --brand-soft: #e8f1fa;
  --accent: #0aa2a8;
  --accent-soft: #e4f6f6;
  --gold: #b98a2f;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #1e8e5a;
  --ok-soft: #e6f5ee;
  --warn: #b9770e;
  --warn-soft: #fdf3e2;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow-1: 0 1px 2px rgba(14,27,44,.05), 0 4px 16px rgba(14,27,44,.06);
  --shadow-2: 0 2px 6px rgba(14,27,44,.08), 0 16px 40px rgba(14,27,44,.10);
  --font-num: "Manrope", "Noto Sans TC", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(13,106,184,.09), transparent 60%),
    radial-gradient(900px 450px at -10% 110%, rgba(10,162,168,.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ─── Auth 頁 ─── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-panel {
  width: 100%; max-width: 900px; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-2);
  border: 1px solid var(--line-soft);
}
.auth-hero {
  background: linear-gradient(160deg, #0b3a66 0%, #0b4f8a 45%, #0d6ab8 100%);
  color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(500px 260px at 110% 0%, rgba(10,162,168,.35), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 14px);
}
.auth-hero > * { position: relative; }
.hero-brand { display: flex; align-items: center; gap: 12px; }
.hero-logo {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-num); font-weight: 800; font-size: 19px; letter-spacing: .5px;
  border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(4px);
  overflow: hidden;
}
.hero-logo.logo-mark { padding: 5px; background: rgba(255,255,255,.94); }
.hero-logo.company-mark { padding: 0; background: transparent; border-color: rgba(255,255,255,.18); }
.hero-logo.logo-mark img, .hero-logo.company-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.hero-brand small { display: block; opacity: .75; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; }
.hero-brand b { font-size: 17px; letter-spacing: 1px; }
.hero-brand.text-only b { font-size: 19px; letter-spacing: .8px; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 24px; }
.mobile-brand small { display: block; color: var(--ink-3); font-size: 11px; letter-spacing: 2px; font-weight: 800; }
.mobile-brand b { display: block; color: var(--ink); font-size: 16px; letter-spacing: .5px; }
.hero-title { font-size: 30px; font-weight: 900; line-height: 1.35; margin-top: 36px; }
.hero-title em { font-style: normal; color: #8fd7db; }
.hero-sub { margin-top: 14px; font-size: 14px; color: rgba(255,255,255,.82); max-width: 340px; }
.hero-points { margin-top: 28px; display: grid; gap: 12px; }
.hero-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.92); }
.hero-point .dot {
  width: 20px; height: 20px; flex: none; border-radius: 6px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 11px; margin-top: 2px;
}
.hero-foot { font-size: 11.5px; color: rgba(255,255,255,.55); letter-spacing: 1px; margin-top: 40px; }

.auth-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h2 { font-size: 22px; font-weight: 700; }
.auth-form .lead { color: var(--ink-3); font-size: 13.5px; margin: 6px 0 26px; }
.tabs { display: flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 26px; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-3); transition: all .18s;
}
.tabs button.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: var(--shadow-1); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .3px; }
.field input, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 11px 14px; background: #fbfcfe; transition: border-color .15s, box-shadow .15s; color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(13,106,184,.12); background: #fff;
}
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-md); padding: 12px 22px; font-size: 14.5px; font-weight: 700;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn-primary {
  width: 100%; color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 18px rgba(11,79,138,.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(11,79,138,.34); }
.btn-primary:disabled { opacity: .55; transform: none; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); padding: 8px 16px; font-size: 13px; }
.btn-ghost:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: #fff; color: var(--danger); border: 1.5px solid #f0c4bd; }

.notice { border-radius: var(--r-md); padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; display: none; }
.notice.err { display: block; background: var(--danger-soft); color: var(--danger); border: 1px solid #f2cbc5; }
.notice.ok { display: block; background: var(--ok-soft); color: var(--ok); border: 1px solid #c4e8d6; }

/* ─── App 佈局 ─── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: linear-gradient(180deg, #0b3a66, #0c456f 60%, #0b4f8a);
  color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 22px 20px 18px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand .hero-logo { width: 38px; height: 38px; font-size: 16px; }
.side-brand div b { font-size: 14.5px; display: block; letter-spacing: .5px; }
.side-brand div small { font-size: 10.5px; opacity: .65; letter-spacing: 2px; }
.nav { padding: 16px 12px; display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.75); text-decoration: none;
  padding: 11px 13px; border-radius: 10px; font-size: 14px; transition: all .15s;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.nav .ico { width: 20px; text-align: center; font-size: 15px; }
.nav .badge {
  margin-left: auto; background: var(--gold); color: #fff; font-size: 10.5px; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; color: rgba(255,255,255,.5); }
.side-user { padding: 14px 20px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), #0d84b8); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.side-user .nm { font-size: 13px; font-weight: 700; line-height: 1.3; }
.side-user .rl { font-size: 10.5px; opacity: .6; }
.side-user button { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8); border-radius: 8px; padding: 5px 10px; font-size: 11.5px; }
.side-user button:hover { background: rgba(255,255,255,.12); }

.main { flex: 1; padding: 30px 38px 60px; max-width: 1220px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 900; letter-spacing: .3px; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.crumb { font-size: 12px; color: var(--ink-3); letter-spacing: .5px; margin-bottom: 4px; }
.crumb b { color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card + .card { margin-top: 20px; }
.card-h { padding: 18px 24px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.card-h h3 { font-size: 15.5px; font-weight: 700; }
.card-h .stepno {
  width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  font-family: var(--font-num); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.card-h .right { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.card-b { padding: 22px 24px; }

/* 統計卡 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-2); border-radius: 4px 0 0 4px; }
.stat.teal::after { background: var(--accent); }
.stat.gold::after { background: var(--gold); }
.stat .k { font-size: 12px; color: var(--ink-3); font-weight: 700; letter-spacing: .8px; }
.stat .v { font-family: var(--font-num); font-size: 27px; font-weight: 800; margin-top: 4px; color: var(--ink); }
.stat .d { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* 表單網格 */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* 產品類別選擇 */
.ptype-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.ptype {
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fbfcfe;
  padding: 16px 8px 13px; text-align: center; transition: all .15s; user-select: none;
}
.ptype:hover { border-color: var(--brand-2); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.ptype.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.ptype .ic { font-size: 25px; }
.ptype .nm { font-size: 13px; font-weight: 700; margin-top: 6px; }
.ptype.on .nm { color: var(--brand); }

/* 地區卡 */
.region-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.region-chip {
  display: flex; align-items: center; gap: 9px; border: 1.5px solid var(--line); background: #fbfcfe;
  border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 14px; transition: all .15s;
}
.region-chip .flag { font-size: 17px; }
.region-chip.on { border-color: var(--accent); background: var(--accent-soft); color: #067a7f; box-shadow: inset 0 0 0 1px var(--accent); }
.region-pane { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 14px; background: #fbfdff; }
.region-pane.off { display: none; }
.region-pane h4 { font-size: 14px; font-weight: 800; color: var(--brand); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.region-pane h4 .tag { font-size: 10.5px; background: var(--brand-soft); padding: 2px 9px; border-radius: 20px; letter-spacing: 1px; }
.sec-label { font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: 1.2px; margin: 18px 0 10px; text-transform: uppercase; }
.sec-label:first-child { margin-top: 0; }

.numfield { display: flex; flex-direction: column; }
.numfield label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; min-height: 32px; display:flex; align-items:flex-end; }
.numfield input {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff;
  font-family: var(--font-num); font-weight: 700; font-size: 15px; text-align: center; color: var(--ink);
}
.numfield input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(13,106,184,.1); }


.side-brand.text-brand { justify-content: flex-start; min-height: 78px; }
.side-brand.text-brand div b { font-size: 16px; }
.textareafield { display: flex; flex-direction: column; }
.textareafield label { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; min-height: 22px; }
.textareafield textarea {
  width: 100%; min-height: 78px; resize: vertical; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 11px; background: #fff; color: var(--ink); line-height: 1.45;
}
.textareafield textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(13,106,184,.1); }
.textareafield small { color: var(--ink-3); font-size: 11px; margin-top: 4px; }
.reg-note { border: 1px solid #d7e8f6; background: #f3f9ff; color: var(--ink-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; margin-bottom: 14px; }
.reg-note b { color: var(--brand); }
.reg-note small { color: var(--ink-3); }
.source-note { margin-bottom: 18px; }
.wwan-global { margin-bottom: 20px; }
.wwan-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.derived-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.derived-counts span { background: #eef4fb; color: var(--ink-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 9px; font-size: 11.5px; }
.derived-counts b { font-family: var(--font-num); color: var(--brand); }
.manual-extra { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.manual-extra summary { cursor: pointer; color: var(--brand); font-weight: 800; font-size: 12.5px; margin-bottom: 10px; }

/* switch */
.switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sw {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 11px 14px; background: #fbfcfe; font-size: 13.5px; font-weight: 600; user-select: none; transition: all .15s;
}
.sw:hover { border-color: var(--brand-2); }
.sw.on { border-color: var(--accent); background: var(--accent-soft); color: #067a7f; }
.sw .box {
  width: 19px; height: 19px; border-radius: 6px; border: 2px solid var(--line); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; transition: all .15s;
}
.sw.on .box { background: var(--accent); border-color: var(--accent); }

/* 單價 */
.rate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rate-card { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; background: #fbfcfe; }
.rate-card b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rate-card .in { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.rate-card input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: var(--font-num); font-weight: 800; font-size: 17px; text-align: right; min-width: 0;
}
.rate-card input:focus { outline: none; border-color: var(--brand-2); }
.rate-card .cur { font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* 結果區 */
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rg-card {
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow-1);
}
.rg-head { padding: 14px 18px; color: #fff; display: flex; align-items: center; gap: 9px; font-weight: 800; }
.rg-head.ce { background: linear-gradient(135deg, #1a4f8f, #2569b3); }
.rg-head.fcc { background: linear-gradient(135deg, #8a1f2d, #b03445); }
.rg-head.ic { background: linear-gradient(135deg, #9a600e, #c07d1a); }
.rg-body { padding: 16px 18px; }
.rg-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.rg-line b { font-family: var(--font-num); font-size: 14px; }
.rg-amount { font-family: var(--font-num); font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.rg-amount small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.grand {
  margin-top: 18px; border-radius: var(--r-lg); padding: 22px 26px; color: #fff;
  background: linear-gradient(135deg, #0b3a66, #0d6ab8 70%, #0aa2a8 130%);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  box-shadow: var(--shadow-2);
}
.grand .lab { font-size: 13px; opacity: .8; letter-spacing: 1.5px; font-weight: 700; }
.grand .amt { font-family: var(--font-num); font-size: 34px; font-weight: 800; }
.grand .hrs { font-size: 13px; opacity: .85; }

/* 明細表 */
.table-wrap { overflow-x: auto; }
table.detail { width: 100%; border-collapse: collapse; font-size: 13px; }
table.detail th {
  text-align: left; padding: 9px 10px; background: var(--bg); color: var(--ink-3);
  font-size: 11px; letter-spacing: .8px; font-weight: 800; border-bottom: 1.5px solid var(--line); white-space: nowrap;
}
table.detail td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.detail tbody tr:nth-child(even) td { background: #f8fafd; }
table.detail td.num { font-family: var(--font-num); font-weight: 700; text-align: right; white-space: nowrap; }
table.detail tr:hover td { background: #eef4fb; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 20px; letter-spacing: .5px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.cond { background: var(--warn-soft); color: var(--warn); }
.pill.tbc { background: var(--danger-soft); color: var(--danger); }
.pill.zero { background: var(--line-soft); color: var(--ink-3); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }
.pill.disabled { background: var(--line-soft); color: var(--ink-3); }
.pill.admin { background: var(--brand-soft); color: var(--brand); }
.pill.ce { background: #e7eefb; color: #1a4f8f; }
.pill.fcc { background: #fbe9ec; color: #8a1f2d; }
.pill.icx { background: #fdf3e2; color: #9a600e; }

.assume { background: var(--warn-soft); border: 1px solid #f2e2c0; border-radius: var(--r-md); padding: 14px 18px; margin-top: 16px; }
.assume h5 { font-size: 13px; color: var(--warn); margin-bottom: 6px; }
.assume li { font-size: 12.5px; color: #7a5a14; margin-left: 18px; }

.empty { text-align: center; padding: 52px 20px; color: var(--ink-3); }
.empty .ic { font-size: 42px; opacity: .5; }
.empty p { margin-top: 10px; font-size: 14px; }

.actions-bar { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp 0.7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--ink); color: #fff; border-radius: 12px;
  padding: 13px 20px; font-size: 13.5px; box-shadow: var(--shadow-2); z-index: 99;
  animation: rise .25s ease; max-width: 380px;
}
.toast.err { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.modal-mask { position: fixed; inset: 0; background: rgba(14,27,44,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal { background: #fff; border-radius: var(--r-lg); max-width: 460px; width: 100%; padding: 26px; box-shadow: var(--shadow-2); }
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; }
.modal textarea { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 13px; min-height: 80px; resize: vertical; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.watermark { text-align: center; color: var(--ink-3); font-size: 11px; letter-spacing: 1.5px; margin-top: 44px; }

/* 列印 / PDF 報價摘要 */
.print-summary { margin-bottom: 22px; overflow: hidden; }
.print-title {
  padding: 24px 28px; color: #fff;
  background: linear-gradient(135deg, #0b3a66, #0d6ab8 75%, #0aa2a8 135%);
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.print-title small { display:block; opacity:.72; letter-spacing:2px; font-size:11px; font-weight:800; margin-bottom:4px; }
.print-title h2 { font-size: 24px; line-height: 1.35; }
.print-no { font-family: var(--font-num); font-size: 22px; font-weight: 900; opacity:.85; }
.print-meta { padding: 18px 24px; display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; border-bottom:1px solid var(--line-soft); }
.print-meta div { display:grid; gap:3px; }
.print-meta b { color: var(--ink-3); font-size: 11px; letter-spacing: 1px; }
.print-meta span { color: var(--ink); font-size: 13px; font-weight: 700; }
.print-totals { width:100%; border-collapse: collapse; }
.print-totals th, .print-totals td { padding: 10px 14px; border-bottom:1px solid var(--line-soft); text-align:right; font-family: var(--font-num); }
.print-totals th:first-child, .print-totals td:first-child { text-align:left; font-family: inherit; }
.print-totals th { background: var(--bg); color: var(--ink-3); font-size: 11px; letter-spacing: .8px; }
.print-totals tfoot td { font-weight: 900; background: #f8fafd; }
.print-assumptions { padding: 16px 24px; background: var(--warn-soft); color: #7a5a14; }
.print-assumptions b { color: var(--warn); }
.print-assumptions ul { margin: 6px 0 0 18px; font-size: 12.5px; }

@media (max-width: 980px) {
  .auth-panel { grid-template-columns: 1fr; max-width: 480px; }
  .auth-hero { display: none; }
  .mobile-brand { display: flex; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .side-brand { padding: 14px 16px; }
  .nav { display: flex; overflow-x: auto; padding: 10px 12px; gap: 8px; -webkit-overflow-scrolling: touch; }
  .nav a { flex: 0 0 auto; white-space: nowrap; padding: 10px 12px; }
  .side-foot { display: none; }
  .side-user { padding: 10px 16px; }
  .main { padding: 20px 16px 50px; max-width: none; }
  .ptype-row { grid-template-columns: repeat(3, 1fr); }
  .g3, .g4, .rate-row, .result-grid { grid-template-columns: 1fr 1fr; }
  .print-meta { grid-template-columns: repeat(2, 1fr); }
  .print-title { padding: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .auth-wrap { padding: 14px; align-items: flex-start; }
  .auth-form { padding: 28px 22px; }
  .tabs button { padding: 10px 0; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 21px; }
  .card-h, .card-b { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4, .rate-row, .result-grid, .print-meta { grid-template-columns: 1fr; }
  .ptype-row { grid-template-columns: repeat(2, 1fr); }
  .region-pane { padding: 14px; }
  .switches { grid-template-columns: 1fr; }
  .grand { display: block; }
  .grand .amt { font-size: 28px; }
  .print-title { display: block; }
  .print-no { margin-top: 8px; }
  .print-totals { min-width: 620px; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .modal-mask { padding: 12px; align-items: flex-end; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .sidebar, .actions-bar, .region-tabs, .toast, .btn, .nav { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #111; font-size: 11px; }
  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 18px; }
  .card { box-shadow: none; border-color: #bfc7d1; break-inside: avoid; border-radius: 8px; }
  .card-h { padding: 10px 12px; }
  .card-b { padding: 12px; }
  .print-summary { break-after: page; border-color:#9aa8b8; }
  .print-title { background: #0b4f8a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 18px 20px; }
  .print-title h2 { font-size: 20px; }
  .print-meta { grid-template-columns: repeat(2, 1fr); padding: 12px 14px; }
  .print-totals th, .print-totals td { padding: 7px 8px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .rg-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grand { background: #0b4f8a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 14px 16px; }
  .grand .amt { font-size: 24px; }
  table.detail { font-size: 9.5px; }
  table.detail th, table.detail td { padding: 5px 6px; }
  .watermark { margin-top: 18px; }
}


/* Single-version additions: language switch, live preview */
.lang-switch { display:flex; align-items:center; justify-content:flex-end; gap:5px; margin-bottom:18px; }
.lang-switch button { border:1px solid var(--line); background:#fff; color:var(--ink-3); border-radius:999px; padding:6px 10px; font-size:12px; font-weight:800; }
.lang-switch button.on { color:#fff; border-color:var(--brand); background:linear-gradient(135deg,var(--brand),var(--brand-2)); box-shadow:0 4px 12px rgba(11,79,138,.18); }
.lang-switch.compact { margin:0 4px 0 0; gap:3px; flex:0 0 auto; }
.lang-switch.compact button { padding:3px 6px; font-size:10px; border-color:rgba(255,255,255,.22); background:rgba(255,255,255,.08); color:rgba(255,255,255,.72); }
.lang-switch.compact button.on { background:#fff; color:var(--brand); border-color:#fff; }
.auto-preview { display:inline-flex; align-items:center; gap:8px; border:1.5px solid var(--line); border-radius:var(--r-md); padding:10px 14px; background:#fff; color:var(--ink-2); font-size:13px; font-weight:800; user-select:none; }
.auto-preview input { accent-color: var(--accent); }
@media(max-width:640px){ .actions-bar .auto-preview { width:100%; justify-content:center; } }



/* Standards integration: robust sidebar, filtered bands, standards guide */
.side-user { padding: 14px 16px; display: grid; gap: 9px; align-items: stretch; }
.side-user-main { display:flex; align-items:center; gap:10px; min-width:0; }
.side-user-info { min-width:0; flex:1; }
.side-user .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.side-user button { flex:none; margin-left:0; }
.lang-switch.compact { width:100%; justify-content:flex-start; margin:0; flex-wrap:wrap; gap:4px; }
.lang-switch.compact button { min-width:36px; padding:4px 7px; }
.force-row { display:inline-flex; align-items:center; gap:7px; color:var(--ink-2); font-size:12.5px; font-weight:800; background:#fff; border:1px solid var(--line); border-radius:999px; padding:7px 10px; cursor:pointer; }
.force-row input { accent-color:var(--accent); }
.filtered-out { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid #efd9a8; color:#76520a; font-size:12.5px; line-height:1.55; }
.filtered-out small { color:#8b6a1e; }
.reg-standards-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:16px; }
.std-card { border:1px solid var(--line-soft); border-radius:var(--r-md); padding:13px 14px; background:#fbfdff; }
.std-title { display:flex; justify-content:space-between; gap:8px; align-items:center; color:var(--ink-2); font-weight:900; font-size:13px; margin-bottom:9px; }
.std-title span { font-family:var(--font-num); color:var(--brand); }
.std-list { display:flex; flex-wrap:wrap; gap:7px; }
.std-chip { display:inline-flex; flex-direction:column; gap:1px; max-width:100%; border:1px solid #cfe0ef; background:#eef6ff; color:#15426b; border-radius:10px; padding:5px 8px; line-height:1.25; }
.std-chip b { font-size:11.5px; white-space:nowrap; }
.std-chip small { font-size:10px; color:#5f7891; max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.std-chip.tbc { background:var(--warn-soft); border-color:#ecd9a8; color:var(--warn); }
.std-chip.tbc small { color:#8b6a1e; }
@media (max-width:980px){
  .side-user { display:grid; grid-template-columns:1fr; padding:10px 14px; }
  .side-user-main { width:100%; }
  .lang-switch.compact { order:2; width:100%; justify-content:flex-start; margin-top:0; }
  .reg-standards-grid { grid-template-columns:1fr; }
}
@media (max-width:640px){
  .wwan-tools { align-items:stretch; }
  .wwan-tools .btn, .wwan-tools .force-row { width:100%; justify-content:center; }
  .std-chip small { max-width:260px; }
}

.std-preview { margin:10px 0 12px; }
.std-preview-title { display:flex; justify-content:space-between; align-items:center; gap:8px; font-weight:900; color:var(--ink-2); font-size:12.5px; margin-bottom:8px; }
.std-preview-title span { color:var(--brand); font-family:var(--font-num); }
.std-list.compact .std-chip { padding:4px 7px; }
.std-list.compact .std-chip b { font-size:11px; }
.std-list.compact .std-chip small { max-width:180px; }
