/* Page-specific styles for the signed-in app and the login page. Shared pieces are in base.css. */

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth { flex: 1; width: 100%; max-width: 400px; margin: 0 auto; padding: var(--space-16) var(--space-4) var(--space-8); display: flex; flex-direction: column; align-items: stretch; }
.auth .lockup img { height: 26px; }
.auth-title { margin-top: var(--space-10); font-family: var(--font-sans); font-size: var(--type-title-size); line-height: var(--type-title-line); font-weight: var(--type-title-weight); letter-spacing: var(--type-title-tracking); }
:lang(zh) .auth-title { letter-spacing: 0; line-height: 38px; }
.auth-sub { margin-top: var(--space-2); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.auth-msg { margin-top: var(--space-5); border-radius: var(--radius-panel); align-items: flex-start; }
.auth-msg .dot { margin-top: 7px; }
.auth-buttons { margin-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
/* Until both boxes are ticked the buttons look off but stay pressable: a press points at the box that's missing. */
.auth-buttons .btn[aria-disabled="true"] { opacity: .4; }
.auth-buttons .btn-lg { width: 100%; gap: 10px; }
.auth-consents { margin-top: var(--space-8); display: flex; flex-direction: column; gap: var(--space-3); }
.auth-consent-msg { margin-top: var(--space-4); }
.auth-consents.need .auth-consent { color: var(--text); }
.auth-consent { margin: 0 calc(var(--space-2) * -1); padding: 6px var(--space-2); border-radius: var(--radius-field); }
.auth-consent.missing { color: var(--text); background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--late); }
.auth-consent.missing.pulse { animation: consent-pulse .9s var(--motion-easing); }
@keyframes consent-pulse { 0%, 30% { background: var(--fill-strong); } 100% { background: var(--fill); } }
@media (prefers-reduced-motion: reduce) { .auth-consent.missing.pulse { animation: none; } }
.auth-consent { color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.auth-consent a { color: var(--text); }
.auth-note { margin-top: var(--space-4); color: var(--text-3); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.auth-body .foot { margin-top: 0; }

/* ---------- Dashboard (design/samples/dashboard.html) ---------- */
.page-head { margin-bottom: var(--space-4); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-12); align-items: start; }
.hero-label { display: flex; align-items: baseline; gap: var(--space-2); min-height: var(--type-secondary-line); }
.hero-value { margin-top: var(--space-2); }
.hero-sub { margin-top: var(--space-2); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); min-height: var(--type-secondary-line); }
.cur-lines { margin-top: var(--space-2); display: flex; flex-direction: column; gap: var(--space-1); }
.cur-line { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
/* The tick labels sit in a gutter right of the plot, so the last point's dot and the line never run over them. */
.chart-box { --chart-gutter: 64px; position: relative; margin-top: var(--space-6); height: var(--size-hero-chart); padding-right: var(--chart-gutter); }
.chart { display: block; height: var(--size-hero-chart); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .prev { fill: none; stroke: var(--chart-prev); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .cursor { stroke: var(--rule); stroke-width: 1; opacity: 0; }
.chart-box.scrub .cursor { opacity: 1; }
.chart-ticks { position: absolute; inset: 0; pointer-events: none; }
.chart-ticks span { position: absolute; right: 0; width: calc(var(--chart-gutter) - 10px); text-align: right; transform: translateY(-50%); font-size: var(--type-caption-size); line-height: 16px; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-axis { position: absolute; left: 0; right: var(--chart-gutter); bottom: 0; display: flex; justify-content: space-between; font-size: var(--type-caption-size); line-height: 16px; color: var(--text-2); font-weight: 500; pointer-events: none; }
.chart-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--chart); box-shadow: 0 0 0 3px var(--bg); pointer-events: none; }
.chart-legend { display: flex; gap: var(--space-4); margin-top: var(--space-3); font-size: var(--type-secondary-size); color: var(--text-2); font-weight: 500; }
.chart-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--chart); vertical-align: middle; margin-right: 6px; }
.chart-legend i.prev { border-top: 1.5px dashed var(--chart-prev); }
.hero-foot { margin-top: var(--space-2); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.hero-foot.late { color: var(--late); font-weight: 600; }

.side-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); }
.side-head .note { color: var(--text-2); font-size: var(--type-secondary-size); }
.src-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding: 14px 0 13px; }
.src-row .val { text-align: right; }
.src-row .val small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
.src-row .val small.late { color: var(--late); font-weight: 600; }
.share { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); }
.share .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.share .bar span { display: block; height: 100%; background: var(--chart); border-radius: 2px; }
.share .pct { width: 3.2em; text-align: right; color: var(--text-2); font-size: var(--type-caption-size); font-weight: 500; }
.share .change { font-size: var(--type-caption-size); min-width: 5em; justify-content: flex-end; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-12); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.metric { padding: var(--space-5) var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.metric + .metric { border-left: 1px solid var(--hairline); }
.metric:first-child { padding-left: 0; }
.metric:last-child { padding-right: 0; }
.metric .top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.metric .spark { width: 112px; height: 32px; flex: none; }
.metric .m-foot { color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.metric .chg { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); min-height: var(--type-secondary-line); }

.thead { display: grid; column-gap: var(--space-4); padding: var(--space-3) 0 var(--space-2); color: var(--text-2); font-size: var(--type-caption-size); font-weight: 500; border-bottom: 1px solid var(--hairline); }
.apps .row, .apps .thead, .fols .row, .fols .thead { grid-template-columns: minmax(180px, 1.4fr) 1fr 1fr 140px 180px; }
.cell-chg { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.cell .t-value { display: block; }
.meta { color: var(--text-2); font-size: var(--type-secondary-size); text-align: right; white-space: nowrap; }
.meta a:not(.btn) { color: var(--negative); font-weight: 600; text-decoration: none; }
.row.placeholder .name b { color: var(--text-2); }
.row .spark { width: 120px; height: 28px; }

.others .row { grid-template-columns: minmax(180px, 1.4fr) 1fr 1fr; }
.others .cell-chg { font-size: var(--type-secondary-size); }
/* Loading: grey blocks where the numbers go (11-02 审查 I). */
.sk { display: block; border-radius: 6px; background: var(--fill); }
.o-group { padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); }
.o-group:last-child { border-bottom: 0; }
.o-head { display: flex; align-items: center; gap: var(--space-2); }
.o-head b { font-size: var(--type-secondary-size); font-weight: 600; }
.o-head .t2 { margin-left: auto; }
.o-grid { margin-top: var(--space-3); display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4) var(--space-6); }
.o-item .chg { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); min-height: var(--type-secondary-line); }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-10); }
}
@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .page-head .seg { align-self: stretch; }
  .page-head .seg button { flex: 1; min-width: 0; height: 36px; }
  .notice { border-radius: var(--radius-panel); align-items: flex-start; flex-wrap: wrap; padding: 12px 14px; }
  .notice .dot { margin-top: 7px; }
  .notice .btn { margin-left: 18px; }
  .t-hero { font-size: 44px; line-height: 48px; }
  .chart-box, .chart { height: 160px; }
  .metrics { grid-template-columns: 1fr; border-bottom: 0; }
  .metric, .metric:first-child, .metric:last-child { padding: var(--space-4) 0; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--hairline); }
  .apps .thead, .fols .thead { display: none; }
  .apps .row, .fols .row, .others .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .others .row .cell-chg { grid-column: 1 / -1; padding-left: 40px; }
  .apps .row .c-spark, .fols .row .c-spark { display: none; }
  .row .meta { grid-column: 1 / -1; text-align: left; }
  .row .c-second { text-align: right; }
}

