:root {
  color-scheme: light;
  --ink: #18273b;
  --muted: #5b6b81;
  --blue: #2076d6;
  --navy: #0d3567;
  --paper: #f3e5d6;
  --apricot: #ffc281;
  --line: #e4eaf2;
  --white: #fff;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-optical-sizing: auto;
  background: #f5f7fb;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { transition: background-color .18s, box-shadow .18s, transform .18s; }
button:active:not(:disabled) { transform: scale(.974); transition-duration: .07s; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
svg { display: block; flex: none; }
.shell { max-width: 83rem; width: calc(100% - 7rem); margin-inline: auto; }
.toolbar { position: sticky; top: 0; z-index: 2; background: #f8faffdc; backdrop-filter: blur(20px) saturate(150%); }
.toolbar-inner { min-height: 4.25rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.identity, .toolbar-actions { display: flex; align-items: center; gap: .85rem; }
.identity { font-size: .92rem; font-weight: 700; color: var(--navy); white-space: nowrap; }
.identity img { object-fit: contain; height: 2rem; width: 2.65rem; }
.identity-divider { width: 1px; height: 1.18rem; background: #d5e0ee; }
.workspace-name { color: var(--muted); font-weight: 500; }
.view-link { color: #155aa7; font-size: .82rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.view-link:hover { text-decoration: underline; }
.save-status { color: var(--muted); display: inline-flex; gap: .42rem; align-items: center; font-size: .76rem; white-space: nowrap; }
.save-status::before { content: ""; width: .39rem; height: .39rem; border-radius: 50%; background: #40846b; }
.save-status[data-warning]::before { background: #b26230; }
.button { border: 1px solid transparent; border-radius: .74rem; background: #edf4fd; color: #155aa7; padding: .54rem .9rem; min-height: 2.55rem; font-weight: 670; font-size: .84rem; display: inline-flex; gap: .4rem; align-items: center; justify-content: center; white-space: nowrap; }
.button:hover { background: #e0edfc; }
.button.primary { background: #1767c4; color: white; }
.button.primary:hover { background: #125aad; }
.button.ghost { background: #fff; border-color: #e0e8f2; color: var(--ink); }
.button.ghost:hover { background: #f0f5fc; }
.button.danger { background: #fff0ed; color: #a13d31; }
.action-export { background: #1767c4; color: white; }
.action-export:hover { background: #125aad; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1fr 39%; min-height: 15.25rem; margin-top: 1.35rem; border-radius: 1.65rem; background: linear-gradient(112deg, #eaf4ff 3%, #dcecff 52%, #bcdcff 100%); border: 1px solid #d6e7fa; }
.hero-copy { position: relative; z-index: 1; padding: 2.12rem 2.6rem 1.9rem; }
.urba-logo { display: block; width: auto; height: 2.55rem; }
h1 { margin: .45rem 0 .5rem; font-weight: 780; font-size: clamp(2.45rem, 4.1vw, 3.75rem); line-height: 1.12; color: #0b305b; letter-spacing: -.04em; }
.hero-copy > p { color: #345b82; font-size: clamp(.89rem, 1.25vw, 1.03rem); }
.hero-meta { color: #335c85; font-size: .76rem; display: inline-flex; gap: .5rem; margin-top: 1.2rem; background: #f1f7ffb5; border: 1px solid #fff9; border-radius: .6rem; padding: .32rem .65rem; }
.hero-meta time { font-variant-numeric: tabular-nums; font-weight: 680; }
.hero-visual { position: relative; min-width: 0; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(#fff7 1px, transparent 1px),linear-gradient(90deg,#fff7 1px,transparent 1px); background-size: 27px 27px; mask-image: linear-gradient(90deg,transparent 0%,#000 68%,#0007 100%); }
.orb { position: absolute; left: 48%; top: 54%; transform: translate(-50%, -50%); border: 1px solid #ffffffcf; border-radius: 50%; aspect-ratio: 1; }
.orb-outer { width: 22rem; box-shadow: inset 0 0 3rem #e4f1ff4d; }
.orb-inner { width: 16.2rem; background: #ffffff24; }
.orb-node { border-radius: 50%; position: absolute; z-index: 1; }
.node-one { width: .95rem; height: .95rem; top: 27%; left: 18%; background: var(--apricot); box-shadow: 0 0 0 .32rem #fff6; }
.node-two { width: .55rem; height: .55rem; top: 73%; right: 13%; background: #fff; }
.node-three { width: .65rem; height: .65rem; top: 17%; right: 21%; background: var(--paper); }
.mascot { position: absolute; width: clamp(11.5rem, 19vw, 17.5rem); height: auto; left: 48%; top: 13%; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 .8rem 1.05rem #1a69b134); }
.project-bar { display: flex; justify-content: space-between; align-items: center; gap: .9rem; margin: 1.6rem 0 1.15rem; }
.project-context { display: flex; gap: .7rem; align-items: center; }
.context-icon, .module-icon { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: .78rem; background: #e5effd; color: #1c66b7; }
.project-context strong { display: block; font-size: .95rem; }
.project-context small { display: block; margin-top: .03rem; color: var(--muted); font-size: .73rem; }
.segments { display: grid; grid-template-columns: repeat(3, 1fr); gap: .15rem; padding: .24rem; background: #e9eef6; border-radius: .81rem; }
.segments button { background: transparent; border: 0; border-radius: .63rem; min-height: 2.22rem; color: #52627b; font-size: .84rem; font-weight: 650; padding-inline: .96rem; white-space: nowrap; }
.segments button:hover { background: #f0f5fb; }
.segments button[aria-selected="true"] { background: #fff; color: #164f91; box-shadow: 0 1px 3px #12396921; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17.7rem, 21rem); align-items: start; gap: 1.35rem; }
#work-panel { min-width: 0; }
#summary { position: sticky; top: 5.1rem; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: .82rem; min-height: 2.55rem; }
.panel-heading h2 { font-size: 1.42rem; letter-spacing: -.03em; line-height: 1.3; }
.panel-heading p { color: var(--muted); font-size: .79rem; margin-top: .18rem; }
.card { border: 1px solid var(--line); background: white; border-radius: 1.18rem; padding: 1.16rem; }
.room-card + .room-card { margin-top: .8rem; }
.room-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; }
.room-identity { display: flex; align-items: center; gap: .68rem; min-width: 0; }
.room-identity > div { min-width: 0; }
.room-identity h3 { font-size: 1.12rem; line-height: 1.3; overflow-wrap: anywhere; }
.room-identity p { margin-top: .17rem; color: var(--muted); font-size: .77rem; }
.room-identity .module-icon { width: 2.65rem; height: 2.65rem; }
.room-price { text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.room-price strong { display: block; color: #123866; font-size: 1.53rem; line-height: 1.18; letter-spacing: -.045em; }
.room-price span { color: var(--muted); font-size: .72rem; }
.room-controls { display: flex; justify-content: space-between; align-items: center; gap: .55rem; margin: .85rem 0; padding: .68rem .75rem; background: #f6f8fc; border-radius: .75rem; }
.room-controls label { display: flex; align-items: center; gap: .38rem; color: #43546d; font-size: .81rem; font-weight: 630; }
.room-controls input { width: 4.1rem; padding: .34rem .42rem; }
input, select { background: #fff; color: var(--ink); border: 1px solid #d8e2ef; border-radius: .53rem; min-height: 2.25rem; padding: .38rem .6rem; max-width: 100%; }
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.module-tile { display: flex; align-items: center; text-align: left; gap: .58rem; background: #fff; border: 1px solid var(--line); border-radius: .76rem; min-height: 3.5rem; padding: .48rem .6rem; min-width: 0; }
.module-tile:hover { background: #f3f7ff; border-color: #d6e5fa; }
.module-tile .module-icon { width: 1.95rem; height: 1.95rem; border-radius: .55rem; }
.tone-1 { background: #f5ece2; color: #82512a; }
.tone-2 { background: #fff0dc; color: #8c550d; }
.tone-3 { background: #e7eefc; color: #4b63a2; }
.module-label { min-width: 0; flex: 1; }
.module-label strong { display: block; font-size: .81rem; }
.module-label small { display: block; color: var(--muted); font-size: .68rem; }
.module-value { font-size: .82rem; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-chevron { color: #7487a2; }
.summary-card { border-radius: 1.18rem; overflow: hidden; background: white; border: 1px solid #dce6f3; }
.summary-hero { padding: 1.1rem 1.16rem 1.18rem; color: white; background: radial-gradient(ellipse at 100% 0%,#1d5798,transparent 83%), linear-gradient(135deg, #0c2e56, #133965 85%); }
.summary-heading { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-bottom: .88rem; }
.summary-heading h2 { font-size: .92rem; font-weight: 690; }
.summary-heading span { color: #e3efff; border-radius: .42rem; font-size: .69rem; padding: .14rem .44rem; background: #ffffff1f; }
.summary-caption { color: #e2edfd; font-size: .79rem; }
.summary-total { display: block; font-size: clamp(1.45rem, 2.5vw, 2.35rem); line-height: 1.2; letter-spacing: -.044em; font-weight: 760; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-average { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid #ffffff32; padding-top: .67rem; margin-top: .82rem; }
.summary-average span { color: #e2edfd; font-size: .77rem; }
.summary-average strong { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .93rem; }
.summary-body { padding: .9rem 1.14rem 1rem; }
.cost-bar { display: flex; border-radius: 1rem; overflow: hidden; height: .45rem; background: #eff3fa; gap: 2px; margin-bottom: .65rem; }
.cost-bar > span:first-child, .cost-dot.direct { background: var(--blue); }
.cost-bar > span:nth-child(2), .cost-dot.public { background: #e0a05e; }
.cost-bar > span:nth-child(3), .cost-dot.once { background: #8b9dcc; }
.summary-row, .result-row { display: flex; align-items: center; justify-content: space-between; gap: .35rem; padding-block: .32rem; font-size: .83rem; }
.summary-row span { color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.summary-row strong, .result-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-dot { width: .48rem; height: .48rem; border-radius: 50%; flex: none; }
.summary-body > .button { width: 100%; margin-top: .7rem; }
.room-footnote { font-size: .75rem; color: var(--muted); margin-top: .75rem; }
.shared-list, .results-list { display: grid; gap: .65rem; }
.shared-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .86rem 1rem; }
.shared-card h3 { font-size: .96rem; }
.shared-card p { font-size: .75rem; color: var(--muted); margin-top: .16rem; }
.shared-actions { display: flex; gap: .5rem; align-items: center; }
.switch { position: relative; width: 2.5rem; height: 1.48rem; border: 0; background: #dfe6ef; border-radius: 2rem; flex: none; }
.switch::after { content: ""; position: absolute; top: .165rem; left: .19rem; height: 1.15rem; width: 1.15rem; border-radius: 50%; background: white; box-shadow: 0 1px 3px #11335429; transition: translate .21s cubic-bezier(.2,.8,.3,1); }
.switch[aria-checked="true"] { background: #2675ce; }
.switch[aria-checked="true"]::after { translate: .98rem; }
.notice { border: 1px solid #f0d9bd; background: #fff6e9; color: #735126; border-radius: .72rem; padding: .72rem .85rem; font-size: .79rem; line-height: 1.55; }
.notice + .shared-list, .notice + .results-list { margin-top: .66rem; }
.result-row + .result-row { border-top: 1px solid var(--line); }
.result-card h3 { margin-bottom: .45rem; font-size: 1.02rem; }
.result-card .result-row:last-child strong { color: #125eae; }
.subheading { font-size: 1.04rem; margin-top: 1.15rem; margin-bottom: .6rem; }
.allocation-detail { padding: .75rem 0 .35rem; font-size: .79rem; }
.allocation-detail summary { cursor: pointer; color: #195da8; }
footer { padding: 1.4rem .15rem 1.65rem; color: var(--muted); font-size: .72rem; }

dialog { position: fixed; margin: .65rem .65rem .65rem auto; max-width: calc(100% - 1.3rem); width: 38rem; max-height: none; height: calc(100% - 1.3rem); border: 1px solid #e4edfa; border-radius: 1.25rem; padding: 0; color: var(--ink); background: #fbfdfff9; box-shadow: 0 12px 55px #102d5650; }
dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
dialog::backdrop { background: #112b4d56; }
dialog:focus { outline: none; }
.editor-header, .editor-footer { display: flex; align-items: center; gap: .7rem; background: #f8fbffeb; backdrop-filter: blur(16px); padding: .8rem 1.12rem; }
.editor-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.editor-header h2 { font-size: 1.3rem; line-height: 1.2; overflow-wrap: anywhere; }
.editor-header p { font-size: .72rem; color: var(--muted); margin-bottom: .18rem; }
.icon-button { width: 2.45rem; height: 2.45rem; flex: none; border-radius: 50%; border: 0; background: #eaf1fa; color: #325d87; font-size: 1.36rem; display: grid; place-items: center; line-height: 1; }
.icon-button:hover { background: #dfeaf8; }
.editor-main { min-height: 0; overflow: auto; padding: 1.02rem 1.12rem; background: #fbfdff; }
.editor-footer { justify-content: space-between; border-top: 1px solid var(--line); }
.editor-footer span { color: var(--muted); font-size: .77rem; }
.editor-footer strong { color: var(--navy); font-size: 1rem; }
.field { display: grid; gap: .28rem; padding-bottom: .72rem; font-size: .84rem; font-weight: 650; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.field input, .field select { width: 100%; }
.line-editor { display: grid; grid-template-columns: minmax(0,1fr) 5rem 5.5rem 5.8rem; align-items: center; gap: .48rem; padding: .51rem 0; border-bottom: 1px solid var(--line); font-size: .81rem; }
.line-editor.head { font-size: .73rem; color: var(--muted); }
.line-editor input { width: 100%; font-variant-numeric: tabular-nums; padding-inline: .42rem; }
.line-editor .line-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-name { display: flex; align-items: flex-start; gap: .36rem; }
.line-name input, .scope-list input { width: 1.05rem; min-height: 1.05rem; height: 1.05rem; accent-color: var(--blue); flex: none; }
.line-name small { display: block; color: var(--muted); font-size: .65rem; margin-top: .12rem; }
.line-editor[data-disabled] { color: var(--muted); background: #f4f7fb; }
.editor-section + .editor-section { margin-top: 1.2rem; }
.editor-section h3 { margin-bottom: .35rem; font-size: .98rem; }
.editor-help { color: var(--muted); font-size: .76rem; padding-block: .45rem; }
.scope-list { display: grid; gap: .38rem; }
.scope-list label { display: flex; align-items: center; gap: .42rem; font-size: .83rem; }
.scope-list label > span { flex: 1; }
.scope-list .weight { height: auto; min-height: 2rem; width: 4.8rem; }
.editor-main .notice { margin: .55rem 0; }
.editor-main > .button.danger { margin-top: .65rem; }

@media (max-width: 72rem) { .shell { width: calc(100% - 4rem); } }
@media (max-width: 56rem) {
  .shell { width: calc(100% - 2.2rem); }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(15rem, 17rem); gap: .85rem; }
  .module-tile { flex-wrap: wrap; row-gap: .2rem; }
  .tile-chevron { display: none; }
  .module-value { text-align: right; }
}
@media (max-width: 44rem) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  #summary { position: static; grid-row: 1; }
  .summary-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; padding: .75rem .9rem; }
  .summary-heading { grid-column: span 2; margin-bottom: .35rem; }
  .summary-caption, .summary-total { grid-column: 1; }
  .summary-total { font-size: 1.5rem; }
  .summary-average { flex-direction: column; gap: 0; grid-column: 2; grid-row: 2 / 4; margin: 0; padding: 0 0 0 .58rem; border: 0; }
  .summary-body { display: none; }
  .project-bar { margin-top: 1rem; justify-content: space-between; flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr 31%; min-height: 12.5rem; }
  .hero-copy { padding: 1.15rem 1.15rem; }
  .hero-copy > p { max-width: 16.5rem; }
  .hero-meta { margin-top: .8rem; }
  .mascot { width: 10rem; left: 65%; top: 27%; }
  .orb { left: 65%; }
  .orb-outer { width: 16rem; }
  .orb-inner { width: 12rem; }
  .node-one { left: 16%; top: 15%; }
}
@media (max-width: 29rem) {
  .shell { width: calc(100% - 1.3rem); }
  .toolbar-inner { min-height: 3.65rem; }
  .identity { gap: .43rem; }
  .workspace-name, .identity-divider, .save-status { display: none; }
  .hero { margin-top: .68rem; grid-template-columns: 1fr 24%; border-radius: 1.12rem; }
  h1 { font-size: 2.12rem; }
  .hero-copy { padding: 1.05rem .9rem; }
  .hero-copy > p { max-width: 13rem; }
  .mascot { width: 7.4rem; left: 63%; top: 39%; }
  .project-bar { margin-bottom: .75rem; }
  .segments { width: 100%; }
  .segments button { padding-inline: .4rem; }
  .card { padding: .78rem; }
  .room-controls { padding-inline: .43rem; }
  .module-tile .module-icon { width: 1.65rem; height: 1.65rem; }
  .module-tile { padding-inline: .36rem; column-gap: .35rem; }
  .module-value { font-size: .75rem; }
  dialog { margin: auto 0 0; width: 100%; max-width: 100%; height: min(92dvh, 50rem); border-radius: 1.1rem 1.1rem 0 0; }
  .line-editor { grid-template-columns: minmax(0,1fr) 3.25rem 3.7rem 4.25rem; gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
  button:active:not(:disabled) { transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: editor-appear .2s cubic-bezier(.2,.8,.25,1); }
  @keyframes editor-appear {
    from { opacity: .25; }
    to { opacity: 1; }
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .toolbar, dialog, .editor-header, .editor-footer { background: #fff; backdrop-filter: none; }
}
