:root,
[data-palette="jinsheng"] {
  --bg: #F6F3EC;
  --card: #FFFDF8;
  --text: #161410;
  --muted: #5C574C;
  --gain: #1A7F5A;
  --loss: #B54A4A;
  --accent: #C9A227;
  --gold: #E8D48B;
  --line: #E4DFD2;
  --flat: #6F6A60;
  --warn: #C47A12;
  --input: #F6F3EC;
  --on-accent: #161410;
  --shadow: 0 4px 16px rgba(22, 20, 16, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang HK", "Noto Sans TC", "Helvetica Neue", sans-serif;
}

[data-theme="dark"],
[data-palette="jinsheng"][data-theme="dark"] {
  --bg: #0B0F14;
  --card: #151A21;
  --text: #F3EDE0;
  --muted: #A39E92;
  --gain: #2AA374;
  --loss: #C45A5A;
  --accent: #D4B24A;
  --gold: #E8D48B;
  --line: #2A2E34;
  --flat: #8B867A;
  --warn: #E0A04A;
  --input: #10151B;
  --on-accent: #0B0F14;
  --shadow: none;
}

/* B 墨金 */
[data-palette="mojin"] {
  --bg: #F7F5F0;
  --card: #FFFEF9;
  --text: #1A1A1A;
  --muted: #5E5C57;
  --gain: #1A7F5A;
  --loss: #B54A4A;
  --accent: #1A1A1A;
  --gold: #B8963E;
  --line: #E4E0D8;
  --flat: #6E6C67;
  --warn: #C47A12;
  --input: #F7F5F0;
  --on-accent: #F7F5F0;
  --shadow: 0 4px 16px rgba(26, 26, 26, 0.06);
}
[data-palette="mojin"][data-theme="dark"] {
  --bg: #141311;
  --card: #1C1B18;
  --text: #F4F0E8;
  --muted: #A8A39A;
  --gain: #2AA374;
  --loss: #C45A5A;
  --accent: #E8E2D6;
  --gold: #C9A56B;
  --line: #2E2C28;
  --flat: #8E8A82;
  --warn: #E0A04A;
  --input: #1A1916;
  --on-accent: #141311;
  --shadow: none;
}

/* C 綠漲 */
[data-palette="lvzhang"] {
  --bg: #F4F6F8;
  --card: #FFFFFF;
  --text: #12161C;
  --muted: #5B6573;
  --gain: #1A7F5A;
  --loss: #B54A4A;
  --accent: #1A7F5A;
  --gold: #C4A35A;
  --line: #E3E7EC;
  --flat: #6B7280;
  --warn: #C47A12;
  --input: #F4F6F8;
  --on-accent: #FFFFFF;
  --shadow: 0 4px 16px rgba(18, 22, 28, 0.06);
}
[data-palette="lvzhang"][data-theme="dark"] {
  --bg: #0B0F14;
  --card: #151A21;
  --text: #E8EDF2;
  --muted: #9AA3B2;
  --gain: #2AA374;
  --loss: #C45A5A;
  --accent: #2AA374;
  --gold: #D4B24A;
  --line: #2A313C;
  --flat: #8B93A1;
  --warn: #E0A04A;
  --input: #10151B;
  --on-accent: #0B0F14;
  --shadow: none;
}

/* D 勝印 */
[data-palette="shengyin"] {
  --bg: #F6F1EA;
  --card: #FFF8F2;
  --text: #2A1C18;
  --muted: #6A5A54;
  --gain: #1A7F5A;
  --loss: #B54A4A;
  --accent: #8E2F2A;
  --gold: #C4A06A;
  --line: #E8DDD4;
  --flat: #7A6C66;
  --warn: #C47A12;
  --input: #F6F1EA;
  --on-accent: #FFFFFF;
  --shadow: 0 4px 16px rgba(42, 28, 24, 0.06);
}
[data-palette="shengyin"][data-theme="dark"] {
  --bg: #14100E;
  --card: #1C1715;
  --text: #F3EBE4;
  --muted: #A89A94;
  --gain: #2AA374;
  --loss: #C45A5A;
  --accent: #A33B35;
  --gold: #D4B08A;
  --line: #2E2724;
  --flat: #8E827C;
  --warn: #E0A04A;
  --input: #1A1513;
  --on-accent: #FFFFFF;
  --shadow: none;
}

[data-cb="1"] {
  --gain: var(--gold);
  --loss: var(--warn);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-theme="dark"] input,
[data-theme="dark"] select { background: var(--input); }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px calc(var(--tab-h) + var(--safe-b) + 16px);
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0.02em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  display: block; object-fit: cover;
  background: #0B0F14;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--muted); font-size: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
[data-theme="dark"] .icon-btn { box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }

.view[hidden] { display: none !important; }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card, .hero-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
[data-theme="dark"] .card,
[data-theme="dark"] .hero-card {
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.hero-card { text-align: center; padding: 22px 16px 18px; }
.hero-amount {
  font-size: 34px;
  font-weight: 350;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 4px 0 6px;
}
.hero-amount.sm { font-size: 28px; }
.hero-amount.gain { color: var(--gain); }
.hero-amount.loss { color: var(--loss); }
.hero-amount.flat { color: var(--flat); }
.hero-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.hero-line {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text);
  margin-bottom: 10px;
}
.hero-line .dot { color: var(--muted); }
.hero-meta-row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted);
}

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.3;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.pill.outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.muted { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.ccy-badge {
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 13px;
  padding: 4px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--muted); }