/* ---------- First run (design/samples/first-run.html) ---------- */
.welcome-intro { margin: var(--space-8) 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: end; }
.welcome-intro h1 { font-family: var(--font-sans); font-size: var(--type-title-size); line-height: var(--type-title-line); font-weight: var(--type-title-weight); letter-spacing: var(--type-title-tracking); }
:lang(zh) .welcome-intro h1 { letter-spacing: 0; line-height: 50px; }
.welcome-intro p { margin-top: var(--space-3); color: var(--text-2); max-width: 600px; font-size: var(--type-body-size); line-height: var(--type-body-line); }
.trust { display: flex; gap: var(--space-5); font-size: var(--type-secondary-size); font-weight: 500; color: var(--text-2); white-space: nowrap; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { color: var(--text); }
.pick { margin-top: var(--space-10); }
.pick .section-head h2 { font-size: var(--type-section-size); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-10); }
.opt { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 20px; align-items: center; gap: var(--space-4); padding: 14px 10px; margin: 0 -10px; border-radius: var(--radius-field); color: inherit; text-decoration: none; transition: background var(--motion-duration-fast) var(--motion-easing); }
.opt::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 1px; background: var(--hairline); }
.opt:hover { background: var(--fill); text-decoration: none; }
.opt:hover::after { opacity: 0; }
.opt b { display: block; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 600; }
.opt small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
.opt .go { color: var(--text-2); font-size: 16px; transition: transform var(--motion-duration-fast) var(--motion-easing), color var(--motion-duration-fast) var(--motion-easing); }
.opt:hover .go { transform: translateX(3px); color: var(--text); }
.chip { font-size: var(--type-secondary-size); font-weight: 500; color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pair-logos { position: relative; width: 40px; height: 40px; }
.pair-logos .logo { position: absolute; width: 28px; height: 28px; }
.pair-logos .logo:first-child { left: 0; top: 0; }
.pair-logos .logo:last-child { right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--bg), inset 0 0 0 1px var(--hairline); }
.sub-head { margin-top: var(--space-8); font-size: var(--type-secondary-size); font-weight: 600; color: var(--text-2); padding-bottom: var(--space-2); }
.how { margin-top: var(--space-5); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); color: var(--text-2); }
.how b { color: var(--text); font-weight: 600; }
.ghost { margin-top: var(--space-12); }
.ghost .section-head a { color: var(--text); text-decoration: none; font-weight: 600; }
.ghost-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.g { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.g:first-child { padding-left: 0; }
.g + .g { border-left: 1px solid var(--hairline); }
.g .dash { font-family: var(--font-sans); font-size: var(--type-metric-size); line-height: var(--type-metric-line); font-weight: 300; color: var(--text-3); }
.g .from { display: flex; align-items: center; gap: 6px; margin-top: var(--space-2); color: var(--text-2); font-size: var(--type-secondary-size); font-weight: 500; flex-wrap: wrap; }
.phone { margin-top: var(--space-6); display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: var(--type-secondary-size); }
@media (max-width: 900px) {
  .welcome-intro { grid-template-columns: 1fr; }
  .trust { flex-wrap: wrap; }
  .grid2 { grid-template-columns: 1fr; }
  .ghost-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g:nth-child(3) { padding-left: 0; border-left: 0; }
  .g:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}

/* ---------- Connections (design/samples/connect.html) ---------- */
.p-row { grid-template-columns: 40px minmax(170px, 1fr) minmax(0, 1.5fr) 120px 236px; padding: 16px 0; }
.p-row.another { padding: 0 0 14px; border-bottom: 1px solid var(--hairline); }
.p-row.another .act { justify-content: flex-start; grid-column: 2 / -1; grid-row: 1; }
.p-row .who b { display: block; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 600; }
.p-row .who small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
.p-row .detail { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); color: var(--text-2); min-width: 0; }
.p-row .detail b { color: var(--text); font-weight: 500; }
.p-row .detail span + span::before { content: "·"; margin: 0 6px; color: var(--text-3); }
.keep-list { list-style: none; margin: 0; padding: 0; max-height: 44vh; overflow-y: auto; border-block: 1px solid var(--hairline); }
.keep-list li + li { border-top: 1px solid var(--hairline); }
.keep-list label { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding: 10px 0; cursor: pointer; }
.keep-list input { margin: 0; accent-color: var(--ink); }
.keep-list .who { min-width: 0; }
.keep-list .who b { display: block; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 600; }
.keep-list .who small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keep-count b { color: var(--text); font-weight: 600; }
.keep-count.bad, .keep-count.bad b { color: var(--negative); }
.status { display: flex; align-items: center; gap: 7px; font-size: var(--type-secondary-size); font-weight: 600; white-space: nowrap; }
.status.off { color: var(--text-2); font-weight: 500; }
.status.bad { color: var(--negative); }
.status.late { color: var(--late); }
.p-row .act { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-1); min-width: 150px; }
.p-row .why { grid-column: 2 / -1; margin-top: 8px; max-width: 640px; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); color: var(--text-2); }
.p-row .why details { margin-top: 4px; }
.p-row .why summary { cursor: pointer; color: var(--text-3); }
.p-row .why code { font-family: var(--font-mono); font-size: 12px; }
.p-row.flash { animation: flash 1.6s var(--motion-easing); }
@keyframes flash { 0%, 40% { background: var(--fill-strong); } 100% { background: transparent; } }
details.more { position: relative; }
details.more summary { list-style: none; letter-spacing: 1px; }
details.more summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 140px; padding: 4px; border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-overlay), inset 0 0 0 1px var(--hairline); display: flex; flex-direction: column; }
details.more .menu button, details.more .menu a { border: 0; color: inherit; text-decoration: none; white-space: nowrap; background: transparent; text-align: left; padding: 8px 10px; border-radius: calc(var(--radius-panel) - 4px); cursor: pointer; font-size: var(--type-secondary-size); }
details.more .menu button:hover, details.more .menu a:hover { background: var(--fill); }
details.more .menu button.danger { color: var(--negative); }

