:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: #f5f7f8;
  color: #172732;
  line-height: 1.45;
  --surface: #fff;
  --canvas: #f5f7f8;
  --ink: #172732;
  --muted: #5e6e78;
  --line: #dce3e7;
  --accent: #095c66;
  --accent-soft: #e8f3f3;
  --danger: #9a2c2c;
  --danger-soft: #fff0ef;
  --success: #236345;
  --success-soft: #eaf5ee;
  --warning: #80500b;
  --warning-soft: #fff6e6;
  font-size: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #78b5bc; outline-offset: 2px; }
::selection { background: #cce8eb; }

.boot { padding: 3rem; color: var(--muted); }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1.2rem; min-height: 68px; padding: .8rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: .7rem; align-items: center; white-space: nowrap; color: var(--ink); font-size: 1.08rem; font-weight: 710; letter-spacing: -.025em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 6px; color: white; background: #123c46; font-size: .8rem; letter-spacing: -.08em; }
.search { display: flex; align-items: stretch; gap: 0; width: min(530px, 46vw); margin: 0 auto; }
.search select, .search input { border: 1px solid var(--line); background: var(--canvas); min-height: 36px; }
.search select { width: 113px; border-radius: 6px 0 0 6px; border-right: 0; padding: 0 .55rem; color: var(--muted); }
.search input { min-width: 0; flex: 1; border-radius: 0; padding: 0 .65rem; }
.search button { border-radius: 0 6px 6px 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.identity { display: flex; flex-direction: column; align-items: flex-end; font-size: .82rem; line-height: 1.25; }
.identity strong { font-weight: 650; }
.identity span { color: var(--muted); }
.nav-row { display: flex; align-items: center; gap: .3rem; padding: 0 1.45rem; min-height: 48px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.nav-link { display: inline-flex; align-items: center; min-height: 47px; padding: 0 .9rem; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 560; white-space: nowrap; }
.nav-link:hover { color: var(--ink); text-decoration: none; }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.workspace { display: grid; grid-template-columns: 250px minmax(350px, 1fr) 335px; flex: 1; min-height: 0; max-width: 1800px; width: 100%; margin: 0 auto; }
.pane { min-width: 0; background: var(--surface); }
.pane + .pane { border-left: 1px solid var(--line); }
.pane-list { background: #f8fafb; }
.pane-main { min-height: calc(100vh - 116px); }
.pane-inspector { background: #fcfdfd; }
.pane-header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: 1.2rem 1.3rem .85rem; border-bottom: 1px solid var(--line); min-height: 74px; }
.pane-header h1, .pane-header h2 { margin: 0; font-size: 1.04rem; letter-spacing: -.015em; font-weight: 680; }
.pane-body { padding: 1.1rem 1.3rem 2rem; }
.pane-list .pane-body { padding: .65rem; }
.section-label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .075em; margin: 1.3rem 0 .55rem; }
.section-label:first-child { margin-top: 0; }
.list-item { display: block; width: 100%; text-align: left; padding: .72rem .78rem; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--ink); margin-bottom: .25rem; }
.list-item:hover { background: #eef3f4; }
.list-item.selected { background: var(--accent-soft); border-color: #c5dcdf; }
.list-item-title { display: flex; align-items: center; gap: .45rem; font-weight: 620; }
.list-item-sub { display: block; color: var(--muted); font-size: .81rem; margin-top: .17rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-item-meta { color: var(--muted); font-size: .8rem; margin-top: .33rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; overflow-wrap: anywhere; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .69rem; font-weight: 750; color: var(--muted); }
.record-head { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.record-head h2 { margin: .18rem 0 .2rem; font-size: 1.35rem; font-weight: 690; letter-spacing: -.025em; }
.record-sub { color: var(--muted); font-size: .84rem; }
.balance { margin: .8rem 0 1.3rem; font-size: 2rem; line-height: 1.1; letter-spacing: -.045em; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance .currency { font-size: .85rem; color: var(--muted); font-weight: 560; letter-spacing: 0; margin-left: .25rem; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.4rem; margin: 1rem 0; }
.meta-grid dt { color: var(--muted); font-size: .78rem; margin-bottom: .18rem; }
.meta-grid dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 36px; padding: .48rem .78rem; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font-weight: 620; text-align: center; line-height: 1.2; }
.btn:hover:not(:disabled) { background: #f3f6f7; text-decoration: none; }
.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #074c55; }
.btn-danger { color: var(--danger); border-color: #e7c5c2; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); padding-inline: .4rem; }
.btn-quiet:hover:not(:disabled) { background: var(--accent-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 30px; padding: .3rem .55rem; font-size: .8rem; }
.form { display: flex; flex-direction: column; gap: .95rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .field-label { font-weight: 620; font-size: .85rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: .5rem .64rem; border: 1px solid #b9c7cd; background: white; color: var(--ink); border-radius: 6px; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:disabled, .field select:disabled { background: #f1f4f5; }
.help { color: var(--muted); font-size: .78rem; }
.check-row { display: flex; align-items: center; gap: .55rem; padding: .22rem 0; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .2rem; }
.review { padding: .85rem; border: 1px solid #bcd8dc; border-radius: 7px; background: #f5fbfb; }
.review strong { display: block; margin-bottom: .35rem; }
.notice { border: 1px solid; border-radius: 7px; padding: .8rem .9rem; line-height: 1.4; margin-bottom: 1rem; }
.notice.success { border-color: #c0ddc9; background: var(--success-soft); color: #1d5439; }
.notice.error { border-color: #ecc5c1; background: var(--danger-soft); color: #812525; }
.notice.warning { border-color: #ead6a9; background: var(--warning-soft); color: #68420c; }
.notice.info { border-color: #c7dee1; background: #eff7f7; color: #245660; }
.notice p { margin: .25rem 0 0; }
.badge { display: inline-flex; align-items: center; min-height: 21px; padding: .13rem .48rem; border-radius: 4px; background: #eef2f3; color: #3d5562; font-weight: 690; font-size: .72rem; letter-spacing: .015em; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.table-wrap { overflow-x: auto; margin: .4rem -1.3rem 0; }
.table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: .86rem; }
.table th { color: var(--muted); font-size: .75rem; font-weight: 660; text-align: left; border-bottom: 1px solid var(--line); padding: .63rem 1rem; white-space: nowrap; }
.table td { border-bottom: 1px solid #edf1f3; padding: .72rem 1rem; vertical-align: middle; }
.table tbody tr:hover { background: #f8fbfb; }
.table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-action { color: var(--accent); font-weight: 620; }
.empty { padding: 2.1rem 1rem; text-align: center; color: var(--muted); border: 1px dashed #d3dfe3; border-radius: 8px; }
.empty strong { display: block; color: var(--ink); font-size: .94rem; margin-bottom: .2rem; }
.loading { color: var(--muted); padding: 1.1rem 0; }
.inline-link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-align: left; }
.inline-link:hover { text-decoration: underline; }
.mobile-back { display: none; }
.hint-box { border-left: 3px solid #9ec9cf; padding: .5rem .75rem; color: var(--muted); background: #f4f9fa; font-size: .83rem; }
.sign-in { max-width: 420px; margin: clamp(2rem, 10vh, 7rem) auto; padding: 1.8rem; background: white; border: 1px solid var(--line); border-radius: 10px; }
.sign-in h1 { margin: 1rem 0 .4rem; font-size: 1.4rem; }
.sign-in p { color: var(--muted); margin: .3rem 0 1.4rem; }
.sign-in .btn { width: 100%; }
.toast { position: fixed; bottom: 1rem; right: 1rem; max-width: min(420px, calc(100vw - 2rem)); z-index: 20; box-shadow: 0 10px 28px #17273220; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 220px minmax(320px, 1fr) 300px; }
  .pane-header, .pane-body { padding-left: 1rem; padding-right: 1rem; }
  .table-wrap { margin-left: -1rem; margin-right: -1rem; }
}
@media (max-width: 920px) {
  .topbar { flex-wrap: wrap; gap: .55rem; padding: .65rem 1rem; }
  .search { order: 3; width: 100%; margin: .2rem 0 0; }
  .nav-row { padding: 0 .7rem; }
  .workspace { display: flex; flex-direction: column; }
  .pane { border-left: 0 !important; }
  .pane-list { order: 0; border-bottom: 1px solid var(--line); }
  .pane-inspector { order: 1; border-bottom: 1px solid var(--line); }
  .pane-main { order: 2; min-height: 0; }
  .pane-list .pane-header { display: none; }
  .pane-list .pane-body { display: flex; gap: .3rem; overflow-x: auto; padding: .6rem 1rem; }
  .pane-list .section-label { display: none; }
  .pane-list .list-item { min-width: 150px; max-width: 210px; margin: 0; flex: 0 0 auto; }
  .mobile-back { display: inline-flex; }
}
@media (max-width: 560px) {
  .topbar-right .identity { display: none; }
  .topbar { min-height: 60px; }
  .nav-link { padding: 0 .65rem; }
  .pane-header { padding: .9rem 1rem; min-height: 60px; }
  .pane-body { padding-bottom: 1.4rem; }
  .meta-grid { grid-template-columns: 1fr; gap: .65rem; }
  .balance { font-size: 1.65rem; }
  .workspace.mobile-detail .pane-list { display: none; }
  .workspace:not(.mobile-detail) .pane-main, .workspace:not(.mobile-detail) .pane-inspector { display: none; }
  .pane-inspector { border-top: 1px solid var(--line); }
  .search select { width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
