:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  color: #172432;
  background: #f3f5f8;
  color-scheme: light;
  --muted: #526170;
  --line: #dce3eb;
  --surface: #fff;
  --subtle: #f6f8fb;
  --blue: #204e9a;
  --blue-soft: #e9f0fd;
  --navy: #183259;
  --loss: #982c46;
  --warning: #79470a;
  --pad: clamp(1rem, 3.2vw, 3.25rem);
  font-size: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), summary { cursor: pointer; }
a { color: var(--blue); text-decoration-thickness: .075em; text-underline-offset: .18em; }
a:hover { color: #122e69; }
:focus-visible { outline: 2px solid #205dd2; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 20; background: var(--surface); padding: .8rem 1rem; top: .7rem; left: .7rem; }
.workspace { display: grid; grid-template-columns: minmax(12.75rem, 15.125rem) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: #f9fbfe; border-right: 1px solid var(--line); }
.brand { padding: 1.65rem 1.4rem 1.4rem; display: flex; align-items: center; gap: .75rem; font-size: 1.18rem; font-weight: 720; line-height: 1.15; color: var(--navy); text-decoration: none; }
.brand small { display: block; color: var(--muted); font-size: .73rem; font-weight: 450; margin-top: .3rem; }
.brand-mark { width: 2.3rem; height: 2.3rem; border-radius: .45rem; display: flex; flex: none; align-items: end; justify-content: center; gap: .17rem; padding-bottom: .57rem; background: var(--navy); }
.brand-mark i { width: .22rem; height: .53rem; background: #b6d2fb; border-radius: .05rem; }
.brand-mark i:nth-child(2) { height: .77rem; }
.brand-mark i:nth-child(3) { height: 1.04rem; background: #fff; }
.sidebar-body { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 1.35rem .85rem 1rem; }
.nav-title { margin: 0 .62rem .72rem; color: var(--muted); font-size: .76rem; font-weight: 650; }
.navigation { display: grid; gap: .25rem; }
.navigation a { position: relative; display: flex; align-items: center; gap: .7rem; text-decoration: none; padding: .78rem .75rem; color: #33475d; border-radius: .35rem; font-size: .875rem; overflow-wrap: anywhere; }
.navigation a:hover { background: #edf2fa; }
.navigation a[aria-current] { color: #173c7c; background: var(--blue-soft); font-weight: 680; }
.navigation a[aria-current]::before { content: ""; position: absolute; left: 0; width: 2px; height: 55%; background: var(--blue); }
.nav-icon { position: relative; display: inline-block; flex: 0 0 .93rem; height: .83rem; border: 1.5px solid currentColor; border-radius: .12rem; }
.nav-icon::before { content: ""; position: absolute; inset: .23rem 0 auto; border-top: 1.5px solid currentColor; }
.rows-icon::before { inset-inline: .12rem; box-shadow: 0 .24rem currentColor; }
.sidebar-bottom { margin-top: auto; padding: 1rem .5rem .3rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; }
.store-mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: none; background: var(--blue-soft); color: var(--blue); border-radius: .3rem; font-weight: 800; }
.store-meta { min-width: 0; overflow-wrap: anywhere; }
.store-meta strong, .store-meta small { display: block; }
.store-meta strong { font-size: .85rem; }
.store-meta small { font-size: .74rem; margin-top: .2rem; color: var(--muted); }
.main-frame { min-width: 0; }
.topbar { min-height: 4.4rem; align-items: center; display: flex; justify-content: space-between; gap: 1rem; padding: .75rem var(--pad); background: var(--surface); border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; min-width: 0; }
.hosted .top-actions { justify-content: flex-end; }
.hosted .top-actions .button { min-height: 2.5rem; }
.top-actions .account-link { flex-direction: column; align-items: flex-start; gap: 0; text-align: left; min-width: 0; max-width: 14rem; }
.account-link strong { font-size: .73rem; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; max-width: 100%; }
.account-link strong:empty { display: none; }
.breadcrumbs { color: var(--muted); font-size: .84rem; line-height: 1.6; overflow-wrap: anywhere; }
.breadcrumbs span { margin-inline: .38rem; color: #667789; }
.mode, .pill { font-size: .74rem; padding: .26rem .46rem; border-radius: .25rem; border: 1px solid #cbd9ee; color: #294d80; background: #eff5ff; font-weight: 630; line-height: 1.2; }
.mode.live { color: #1d5c46; background: #eaf7ef; border-color: #bcdcc8; }
main { max-width: 104rem; margin: auto; padding: 2.2rem var(--pad) 3rem; }
.heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .85rem 1.25rem; margin-bottom: 1.4rem; }
h1, h2, h3, p { margin: 0; }
h1 { color: #192b3e; font-size: clamp(1.94rem, 3.18vw, 2.8rem); line-height: 1.13; font-weight: 715; letter-spacing: -.038em; overflow-wrap: anywhere; }
h2 { color: #23384e; font-size: 1.18rem; line-height: 1.3; font-weight: 685; }
h3 { font-size: 1rem; color: #23384e; }
.heading p, .subtle { color: var(--muted); font-size: .88rem; line-height: 1.48; margin-top: .42rem; }
.heading > .subtle { margin-bottom: .1rem; }
.overview { display: grid; grid-template-columns: minmax(20rem, 1.02fr) minmax(18rem, .98fr); border: 1px solid var(--line); background: var(--surface); border-radius: .55rem; margin-bottom: 1.65rem; overflow: hidden; }
.overview-main, .overview-trend { padding: 1.32rem clamp(.85rem, 2.2vw, 1.65rem); min-width: 0; }
.overview-main { border-top: 3px solid #4770b3; padding-top: calc(1.32rem - 3px); }
.overview-trend { border-left: 1px solid var(--line); background: #fbfcfe; }
.overview-title { color: #32485f; font-size: .84rem; font-weight: 650; line-height: 1.35; }
.hero-number { color: #173251; font-size: clamp(1.72rem, 4vw, 2.58rem); letter-spacing: -.055em; font-weight: 735; line-height: 1.2; margin-top: .32rem; overflow-wrap: anywhere; }
.overview-meta { color: var(--muted); margin-top: .35rem; font-size: .8rem; line-height: 1.4; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .85rem; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .86rem; }
.metric-label { color: var(--muted); display: block; font-size: .76rem; line-height: 1.35; }
.metric-value { display: block; margin-top: .24rem; font-size: .98rem; font-weight: 690; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.negative { color: var(--loss) !important; }
.section { margin-top: 1.55rem; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: .7rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; padding: 1rem 1.2rem; }
.table-scroll { max-width: 100%; max-height: min(36rem, 74vh); overflow: auto; background: var(--surface); border: 1px solid #d5dee9; border-radius: .42rem; scrollbar-color: #9eacbd #f2f5f9; }
.table-hint { display: none; margin-bottom: .35rem; color: var(--muted); font-size: .75rem; }
.table-scroll:focus-visible { outline-offset: 1px; }
table { border-spacing: 0; width: 100%; font-size: .83rem; }
th, td { padding: .66rem .76rem; border-bottom: 1px solid #e4e9f0; text-align: left; vertical-align: middle; }
tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tr:hover > td, tr:hover > th[scope=row] { background: #f3f7fd; }
thead th { position: sticky; top: 0; z-index: 2; background: #edf2f8; color: #344a61; font-size: .74rem; font-weight: 680; line-height: 1.35; border-bottom-color: #d4dfeb; }
.table-scroll .sticky { position: sticky; left: 0; z-index: 1; min-width: 9.4rem; max-width: 15.5rem; border-right: 1px solid #dbe3ee; background: var(--surface); }
.table-scroll thead .sticky { z-index: 3; background: #edf2f8; }
.table-scroll tr:hover .sticky { background: #f3f7fd; }
.table-scroll tr:hover thead .sticky { background: #edf2f8; }
.month-table { min-width: 48rem; }
.wide-table { min-width: 84rem; }
.wide-table .report-item { min-width: 12.6rem; }
.numeric { text-align: right; white-space: nowrap; }
.cell-head { font-size: .83rem; line-height: 1.3; font-weight: 690; }
.cell-note { color: var(--muted); display: block; font-size: .72rem; font-weight: 460; line-height: 1.4; margin-top: .18rem; }
.cell-note.warning { color: var(--warning); }
.cell-link { border: 0; background: none; margin: 0; padding: .2rem 0; color: var(--blue); text-decoration: underline; text-decoration-thickness: .075em; text-underline-offset: .18em; font: inherit; font-variant-numeric: inherit; }
.cell-link:hover { color: #102c66; }
.cell-link.negative { color: var(--loss); }
.profit-cell { font-weight: 730; }
.profit-head, .profit-cell { background: #f2f6fd; }
.row-arrow { margin-left: .35ch; display: inline-block; }
.button { min-height: 2.38rem; display: inline-flex; gap: .36rem; align-items: center; justify-content: center; padding: .46rem .76rem; text-align: center; font-size: .825rem; line-height: 1.35; font-weight: 650; border: 1px solid transparent; border-radius: .35rem; text-decoration: none; }
.button.secondary { border-color: #cdd8e5; color: #244467; background: var(--surface); }
.button.secondary:hover { background: #edf3fd; }
.button.primary { color: #fff; background: #234e92; border-color: #234e92; }
.button.primary:hover { color: #fff; background: #183b76; }
.button:disabled { opacity: .63; cursor: wait; }
.button.icon-button { padding: .15rem .6rem .33rem; font-size: 1.55rem; min-width: 2.45rem; line-height: 1; border-color: var(--line); color: var(--navy); background: var(--surface); }
.button.icon-button:hover { background: var(--blue-soft); }
.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; padding: .82rem 1rem; display: flex; align-items: end; flex-wrap: wrap; gap: .62rem 1rem; }
.preset-row, .inline, .actions, .method-legend, .period-fields { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.period-fields { align-items: end; gap: .5rem .85rem; }
.preset-row .button[aria-current] { background: var(--blue-soft); color: #153775; border-color: #9bb9e9; }
.actions { gap: .78rem; }
.field { display: flex; flex-direction: column; gap: .3rem; color: #40546a; font-size: .79rem; min-width: 0; font-weight: 620; }
.field input, .field select, .search { min-height: 2.38rem; max-width: 100%; min-width: 0; padding: .42rem .52rem; color: #192a3d; border: 1px solid #bdcbdb; border-radius: .32rem; background: #fff; font-size: .9rem; font-weight: 450; }
.search-box { min-width: min(16rem,100%); }
.search-box input { width: 100%; }
.notice { border-left: 3px solid #7895bd; background: #eef4fc; color: #284763; padding: .64rem .8rem; line-height: 1.45; font-size: .82rem; margin: .85rem 0; overflow-wrap: anywhere; }
.notice.warning { border-color: #bc853c; color: #69420e; background: #fff5e7; }
.notice.error { border-color: #ac4561; color: #79213a; background: #fceef2; }
.issue-list { margin: .4rem 0 0; padding-left: 1.2rem; }
.empty { background: var(--surface); border: 1px dashed #b3c2d4; color: var(--muted); border-radius: .35rem; padding: 1.2rem; line-height: 1.55; }
.empty .actions { margin-top: .75rem; }
.reconcile { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.15rem; }
.reconcile > div + div { border-left: 1px solid var(--line); padding-left: 1.15rem; }
.formula { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .52rem 1rem; align-items: center; margin: .75rem 0 0; color: #334e6b; font-size: .85rem; }
.formula dd { margin: 0; text-align: right; font-weight: 650; }
.formula .formula-total { color: #172f51; font-weight: 730; padding-top: .58rem; border-top: 1px solid var(--line); }
.abc { display: inline-block; min-width: 1.65rem; text-align: center; padding: .19rem .37rem; border-radius: .24rem; line-height: 1.25; color: #244b7a; background: #eaf0f9; font-size: .72rem; font-weight: 680; }
.abc.loss { background: #f9e9ef; color: #912d46; }
.abc.incomplete { background: #fff2dd; color: #754611; }
.abc.b { background: #edf1f7; color: #3a526f; }
.abc.c, .abc.zero { background: #eef0f3; color: #495665; }
details.hint { color: var(--muted); font-size: .83rem; line-height: 1.45; }
details.hint summary { color: var(--blue); }
details.hint p { max-width: 50rem; margin-top: .48rem; }
.chart { padding-top: .62rem; }
.chart-row { display: grid; grid-template-columns: minmax(4.6rem, 6.1rem) minmax(3rem, 1fr) minmax(4.15rem, auto); gap: .52rem; align-items: center; padding: .23rem 0; color: var(--muted); font-size: .74rem; }
.chart-label { overflow-wrap: anywhere; }
.chart-val { text-align: right; font-size: .78rem; font-weight: 660; color: #213e5c; }
.chart-track { display: flex; height: .51rem; border-radius: .1rem; }
.chart-half { width: 50%; display: flex; align-items: stretch; background: #e8eff8; }
.chart-half:first-child { justify-content: end; border-right: 1px solid #8a9db7; }
.chart-track.only-positive .chart-half:first-child { display: none; }
.chart-track.only-positive .chart-half:last-child { width: 100%; }
.chart-fill { background: #4a72ae; border-radius: .09rem; }
.chart-fill.negative { background: #a64b62; }
.chart.empty-chart { padding-top: .82rem; }
.chart .quiet { color: var(--muted); font-size: .78rem; }
.chart-long { max-height: 18rem; overflow-y: auto; }
.dialog-body .subtle + .table-scroll { margin-top: .65rem; }
.compare-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compare-panel .toolbar { padding: 0; border: 0; }
.compare-summary { font-size: 1.15rem; font-weight: 690; color: var(--navy); margin-top: .8rem; }
.method-legend { margin-top: .55rem; }
.data-rule { margin-top: 1rem; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.dialog-header { position: sticky; z-index: 4; top: 0; background: var(--surface); padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
dialog { color: inherit; padding: 0; width: min(55rem, calc(100% - 1.75rem)); max-width: none; max-height: min(85dvh, 60rem); border: 1px solid #aebdd0; border-radius: .6rem; box-shadow: 0 16px 70px #11264240; scroll-padding-top: 5rem; }
dialog::backdrop { background: #172d4e66; }
.dialog-body { padding: 1rem 1.2rem 1.25rem; }
.dialog-body section + section { border-top: 1px solid var(--line); margin-top: 1.05rem; padding-top: 1rem; }
.dialog-body section:first-child .notice:first-child { margin-top: 0; }
.dialog-body form { margin-top: .65rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem .8rem; }
.form-grid .full { grid-column: 1 / -1; }
.source-list { padding-left: 1.2rem; margin: .55rem 0 0; overflow-wrap: anywhere; font-size: .84rem; line-height: 1.45; }
.correction-list li + li { margin-top: .55rem; }
.operation { border: 1px solid var(--line); border-radius: .3rem; margin-top: .6rem; padding: .65rem .8rem; }
.operation summary { color: #25476e; font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }
.operation dl { font-size: .8rem; display: grid; grid-template-columns: minmax(6rem, .45fr) minmax(0, 1.55fr); gap: .32rem .55rem; margin: .7rem 0 0; overflow-wrap: anywhere; }
.operation dd { margin: 0; }
.operation dt { color: var(--muted); }
.operation-detail { font: inherit; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.operation .button { margin-top: .65rem; }
.op-basis { list-style: none; margin: 0; padding: 0; }
.form-status:empty { display: none; }
.form-status { margin-top: .55rem; }
@media (max-width: 68rem) {
  .workspace { grid-template-columns: minmax(11.25rem,13.4rem) minmax(0,1fr); }
  :root { --pad: 1.35rem; }
  .overview { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
}
@media (max-width: 52rem) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: .74rem var(--pad); }
  .brand-mark { width: 1.96rem; height: 1.96rem; padding-bottom: .41rem; }
  .brand small, .sidebar-bottom, .nav-title { display: none; }
  .sidebar-body { padding: 0 var(--pad) .58rem; }
  .navigation { display: flex; flex-wrap: wrap; }
  .navigation a { padding: .6rem; }
  .topbar { min-height: 0; }
  main { padding-top: 1.5rem; }
  .table-hint { display: block; }
}
@media (max-width: 38rem) {
  :root { --pad: .85rem; }
  .topbar { flex-wrap: wrap; gap: .42rem 1rem; }
  .topbar:not(:has(.breadcrumbs a)) .breadcrumbs { display: none; }
  .top-actions { gap: .5rem; }
  .hosted .top-actions { width: 100%; justify-content: flex-start; }
  .hosted .top-actions:has(#login-link:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .hosted .top-actions:has(#login-link:not([hidden])) .mode { grid-column: 1 / -1; justify-self: start; }
  .hosted .top-actions:has(#login-link:not([hidden])) #windows-download { justify-self: start; }
  .navigation a { padding-inline: .43rem; }
  .heading { gap: .25rem .8rem; }
  .period-fields { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .47rem; }
  .period-fields .button { grid-column: 1 / -1; justify-self: start; }
  .period-fields input { width: 100%; }
  .overview, .reconcile, .compare-panel { grid-template-columns: minmax(0,1fr); }
  .overview-trend { border-left: 0; border-top: 1px solid var(--line); }
  .reconcile > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: .9rem; }
  .table-scroll .sticky { min-width: 7rem; max-width: 9.8rem; }
  .wide-table .report-item { min-width: 8.6rem; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .notice { margin-block: .6rem; }
}
@media (max-width: 22rem) {
  .hosted .navigation .nav-icon { display: none; }
}
@media (forced-colors: active) {
  .chart-fill { background: CanvasText; forced-color-adjust: none; }
  .brand-mark { border: 1px solid CanvasText; }
}