.field input { text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; }
#f-symbol { text-align: left; }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.seg-btn {
  padding: 10px 8px; border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 14px;
}
.seg-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.triple, .double {
  display: grid; gap: 10px; margin-bottom: 4px;
}
.triple { grid-template-columns: repeat(3, 1fr); }
.double { grid-template-columns: 1fr 1fr; }

.fee-block { margin: 8px 0 12px; }
.fee-bar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; font-size: 13px;
}
.hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.chip-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg); color: var(--muted);
  font-size: 13px; white-space: nowrap;
}
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ccy-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; font-size: 12px; color: var(--muted);
}

.btn {
  display: block; width: 100%;
  min-height: 50px; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 16px; font-weight: 600;
  margin-top: 10px;
}
.btn.primary {
  background: var(--accent); color: var(--on-accent, #fff);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); font-weight: 500;
}
.btn.danger {
  background: transparent; color: var(--loss);
  border: 1px solid color-mix(in srgb, var(--loss) 45%, var(--line));
  font-weight: 500;
}
.btn.text {
  width: auto; min-height: auto; display: inline-block;
  margin: 0; padding: 8px 12px; color: var(--accent); font-weight: 500; font-size: 14px;
}
.btn:active { transform: scale(.985); }

.section { margin-top: 8px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 8px 2px 10px;
}
.section-head h2, .card-title {
  margin: 0; font-size: 18px; font-weight: 650;
}
.card-title .hint { display: inline; margin-left: 6px; }
.muted { color: var(--muted); font-size: 13px; }
.fineprint { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 10px 0 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list li:last-child { border-bottom: none; }
.list-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.list-left .sym { font-weight: 600; font-size: 15px; }
.list-right {
  text-align: right; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column; gap: 2px;
}
.list-right .amt { font-size: 15px; font-weight: 600; }
.list-right .pct { font-size: 12px; color: var(--muted); }
.list-right .gain, .gain { color: var(--gain); }
.list-right .loss, .loss { color: var(--loss); }
.list-right .flat, .flat { color: var(--flat); }

.empty-state {
  text-align: center; padding: 28px 12px 18px; color: var(--muted);
}
.empty-ico {
  width: 48px; height: 48px; margin: 0 auto 10px;
  border: 1.5px solid var(--line); border-radius: 14px;
  display: grid; place-items: center; font-size: 20px; color: var(--accent);
}
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 8px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.summary-card { text-align: center; }
.group-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.group-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--bg);
  font-size: 14px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
}
.group-row .g-label { color: var(--muted); font-size: 13px; }

