* { box-sizing: border-box; }
:root {
    color-scheme: dark;
    --bg: #070a0f;
    --panel: #111923;
    --panel-2: #0d141d;
    --line: rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.16);
    --text: #f4f7fb;
    --muted: #8a96a7;
    --faint: #626e80;
    --green: #2ce69b;
    --red: #ff6174;
    --amber: #f9c74f;
    --blue: #69a8ff;
    --mono: "Roboto Mono", monospace;
    --sans: "Noto Sans KR", sans-serif;
}
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input, select, textarea { font: inherit; }
.shell { width: min(1680px, 100%); margin: 0 auto; padding: 14px; }
.topbar { display: flex; align-items: center; gap: 14px; min-height: 58px; margin-bottom: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,13,20,.94); position: sticky; top: 8px; z-index: 20; }
.brand { flex: 0 0 auto; font-weight: 800; white-space: nowrap; }
nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: .72rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
nav a.active, nav a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.clock { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: .7rem; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,20,29,.78); }
.toolbar input { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--text); color-scheme: dark; }
.toolbar .token-input { width: 168px; }
.btn { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); font-size: .72rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.btn.primary { border-color: rgba(105,168,255,.48); background: rgba(105,168,255,.13); }
.btn:hover { background: #172232; }
.status { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: .65rem; }
.schedule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.slot { min-height: 116px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, rgba(17,25,35,.96), rgba(10,15,22,.96)); }
.slot-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.slot h2 { margin: 0; font-size: .88rem; }
.pill { display: inline-flex; align-items: center; min-height: 21px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); font-family: var(--mono); font-size: .58rem; font-weight: 800; }
.pill.good { color: var(--green); background: rgba(44,230,155,.1); }
.pill.bad { color: var(--red); background: rgba(255,97,116,.1); }
.pill.warn { color: var(--amber); background: rgba(249,199,79,.1); }
.slot-time { display: block; color: var(--blue); font-family: var(--mono); font-size: .72rem; font-weight: 800; }
.slot p { margin: 7px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 10px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(17,25,35,.97), rgba(10,15,22,.97)); overflow: hidden; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.head h1, .head h2 { margin: 0; font-size: .95rem; }
.meta { color: var(--muted); font-family: var(--mono); font-size: .62rem; white-space: nowrap; }
.body { padding: 12px; }
.report-list, .history-list { display: grid; gap: 8px; }
.report-card, .date-card, .block, .provider, .metric, .level { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.report-card, .date-card { width: 100%; padding: 11px 12px; color: var(--text); text-align: left; cursor: pointer; }
.report-card:hover, .report-card.active, .date-card:hover, .date-card.active { border-color: rgba(105,168,255,.44); background: rgba(105,168,255,.08); }
.report-title { display: block; font-size: .78rem; font-weight: 800; line-height: 1.35; }
.report-sub { display: block; margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: .58rem; line-height: 1.45; }
.empty { padding: 18px 12px; color: var(--muted); font-size: .72rem; line-height: 1.55; text-align: center; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.metric { padding: 11px; min-width: 0; }
.metric span { display: block; color: var(--muted); font-size: .6rem; font-weight: 800; }
.metric strong { display: block; margin-top: 5px; font-family: var(--mono); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.block { padding: 13px; }
.block.wide { grid-column: 1 / -1; }
.block h3, .provider h3 { margin: 0 0 8px; font-size: .82rem; }
.block p, .block li, .provider p, .provider li { color: #d9e1ec; font-size: .74rem; line-height: 1.55; }
.block p { margin: 0; }
ul { margin: 0; padding-left: 18px; }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.provider { padding: 13px; }
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.level-list { display: grid; gap: 7px; margin-top: 8px; }
.level { padding: 9px; }
.level strong { display: block; font-family: var(--mono); font-size: .72rem; }
.level span { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.health-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.health { padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .61rem; text-align: center; }
.health.good { color: var(--green); background: rgba(44,230,155,.06); }
.health.bad { color: var(--red); background: rgba(255,97,116,.06); }
.prompt-box {
    max-height: 260px;
    margin: 8px 0 10px;
    padding: 10px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0,0,0,.22);
    color: #dbe6f3;
    font-family: var(--mono);
    font-size: .62rem;
    line-height: 1.55;
    white-space: pre-wrap;
}
.prompt-details { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.14); }
.prompt-details summary { padding: 10px; color: var(--blue); font-size: .72rem; font-weight: 800; cursor: pointer; }
.prompt-details .prompt-box { margin: 0 10px 10px; }
.manual-input {
    width: 100%;
    min-height: 150px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    color: var(--text);
    resize: vertical;
}
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 1180px) {
    .layout, .section-grid, .provider-grid { grid-template-columns: 1fr; }
    .detail-grid, .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .shell { padding: 8px; }
    .topbar, .toolbar { align-items: flex-start; flex-direction: column; }
    .clock, .status { display: none; }
    .toolbar input, .btn { width: 100%; }
    .detail-grid, .health-grid { grid-template-columns: 1fr; }
}