.setup { grid-column: 2 / -1; margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-8); padding: var(--space-6); border-radius: var(--radius-panel); background: var(--surface-2); }
.setup-simple { grid-template-columns: minmax(0, 520px); }
.setup .field input, .setup .field select { background: var(--bg); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 600; margin-top: -1px; }
.steps b { font-weight: 600; }
.mock { margin-top: var(--space-5); border-radius: var(--radius-field); background: var(--bg); box-shadow: inset 0 0 0 1px var(--hairline); padding: 14px 16px; font-size: 12px; line-height: 16px; }
.mock .mh { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 10px; }
.mock .issuer { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; box-shadow: inset 0 0 0 1.5px var(--ink); font-family: var(--font-mono); font-size: 11.5px; overflow: hidden; }
.mock .issuer em { font-style: normal; margin-left: auto; font-family: var(--font-sans); font-weight: 600; font-size: 11px; background: var(--ink); color: var(--on-ink); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.mock table { width: 100%; border-collapse: collapse; margin-top: 10px; color: var(--text-2); }
.mock th, .mock td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-weight: 500; }
.mock td.dl { text-align: right; color: var(--text); font-weight: 600; }
.mock td.dl span { box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 6px; padding: 2px 6px; }
.mock-note { margin-top: 6px; font-size: var(--type-caption-size); color: var(--text-2); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; border-radius: var(--radius-panel); background: var(--bg); border: 1.5px dashed var(--rule); text-align: center; cursor: pointer; transition: border-color var(--motion-duration-fast) var(--motion-easing); }
.drop.over, .drop:hover { border-color: var(--ink); }
.drop.has-file { border-style: solid; border-color: var(--positive); }
.drop .big { font-weight: 600; font-size: var(--type-secondary-size); }
.drop .hint { color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); max-width: 300px; }
.drop .hint.file { color: var(--text); font-weight: 600; }
.drop code { font-family: var(--font-mono); font-size: 12px; }
.fields { margin-top: var(--space-4); display: flex; flex-direction: column; gap: 12px; }
.setup-simple .fields { margin-top: 0; }
.setup .go { margin-top: var(--space-4); display: flex; align-items: center; gap: var(--space-3); }
.setup .go p { color: var(--text-2); font-size: var(--type-caption-size); line-height: 16px; }
.setup .form-error { margin-top: var(--space-3); }

