:root{
  --bg: #f5f7fb;
  --text: #0b1220;
  --muted: rgba(11,18,32,.62);
  --border: rgba(11,18,32,.12);
  --border2: rgba(11,18,32,.08);
  --panel: rgba(255,255,255,.78);
  --panel-solid: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.06);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.05);
  --radius: 14px;
  --radius-sm: 10px;

  --accent: #4f46e5;
  --accent-2: #3b82f6;
  --danger: #b00020;

  --focus: 0 0 0 3px rgba(79,70,229,.22);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1020;
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.62);
    --border: rgba(255,255,255,.14);
    --border2: rgba(255,255,255,.08);
    --panel: rgba(255,255,255,.06);
    --panel-solid: rgba(16,22,38,1);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.35);
    --shadow-soft: 0 1px 2px rgba(0,0,0,.35);
    --danger: #ff6b7a;
    --focus: 0 0 0 3px rgba(99,102,241,.30);
  }
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Noto Sans JP', sans-serif;
  margin:16px;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(79,70,229,.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(59,130,246,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
  line-height:1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h2{
  margin:0 0 12px 0;
  font-size:18px;
  font-weight:800;
  letter-spacing:.2px;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.box{
  border:1px solid var(--border);
  padding:10px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.grow{ flex:1 1 320px; }

.small{ font-size:12px; color:var(--muted); }
.muted{ color:var(--muted); }

.status{
  font-weight:800;
  margin-top:4px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.status::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.err{
  color: var(--danger);
  white-space: pre-wrap;
  font-size: 12px;
  margin-top: 6px;
}

button{
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .05s ease, filter .15s ease, box-shadow .15s ease, border-color .15s ease;
}
@media (prefers-color-scheme: dark){
  button{
    background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  }
}

button:hover{
  filter: brightness(1.02);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 26px rgba(0,0,0,.08);
}
button:active{ transform: translateY(1px); }

button:focus, input:focus, summary:focus{
  outline: none;
  box-shadow: var(--focus);
}

input[type="number"]{
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  width: 100%;
  max-width: 140px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

input[type="range"]{ width:100%; }

input[type="range"]{
  accent-color: var(--accent);
}

table{
  width:100%;
  border-collapse: collapse;
  margin-top:10px;
  font-size:12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

th, td{
  border-bottom: 1px solid var(--border2);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

tbody tr:hover{ background: rgba(79,70,229,.06); }
@media (prefers-color-scheme: dark){
  tbody tr:hover{ background: rgba(99,102,241,.10); }
}

th{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  font-weight: 800;
}
@media (prefers-color-scheme: dark){
  th{ background: rgba(16,22,38,.92); }
}

.kbd{
  display:inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: var(--panel-solid);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 11px;
  color: var(--text);
}

.switch{
  display:flex;
  align-items:center;
  gap:6px;
}
.switch span{ font-weight:800; }

details{
  margin-top: 10px;
  border-radius: var(--radius);
}
summary{
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  color: var(--text);
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}
