:root {
  color-scheme: dark;
  --ink: #f4f1e9;
  --sub: #acb3c2;
  --gold: #e5c588;
  --border: #303746;
  --surface: #141b28;
  background: #0a0e16;
  color: var(--ink);
  font: 15px/1.65 "Noto Sans JP","Hiragino Sans","Yu Gothic",Meiryo,system-ui,sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 3.2vw, 2.7rem); line-height: 1.2; letter-spacing: .035em; }
h2 { font-size: 1.15rem; }
a { color: var(--gold); text-underline-offset: .25em; }
small { color: var(--sub); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.workspace { flex: 1; padding: clamp(1rem, 4vw, 4rem); min-width: 0; max-width: 1500px; }
.application { display: flex; min-height: 100vh; background: radial-gradient(ellipse at 100% 0,#192438,transparent 60%); }
aside { width: 224px; flex: 0 0 224px; background: #0a101b; border-right: 1px solid var(--border); padding: 26px 14px; }
.brand { display:flex; align-items:center; gap:12px; font-family: Georgia,serif; color: var(--ink); letter-spacing:.12em; font-weight: 700; text-decoration:none; padding:0 7px; }
.brand small { display:block; color:var(--gold); font: .63rem/1.6 system-ui,sans-serif; letter-spacing:.18em; }
.mark { flex: 0 0 42px; display:grid; place-items:center; height:42px; border:1px solid #645234; border-radius:12px; color:var(--gold); font-size:1.6rem; background:linear-gradient(145deg,#302717,#171a22); }
nav { display:grid; gap:3px; margin-top:28px; }
nav a { padding:8px 12px; color:var(--sub); text-decoration:none; border-radius:7px; white-space:nowrap; }
nav a:hover, nav [aria-current] { color:var(--gold); background:#2b281f; }
.top, .account, .record-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.top { margin-bottom:24px; }
.top .button { background:transparent; color:var(--sub); border:1px solid var(--border); padding:6px 10px; }
.card, .metric { background:linear-gradient(145deg,#192131,var(--surface)); border:1px solid var(--border); border-radius:15px; padding:clamp(1rem,2.3vw,1.7rem); margin-bottom:16px; min-width:0; }
.metrics, .cards, .columns, .ai-grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr)); }
.metric { text-decoration:none; color:var(--sub); }
.metric strong { display:block; color:var(--gold); font: 2.5rem/1.4 Georgia,serif; font-variant-numeric:tabular-nums; }
.columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
.hierarchy h2 { text-align:center; }
.ai-grid article { padding:12px; text-align:center; border-radius:8px; border:1px solid var(--border); color:var(--gold); }
.units { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.units li { border-left:2px solid #8d7245; background:#101725; padding:8px 12px; }
.units small { display:block; }
.chart { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.bar { color:var(--sub); font-size:.78rem; margin:4px 0; }
meter { width:100%; display:block; height:12px; }
meter::-webkit-meter-optimum-value { background:#dabc78; }
.expense meter::-webkit-meter-optimum-value { background:#829fc8; }
meter::-moz-meter-bar { background:#dabc78; }
.expense meter::-moz-meter-bar { background:#829fc8; }
label { display:block; margin:0 0 13px; }
input:not([type=hidden]),textarea,select { display:block; width:100%; margin-top:4px; border:1px solid #465066; background:#0c1422; color:var(--ink); padding:10px 12px; min-height:44px; border-radius:8px; font:inherit; }
textarea { min-height:120px; resize:vertical; }
button { font:inherit; cursor:pointer; }
.button { border:1px solid transparent; border-radius:8px; padding:8px 14px; color:#16130d; background:var(--gold); font-weight:700; }
.button:hover { filter:brightness(1.12); }
.record-head h2 { margin:0; overflow-wrap:anywhere; }
.record-body { white-space:pre-wrap; overflow-wrap:anywhere; margin:10px 0; }
.record form, details, .reply { margin-top:14px; }
summary { color:var(--gold); cursor:pointer; }
.reply { border-left:2px solid #7b6748; padding:8px 12px; background:#121a28; }
.pill { display:inline-block; color:var(--gold); border:1px solid #675638; padding:2px 9px; border-radius:100px; font-size:.78rem; }
.empty,.ok,.error { padding:10px 14px; border:1px solid var(--border); border-radius:9px; }
.ok { color:#afe4bc; } .error { color:#ffb9b9; }
.entrance { min-height:100vh; display:grid; place-items:center; padding:20px; background:radial-gradient(ellipse at 55% 20%,#253349,transparent 55%); }
.login { width:min(100%,440px); padding:32px; }
.login .brand { margin-bottom:30px; }
.scroll { overflow-x:auto; }
table { width:100%; border-collapse:collapse; text-align:left; }
td,th { border-bottom:1px solid var(--border); padding:9px; white-space:nowrap; }
@media (max-width: 760px) {
  .application { display:block; }
  aside { width:100%; border-right:0; border-bottom:1px solid var(--border); padding:12px; }
  nav { display:flex; overflow-x:auto; margin-top:10px; padding:3px; }
  .columns { grid-template-columns:1fr; }
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .chart { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