.pairing { grid-column: 2 / -1; margin-top: 14px; padding: var(--space-5); border-radius: var(--radius-panel); background: var(--surface-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.pairing p { color: var(--text-2); margin-top: var(--space-2); }
.code-line { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.code-line code { font-family: var(--font-mono); font-size: 15px; padding: 6px 10px; border-radius: var(--radius-field); background: var(--bg); box-shadow: inset 0 0 0 1px var(--hairline); word-break: break-all; }
.keys { grid-column: 2 / -1; list-style: none; margin: 10px 0 0; padding: 0; }
.key-row { display: flex; align-items: center; gap: var(--space-3); padding: 6px 0; font-size: var(--type-secondary-size); }
.key-row b { font-weight: 600; }
.key-row .btn { margin-left: auto; }
.key-once { display: block; margin-top: var(--space-3); padding: 10px 12px; border-radius: var(--radius-field); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; color: var(--text); word-break: break-all; user-select: all; }

@media (max-width: 900px) {
  .p-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 8px; }
  .p-row .detail { grid-column: 2 / -1; grid-row: 2; }
  .p-row .status { grid-column: 3; grid-row: 1; justify-self: end; }
  .p-row .act { grid-column: 2 / -1; justify-content: flex-start; min-width: 0; }
  .setup { grid-template-columns: 1fr; padding: var(--space-4); }
  .setup .mock { display: none; }
}

/* ---------- Settings ---------- */
.set-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; padding: 18px 0; }
.set-row > div:first-child b { display: block; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 600; }
.set-row > div:first-child small { display: block; margin-top: 2px; max-width: 460px; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.set-row .ctl { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); min-width: 0; }
.set-row .ctl-col { flex-direction: column; align-items: flex-end; }
.set-row .field { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-2); font-size: var(--type-secondary-size); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.idents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-end; }
.ident { display: flex; align-items: center; gap: var(--space-2); font-size: var(--type-secondary-size); }
.ident b { font-weight: 600; }
.danger-zone .section-head h2 { color: var(--negative); }
@media (max-width: 760px) {
  .set-row { grid-template-columns: 1fr; row-gap: var(--space-3); }
  .set-row .ctl, .set-row .ctl-col, .idents, .set-row .field { justify-content: flex-start; align-items: flex-start; }
  .set-row .seg { flex-wrap: wrap; }
}