.row-toggle {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.row-toggle:last-of-type { border-bottom: none; }
.row-toggle select { width: auto; min-width: 120px; padding: 8px 10px; }
.row-toggle input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

.tpl-block {
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.tpl-block:last-child { border-bottom: none; }
.tpl-name { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.tpl-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl-fields label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.tpl-fields input, .tpl-fields select { padding: 8px 10px; font-size: 14px; text-align: left; }

.about p { margin: 6px 0; font-size: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 11px; border-radius: 14px;
  padding: 6px 4px;
}
.tab-ico { font-size: 16px; line-height: 1; font-weight: 300; }
.tab.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet[hidden] { display: none !important; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  max-height: 88dvh; overflow: auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + var(--safe-b));
  border: 1px solid var(--line); border-bottom: none;
}
.sheet-head {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  padding: 6px 0 10px;
}
.sheet-head h2 { margin: 0; text-align: center; font-size: 17px; }
.sheet-body { font-size: 15px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 500; }
.sheet-actions { display: grid; gap: 8px; margin-top: 12px; }

@media (min-width: 480px) {
  .tabbar { left: 50%; transform: translateX(-50%); width: 480px; border-radius: 16px 16px 0 0; }
}

/* ——— v1.1 UX ——— */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

input, select { min-height: 48px; padding: 14px 14px; font-size: 16px; }
.seg-btn { min-height: 44px; padding: 12px 8px; }
.chip { min-height: 40px; padding: 10px 16px; font-size: 14px; }

.edit-banner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 12px; padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  font-size: 14px; font-weight: 600; color: var(--accent);
}
.edit-banner .btn.text { padding: 4px 8px; }

.field-sym { margin-bottom: 8px; }

.recent-syms { padding-bottom: 12px; margin-top: -2px; }
.recent-syms .chip.sym-chip {
  min-height: 32px; padding: 4px 12px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.02em;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.price-grid .field { margin-bottom: 0; }
.price-grid input { font-size: 18px; font-weight: 550; }

.suggest-sell {
  margin: 2px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.suggest-main {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}
.suggest-sub,
.suggest-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.fee-summary {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; min-height: 48px;
  padding: 10px 12px; margin: 4px 0 8px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); text-align: left;
}
.fee-summary-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fee-summary-label { font-size: 12px; color: var(--muted); }
.fee-summary-text { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 550; }
.fee-summary-right { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fee-summary .chev { color: var(--muted); transition: transform .18s; display: inline-block; }
.fee-summary[aria-expanded="true"] .chev { transform: rotate(180deg); }
.fee-block { margin: 0 0 8px; padding: 8px 4px 4px; }

.note-fold { margin: 4px 0 0; }
.note-fold summary {
  list-style: none; cursor: pointer;
  font-size: 13px; color: var(--muted); padding: 8px 0;
}
.note-fold summary::-webkit-details-marker { display: none; }
.note-fold summary::after { content: " ▾"; font-size: 11px; }
.note-fold .field { margin-bottom: 0; }

.sticky-hero { margin-bottom: 10px; padding: 16px 14px 14px; }

.action-bar {
  position: sticky;
  bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(58px, 0.72fr) 1.6fr minmax(58px, 0.72fr);
  gap: 8px;
  align-items: center;
  margin: 0 -16px;
  padding: 8px 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.action-bar .btn { width: auto; margin-top: 0; }
.action-bar .btn.compact { font-size: 14px; font-weight: 550; padding: 12px 8px; min-height: 50px; }

.list-item {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  min-height: 64px;
  display: block;
  cursor: default;
}
.list-item .list-actions {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex; width: 168px;
}
.list-item .list-actions button {
  flex: 1; height: 100%;
  font-size: 13px; font-weight: 600;
  color: #fff; border-radius: 0;
}
.list-item .list-actions .act-dup { background: var(--accent); }
.list-item .list-actions .act-edit { background: color-mix(in srgb, var(--text) 72%, var(--bg)); }
.list-item .list-actions .act-del { background: var(--loss); }
.list-item .list-main {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 64px; padding: 10px 4px;
  background: var(--bg);
  transition: transform .2s ease;
  cursor: pointer;
}
.list-item.open .list-main,
.list-item.swiped .list-main { transform: translateX(-168px); }
.list-item.dragging .list-main { transition: none; }
.list-more {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
  color: var(--muted); font-size: 18px; line-height: 1;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card);
}
.list-more[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 64px);
  transform: translateX(-50%) translateY(8px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500;
  z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.palette-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.palette-btn {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
  font-size: 14px;
  font-weight: 550;
}
.palette-btn.active {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, var(--card));
  box-shadow: 0 0 0 1px var(--accent);
}
.palette-swatch {
  width: 18px; height: 18px; border-radius: 6px;
  flex: 0 0 18px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.palette-btn .palette-name { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.palette-btn .palette-key { font-size: 11px; color: var(--muted); font-weight: 400; }

.about-wordmark {
  display: block;
  width: min(100%, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  margin: 10px 0 14px;
  background: #0B0F14;
  border: 1px solid var(--line);
}

/* ——— v1.4 標的 combobox ——— */
.combo {
  position: relative;
  z-index: 8;
  margin-bottom: 0;
}
.combo-anchor { position: relative; }
.field-sym { margin-bottom: 0; }
.field-sym > span { font-size: 12px; color: var(--muted); }

.combo-input {
  position: relative;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 6px 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
.combo-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

#f-symbol {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 52px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
#f-symbol:focus {
  border: 0;
  box-shadow: none;
}
#f-symbol::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-weight: 400;
}

.combo-selected {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  pointer-events: none;
}
.combo-selected .combo-code { flex: 0 0 auto; }
.combo-selected .combo-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.combo-selected[hidden] { display: none !important; }

.combo-input.is-committed #f-symbol {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  pointer-events: none;
}

.combo-icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border-radius: 10px;
}
.combo-icon-btn svg { width: 20px; height: 20px; display: block; }
button.combo-clear:hover { color: var(--text); }
.combo-search { pointer-events: none; }
.combo-clear[hidden],
.combo-search[hidden] { display: none !important; }

.combo-pattern {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
}
.combo-pattern[hidden] { display: none !important; }
.combo-pattern .combo-pattern-sub { color: var(--muted); }

.combo-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.combo-hint[hidden] { display: none !important; }
.combo-hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.combo-hint.is-applied { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }

.combo-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 24;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--text) 16%, transparent);
  overscroll-behavior: contain;
}
.combo-dropdown[hidden] { display: none !important; }
[data-theme="dark"] .combo-dropdown {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.combo-sec {
  padding: 10px 14px 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.combo-row {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: transparent;
  text-align: left;
  color: inherit;
  border-radius: 0;
}
.combo-row:first-of-type,
.combo-sec + .combo-row { border-top: none; }
.combo-row.active,
.combo-row[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.combo-row-l {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.combo-row-code {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
}
.combo-row-code .nm {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.combo-row-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.combo-row-meta .pill {
  padding: 1px 8px;
  font-size: 11px;
  line-height: 1.5;
  flex: 0 0 auto;
}
.combo-row .tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  flex: 0 0 auto;
}
.combo-row mark.hl,
.combo-add mark.hl {
  background: color-mix(in srgb, var(--gold) 70%, transparent);
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
  font: inherit;
}

.combo-add {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  border-radius: 0;
}
.combo-add b { color: var(--text); font-weight: 700; }
.combo-add.active,
.combo-add[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* 類別段移到標的下面，略收高度 */
#view-entry .seg {
  margin-top: 14px;
  margin-bottom: 14px;
}
#view-entry .seg-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 8px;
}

#view-entry .price-grid { margin-bottom: 8px; }