/* ---------- Spending (design/samples/spending.html), scoped to .spend ---------- */

  .spend .page-head { align-items: flex-end; margin: var(--space-4) 0 var(--space-8); }
  .spend .page-head h1 { font-family: var(--font-sans); font-size: var(--type-title-size); line-height: var(--type-title-line); font-weight: var(--type-title-weight); letter-spacing: var(--type-title-tracking); }
  :lang(zh) .spend .page-head h1 { letter-spacing: 0; }
  .spend .page-head .sub { margin-top: var(--space-2); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
  .spend .head-actions { display: flex; align-items: center; gap: var(--space-3); }
  .spend .month { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--fill); }
  .spend .month button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
  .spend .month button:hover { background: var(--fill-strong); color: var(--text); }
  .spend .month button[disabled] { opacity: .3; cursor: default; background: transparent; }
  .spend .month span { min-width: 92px; text-align: center; font-size: var(--type-secondary-size); font-weight: 600; }

  /* Three numbers, divided by hairlines (same pattern as the dashboard's key metrics). */
  /* Average monthly cost leads with the hero size; charged and profit share the line under it (design 1.0, D3). */
  .spend .trio { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .spend .tri { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
  .spend .tri.lead { padding: var(--space-6) 0 var(--space-5); }
  .spend .tri-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
  .spend .tri-row .tri + .tri { border-left: 1px solid var(--hairline); }
  .spend .tri-row .tri:first-child { padding-left: 0; }
  .spend .tri-row .tri:last-child { padding-right: 0; }
  .spend .tri .t-foot { color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
  .spend .tri .formula { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); color: var(--text-2); font-weight: 500; }
  .spend .tri .formula b { color: var(--text); font-weight: 600; }

  /* Needs attention: a quiet list, one line each, a dot for the meaning. */
  .spend .attn { margin-top: var(--space-10); }
  .spend .attn-list { list-style: none; margin: 0; padding: 0; }
  .spend .attn-list li { display: grid; grid-template-columns: 8px 28px minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding: 12px 0; border-bottom: 1px solid var(--hairline); }
  .spend .attn-list li:last-child { border-bottom: 0; }
  .spend .attn-list .dot { width: 8px; height: 8px; }
  .spend .attn-list p { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
  .spend .attn-list p b { font-weight: 600; }
  .spend .attn-list .meta { color: var(--text-2); font-size: var(--type-secondary-size); white-space: nowrap; font-weight: 500; }

  .spend .two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-12); }

  /* Next 30 days: a strip with one tick per charge, then the list. */
  .spend .strip { position: relative; height: 54px; margin: var(--space-5) 0 var(--space-2); }
  .spend .strip .axis { position: absolute; left: 0; right: 0; top: 22px; height: 1px; background: var(--rule); }
  .spend .strip .wk { position: absolute; top: 18px; width: 1px; height: 9px; background: var(--rule); }
  .spend .strip .pt { position: absolute; top: 22px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--bg); }
  .spend .strip .lbl { position: absolute; top: 38px; font-size: var(--type-caption-size); line-height: 16px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
  .spend .strip .lbl.end { transform: translateX(-100%); }
  .spend .up-row { grid-template-columns: 76px minmax(0, 1fr) auto; padding: 12px 0; }
  .spend .up-row .when b { display: block; font-size: var(--type-secondary-size); font-weight: 600; line-height: var(--type-secondary-line); }
  .spend .up-row .when small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
  .spend .up-row .r small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
  .spend .est { color: var(--text-2); }

  /* By project: one bar each, same as "where it came from" on the dashboard. */
  .spend .proj-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding: 14px 0 13px; }
  .spend .proj-row .share { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); }
  .spend .proj-row .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
  .spend .proj-row .bar span { display: block; height: 100%; background: var(--chart); border-radius: 2px; }
  .spend .proj-row.shared .bar span { background: var(--text-3); }
  .spend .proj-row .pct { width: 3.2em; text-align: right; color: var(--text-2); font-size: var(--type-caption-size); font-weight: 500; }
  .spend .proj-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--ink); flex: none; }
  .spend .proj-row.shared .proj-dot { background: none; box-shadow: inset 0 0 0 1.5px var(--text-3); }
  .spend .side-foot { margin-top: var(--space-3); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }

  /* All items */
  .spend .all .row, .spend .all .thead { grid-template-columns: minmax(200px, 1.6fr) 130px 70px 110px 110px minmax(120px, 1fr) 80px; }
  .spend .all .r small, .spend .all .cell small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; white-space: nowrap; }
  .spend .all .row.muted .name b, .spend .all .row.muted .t-value { color: var(--text-2); }
  .spend .usage { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
  .spend .usage .bar { width: 72px; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; flex: none; }
  .spend .usage .bar span { display: block; height: 100%; background: var(--late); }
  .spend .usage .bar.ok span { background: var(--chart); }
  .spend .usage small { margin: 0 !important; }
  .spend .src { display: inline-flex; align-items: center; gap: 6px; font-size: var(--type-secondary-size); color: var(--text-2); font-weight: 500; white-space: nowrap; }
  .spend .src .dot { width: 6px; height: 6px; }
  .spend .proj { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 500; }
  .spend .proj small { white-space: normal !important; }
  .spend .total-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) 130px 70px 110px 110px minmax(120px, 1fr) 80px; column-gap: var(--space-4); padding: 14px 0; border-top: 1px solid var(--rule); font-size: var(--type-secondary-size); font-weight: 600; }
  .spend .total-row .r { text-align: right; }
  .spend .excluded { margin-top: var(--space-2); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); max-width: 720px; }

  

@media (max-width: 1100px) {
    .spend .two { grid-template-columns: 1fr; gap: var(--space-10); }
    .spend .all .row, .spend .all .thead, .spend .total-row { grid-template-columns: minmax(180px, 1.6fr) 120px 64px 100px 100px minmax(100px, 1fr); }
    .spend .all .c-src { display: none; }
  }
@media (max-width: 760px) {
    .spend .page-head { flex-direction: column; align-items: stretch; gap: var(--space-4); margin-bottom: var(--space-6); }
    .spend .head-actions { justify-content: space-between; }
    .spend .tri-row { grid-template-columns: 1fr; }
    .spend .tri, .spend .tri.lead, .spend .tri-row .tri:first-child, .spend .tri-row .tri:last-child { padding: var(--space-4) 0; }
    .spend .tri-row .tri + .tri { border-left: 0; border-top: 1px solid var(--hairline); }
    .spend .tri.lead .big { font-size: 44px; line-height: 48px; }
    .spend .attn-list li { grid-template-columns: 8px 28px minmax(0, 1fr); row-gap: 4px; }
    .spend .attn-list .meta { grid-column: 3; }
    .spend .all .thead { display: none; }
    .spend .all .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
    .spend .all .c-cycle, .spend .all .c-src, .spend .all .c-amt { display: none; }
    .spend .all .c-next, .spend .all .c-proj { grid-column: 1 / -1; padding-left: 40px; text-align: left; }
    .spend .all .c-proj small { display: inline; }
    .spend .all .c-proj small::before { content: " · "; }
    .spend .all .c-next.none { display: none; }
    .spend .total-row { grid-template-columns: 1fr auto; }
    .spend .total-row .c-hide { display: none; }
    .spend .sheet { width: 100%; top: 40px; border-radius: var(--radius-dialog) var(--radius-dialog) 0 0; }
  }

.spend .sheet { display: none; }
.spend .all .row { cursor: pointer; }
.spend .all .row:hover, .spend .proj-row[data-proj]:hover { background: var(--fill); }
.spend .proj-row[data-proj] { cursor: pointer; }
.spend .empty-spend { padding: var(--space-8) 0; color: var(--text-2); }

/* How it's calculated: a button at the end of the numbers, and the dialog it opens (design/audit-mockups-2026-11 E). */
.spend .tri-row { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.spend .tri-row .tri.how-cell { justify-content: center; padding-right: 0; border-left: 0 !important; }
.how-dialog .how-part { padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.how-dialog .how-part h3, .how-dialog .how-set { font-size: var(--type-headline-size); line-height: var(--type-headline-line); font-weight: 600; }
.how-dialog .how-part p { margin-top: 4px; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.how-dialog .how-set { margin: var(--space-5) 0 var(--space-1); color: var(--text-2); font-size: var(--type-secondary-size); }
.how-dialog .choices { display: flex; flex-direction: column; }
.how-dialog .choice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.how-dialog .choice .c-lab { font-size: var(--type-secondary-size); font-weight: 600; }
.how-dialog .choice .form-error { flex-basis: 100%; margin: 0; }
.how-dialog .spread-months { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--type-secondary-size); color: var(--text-2); margin-left: auto; }
.how-dialog .spread-months[hidden] { display: none; }
.how-dialog .spread-months input { width: 64px; height: 30px; border: 0; border-radius: var(--radius-field); background: var(--bg); box-shadow: inset 0 0 0 1px var(--rule); padding: 0 8px; text-align: right; font-size: var(--type-secondary-size); color: var(--text); }
.how-dialog .spread-months input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.how-dialog .how-after { margin-top: var(--space-4); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.how-dialog .d-foot { border-top: 0; justify-content: flex-end; }
dialog.xdialog.how-dialog { width: min(640px, calc(100vw - 32px)); }

/* Breakdown by category or project, and the list grouped by category (design/audit-mockups-2026-11 D). */
.spend .split .section-head .seg { margin-left: auto; height: 30px; }
.spend .split .section-head .seg button { height: 24px; padding: 0 12px; font-size: var(--type-secondary-size); }
.spend .cat-tile.sm, .how-dialog .cat-tile.sm { --s: 28px; }
.spend .cat-tile.sm svg { width: 16px; height: 16px; }
.spend .all .grp { display: grid; grid-template-columns: minmax(200px, 1.6fr) 130px 70px 110px; column-gap: var(--space-4); align-items: center; padding: 18px 0 10px; border-bottom: 1px solid var(--rule); font-size: var(--type-secondary-size); }
.spend .all .grp .name { display: flex; align-items: center; gap: var(--space-3); }
.spend .all .grp .name b { font-weight: 600; font-size: var(--type-headline-size); }
.spend .all .grp .r { text-align: right; font-weight: 600; }
.spend .all .c-fee small { white-space: normal; }
.spend .up-none { padding: var(--space-4) 0; border-top: 1px solid var(--hairline); }
.spend .up-none b { display: block; font-size: var(--type-secondary-size); font-weight: 600; }
.spend .up-none small { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
@media (max-width: 1100px) {
  .spend .all .grp { grid-template-columns: minmax(180px, 1.6fr) 120px 64px 100px; }
}
@media (max-width: 760px) {
  .spend .tri-row { grid-template-columns: 1fr; }
  .spend .tri-row .tri.how-cell { border-top: 0 !important; padding-top: 0; }
  .spend .all .grp { grid-template-columns: minmax(0, 1fr) auto; }
  .spend .all .grp .c-hide { display: none; }
  .how-dialog .choice { flex-direction: column; align-items: stretch; }
  .how-dialog .choice .seg { display: flex; }
  .how-dialog .choice .seg button { flex: 1; min-width: 0; padding: 0 8px; }
  .how-dialog .spread-months { margin-left: 0; }
}

/* ---------- Drawer (add / edit an expense) ---------- */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border: 0; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-overlay); }
dialog.drawer::backdrop { background: rgba(0,0,0,.28); }
.drawer form { display: flex; flex-direction: column; height: 100%; }
.drawer .d-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--hairline); }
.drawer .d-head h2 { font-family: var(--font-sans); font-size: var(--type-section-size); line-height: var(--type-section-line); font-weight: var(--type-section-weight); letter-spacing: var(--type-section-tracking); }
.drawer .x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fill); cursor: pointer; font-size: 16px; color: var(--text-2); }
.drawer .d-body { flex: 1; overflow-y: auto; padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.drawer .d-foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--hairline); }
.drawer .d-foot p { flex: 1; color: var(--text-2); font-size: var(--type-caption-size); line-height: 16px; }
.drawer .lbl { display: block; font-size: var(--type-secondary-size); font-weight: 600; margin-bottom: 6px; }
.drawer .help { display: block; margin-top: 4px; color: var(--text-2); font-size: var(--type-caption-size); line-height: var(--type-caption-line); }
.drawer .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.drawer input[type="date"], .drawer input[type="number"], .drawer textarea { width: 100%; height: 36px; border-radius: var(--radius-field); border: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--rule); padding: 0 12px; font-size: var(--type-secondary-size); }
.drawer .plans { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer .plans button { height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 0; background: var(--fill); font-size: var(--type-secondary-size); font-weight: 500; color: var(--text-2); cursor: pointer; }
.drawer .plans button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.drawer .seg.full { display: flex; flex-wrap: wrap; }
.drawer .seg.full button { flex: 1; min-width: 0; padding: 0 6px; }
.drawer .alloc { display: flex; flex-direction: column; gap: 8px; }
.drawer .alloc .a { display: grid; grid-template-columns: minmax(0, 1fr) 92px; align-items: center; gap: var(--space-3); }
.drawer .alloc .a input[type="number"] { height: 32px; text-align: right; }
.drawer .alloc .rest { display: flex; justify-content: space-between; color: var(--text-2); font-size: var(--type-secondary-size); font-weight: 500; }
.drawer .charges { list-style: none; margin: 0; padding: 0; }
.drawer .charges li { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: var(--space-2); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: var(--type-secondary-size); }
.drawer .charges input { height: 30px; }

/* What a plan adds: shown on a page the plan doesn't have (posting, spending). */
.pitch { max-width: 520px; padding: var(--space-6) 0; }
.pitch h1 { font-family: var(--font-sans); font-size: var(--type-title-size); line-height: var(--type-title-line); font-weight: var(--type-title-weight); margin-bottom: var(--space-4); }
.pitch p { margin-top: var(--space-4); color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.pitch .go { margin-top: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.pub-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pub-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); color: var(--text); }
.pub-list li svg { margin-top: 6px; color: var(--text-2); }

/* A period the plan doesn't have (dashboard). */
.seg button.locked { color: var(--text-3); }
.seg button.locked svg { margin-left: 5px; vertical-align: -1px; }

/* Settings, AI connections (settings.js aiSection). */
.ai-form { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 380px; margin-left: auto; }
.ai-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ai-form .field label { text-align: left; }
.ai-btns { display: flex; justify-content: flex-end; gap: var(--space-3); }
.ai-logrow > div:first-child { grid-column: 1 / -1; }
.ai-logrow > div:first-child small { max-width: none; }
.ai-log { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.ai-act { display: grid; grid-template-columns: 9em minmax(0, 1fr) auto 5em; gap: var(--space-3); align-items: baseline; padding: 8px 0; font-size: var(--type-secondary-size); border-top: 1px solid var(--hairline); }
.ai-act:first-child { border-top: 0; }
.ai-act > :last-child { text-align: right; }
.x-note { margin: var(--space-3) 0 0; font-size: var(--type-secondary-size); }
.x-act { grid-template-columns: 7em minmax(0, 1fr) auto 6em; }
.x-bad { color: var(--late, var(--negative)); }

/* Time zone by city: a field that opens a searchable list (design/audit-mockups-2026-11 K). */
.tz-pick { position: relative; }
.tz-btn { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 320px; height: var(--size-control); padding: 0 12px; border: 0; border-radius: var(--radius-field); background: var(--fill); color: var(--text-2); font-size: var(--type-secondary-size); cursor: pointer; text-align: left; }
.tz-btn b { color: var(--text); font-weight: 600; white-space: nowrap; }
.tz-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-btn svg { margin-left: auto; flex: none; }
.tz-pop { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 380px; max-height: 480px; display: flex; flex-direction: column; padding: 8px; border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow-overlay), inset 0 0 0 1px var(--hairline); }
.tz-search { display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 12px; margin: 4px 4px 6px; border-radius: var(--radius-pill); background: var(--fill); color: var(--text-2); }
.tz-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: var(--type-body-size); color: var(--text); }
.tz-list { overflow-y: auto; }
.tz-list .lab { margin: 10px 10px 4px; color: var(--text-2); font-size: var(--type-caption-size); font-weight: 600; }
.tz-list .lab.more { margin-bottom: 8px; font-weight: 500; }
.tz-opt { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-field); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.tz-opt:hover, .tz-opt:focus-visible, .tz-opt.on { background: var(--fill); }
.tz-opt .c { flex: 1; min-width: 0; }
.tz-opt b { display: block; font-size: var(--type-secondary-size); font-weight: 600; }
.tz-opt small { display: block; color: var(--text-2); font-size: var(--type-caption-size); }
.tz-opt .o { color: var(--text-2); font-size: var(--type-secondary-size); }
.ai-bad { color: var(--negative); }
@media (max-width: 600px) { .ai-act { grid-template-columns: 1fr auto; } .ai-scopes { grid-template-columns: 1fr; } .tz-btn { min-width: 0; width: 100%; } .tz-pop { width: min(380px, calc(100vw - 32px)); } }

/* ---------- Add / edit an expense: a centered dialog (design 1.0: corners 24, close top right, main button bottom right) ---------- */
dialog.xdialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border: 0; padding: 0; border-radius: var(--radius-dialog); background: var(--surface); color: var(--text); box-shadow: var(--shadow-overlay); overflow: hidden; }
dialog.xdialog[open] { display: flex; flex-direction: column; }
dialog.xdialog::backdrop { background: rgba(0,0,0,.28); }
.xdialog form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.xdialog .d-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6) var(--space-3); }
.xdialog .d-head h2 { flex: 1; font-size: var(--type-section-size); line-height: var(--type-section-line); font-weight: var(--type-section-weight); letter-spacing: var(--type-section-tracking); }
.xdialog .x { width: var(--size-control); height: var(--size-control); border-radius: 50%; border: 0; background: var(--fill); display: grid; place-items: center; color: var(--text-2); cursor: pointer; flex: none; }
.xdialog .x:hover { background: var(--fill-strong); color: var(--text); }
.xdialog .d-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-1) var(--space-6) var(--space-4); }
.xdialog .d-foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-6); border-top: 1px solid var(--hairline); }
.xdialog .d-foot .hint { flex: 1; min-width: 0; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.xdialog .d-foot .danger { color: var(--negative); padding: 0; }
.xdialog .d-foot .danger:hover { background: none; text-decoration: underline; }
.xdialog .form-error { margin-top: var(--space-3); }
.xdialog .search { display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--fill); color: var(--text-2); cursor: text; }
.xdialog .search:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink); }
.xdialog .search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: var(--type-body-size); color: var(--text); }
.xdialog .search input::placeholder { color: var(--text-3); }
.xdialog .search input::-webkit-search-cancel-button { cursor: pointer; }
.xdialog .flabel { margin: 18px 0 8px; font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); font-weight: 600; }
.xdialog .xchips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.xchip { height: 34px; padding: 0 14px; border-radius: var(--radius-pill); border: 0; display: inline-flex; align-items: center; gap: 6px; background: var(--fill); color: var(--text); font-size: var(--type-control-size); font-weight: 500; cursor: pointer; white-space: nowrap; }
.xchip:hover { background: var(--fill-strong); }
.xchip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.xchip svg { width: 16px; height: 16px; flex: none; }
.xchip .logo { --s: 20px; margin-left: -6px; background: transparent; box-shadow: none; }
.xdialog .results { margin-top: var(--space-2); display: flex; flex-direction: column; }
.xdialog .opt { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 8px 10px; margin: 0 -10px; border: 0; border-radius: var(--radius-field); background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.xdialog .opt:hover, .xdialog .opt:focus-visible { background: var(--fill); }
.xdialog .opt b { display: block; font-size: var(--type-headline-size); line-height: var(--type-headline-line); font-weight: 600; }
.xdialog .opt small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.xdialog .opt.use b { font-weight: 500; }
.xdialog .none { padding: 12px 0 4px; color: var(--text-2); font-size: var(--type-secondary-size); }
.cat-tile { --s: var(--size-logo-tile); width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; border-radius: calc(var(--s) * var(--radius-tile-ratio)); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text-2); font-size: 18px; }
.cat-tile svg { width: 18px; height: 18px; }
.xdialog .picked .cat-tile { --s: var(--size-logo-tile-lg); }
.xdialog .picked { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; margin-top: var(--space-4); }
.xdialog .picked .grow { flex: 1; min-width: 0; }
.xdialog .picked b { display: block; font-size: var(--type-headline-size); line-height: var(--type-headline-line); font-weight: 600; }
.xdialog .picked small { display: block; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.xdialog .fgroup { margin-top: var(--space-5); }
.xdialog .frow { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 8px 0; border-top: 1px solid var(--hairline); }
.xdialog .frow.top { align-items: flex-start; }
.xdialog .frow.top .lab { padding-top: 6px; }
.xdialog .frow .lab { width: 112px; flex: none; font-size: var(--type-body-size); line-height: var(--type-body-line); }
.xdialog .frow .grow { flex: 1; min-width: 0; }
.xdialog .frow .t2 { font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.xdialog .frow .input { height: var(--size-control); font-size: var(--type-body-size); }
.xdialog .frow input[type="date"] { width: 180px; }
.xdialog .frow .cur { width: 92px; flex: none; }
.xdialog select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.xdialog .unit { color: var(--text-2); white-space: nowrap; }
.xdialog .xhelp { margin: -2px 0 10px 124px; color: var(--text-2); font-size: var(--type-secondary-size); line-height: var(--type-secondary-line); }
.xdialog .xhelp.flush { margin: 6px 0 0; }
.xdialog .frow.more { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.xdialog .frow.more svg { color: var(--text-3); flex: none; transition: transform var(--motion-duration-fast) var(--motion-easing); }
.xdialog .frow.more[aria-expanded="true"] svg { transform: rotate(90deg); }
.xdialog .more-body .frow:first-child { border-top: 1px solid var(--hairline); }
.xdialog .alloc { display: flex; flex-direction: column; gap: var(--space-2); }
.xdialog .alloc .a { display: grid; grid-template-columns: minmax(0, 1fr) 80px; align-items: center; gap: var(--space-3); }
.xdialog .alloc .a .input { height: 32px; text-align: right; }
.xdialog .alloc .rest { display: flex; justify-content: space-between; color: var(--text-2); font-size: var(--type-secondary-size); }
.xdialog .alloc + .link-btn { margin-top: var(--space-2); }
.xdialog .charges { list-style: none; margin: 0; padding: 0; }
.xdialog .charges li { display: grid; grid-template-columns: minmax(0, 1fr) 112px auto; gap: var(--space-2); align-items: center; padding: 6px 0; font-size: var(--type-secondary-size); }
.xdialog .charges .input { height: 32px; text-align: right; }
@media (max-width: 767px) {
  dialog.xdialog { width: 100vw; max-width: 100vw; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: var(--radius-dialog) var(--radius-dialog) 0 0; }
  .xdialog .d-head, .xdialog .d-body, .xdialog .d-foot { padding-left: var(--space-4); padding-right: var(--space-4); }
  .xdialog .frow .lab { width: 84px; }
  .xdialog .xhelp { margin-left: 96px; }
  .xdialog .x, .xchip { min-height: var(--size-touch); }
  .xdialog .x { width: var(--size-touch); }
  .xdialog .d-foot .btn { height: var(--size-touch); }
  .xdialog .d-foot .hint { display: none; }
}
