:root {
  --bg: #070a10;
  --panel: #10151f;
  --panel-2: #151c28;
  --line: #263142;
  --text: #f4f7fb;
  --muted: #92a1b6;
  --blue: #4f8cff;
  --red: #ff3856;
  --green: #35d07f;
  --yellow: #f7bd45;
  --radius: 18px;
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(79,140,255,.13), transparent 34%), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.site-header { height: 76px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(7,10,16,.88); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 950; font-size: 1.1rem; background: linear-gradient(135deg, var(--blue), #2554c7); box-shadow: 0 10px 24px rgba(79,140,255,.25); }
.brand b, .brand small { display: block; }
.brand b { font-size: .95rem; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.public-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #bcc7d6; font-size: .75rem; font-weight: 750; }
.public-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(53,208,127,.12); }
.button { border: 0; border-radius: 10px; min-height: 38px; padding: 0 14px; color: var(--text); font-weight: 800; font-size: .78rem; cursor: pointer; }
.button.ghost { border: 1px solid var(--line); background: #111722; }
.button.primary { background: var(--blue); box-shadow: 0 8px 20px rgba(79,140,255,.22); }
.button:hover { filter: brightness(1.12); }
.shell { width: min(1240px, calc(100% - 40px)); margin: 30px auto 56px; }
.status-hero { position: relative; overflow: hidden; min-height: 176px; padding: 30px 32px; border: 1px solid var(--line); border-radius: 24px; display: flex; align-items: center; gap: 25px; background: linear-gradient(120deg, #121926, #0d121b); box-shadow: 0 24px 70px rgba(0,0,0,.23); }
.status-hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 330px; height: 330px; border-radius: 50%; background: radial-gradient(circle, rgba(53,208,127,.18), transparent 68%); pointer-events: none; }
.status-hero[data-state="critical"]::after { background: radial-gradient(circle, rgba(255,56,86,.24), transparent 68%); }
.status-hero[data-state="warning"]::after { background: radial-gradient(circle, rgba(247,189,69,.2), transparent 68%); }
.hero-signal { flex: 0 0 82px; width: 82px; height: 82px; position: relative; display: grid; place-items: center; }
.hero-signal span { position: absolute; border: 2px solid var(--green); border-radius: 50%; opacity: .2; animation: pulse 2.4s infinite; }
.hero-signal span:nth-child(1) { width: 28px; height: 28px; opacity: 1; background: var(--green); box-shadow: 0 0 24px rgba(53,208,127,.4); }
.hero-signal span:nth-child(2) { width: 54px; height: 54px; animation-delay: .35s; }
.hero-signal span:nth-child(3) { width: 80px; height: 80px; animation-delay: .7s; }
.status-hero[data-state="critical"] .hero-signal span { border-color: var(--red); }
.status-hero[data-state="critical"] .hero-signal span:first-child { background: var(--red); box-shadow: 0 0 24px rgba(255,56,86,.45); }
.status-hero[data-state="warning"] .hero-signal span { border-color: var(--yellow); }
.status-hero[data-state="warning"] .hero-signal span:first-child { background: var(--yellow); box-shadow: 0 0 24px rgba(247,189,69,.4); }
@keyframes pulse { 0% { transform: scale(.78); opacity: .1; } 45% { opacity: .45; } 100% { transform: scale(1.08); opacity: 0; } }
.hero-copy { position: relative; z-index: 1; flex: 1; }
.eyebrow { margin: 0 0 8px; color: #78a5ff; font-size: .65rem; font-weight: 900; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
.hero-copy h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.045em; }
.hero-copy p:last-child { margin: 0; color: #b2bfd0; line-height: 1.6; }
.hero-meta { position: relative; z-index: 1; align-self: flex-start; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #111722; cursor: pointer; font-size: 1.1rem; }
.icon-button.loading { animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.kpi-card, .panel { border: 1px solid var(--line); background: rgba(16,21,31,.94); border-radius: var(--radius); }
.kpi-card { padding: 18px 20px; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.kpi-label { color: var(--muted); font-size: .72rem; font-weight: 750; }
.kpi-card strong { margin: 8px 0 2px; font-size: 1.45rem; letter-spacing: -.03em; }
.kpi-card small { color: #718095; font-size: .68rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 14px; }
.panel { padding: 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading h2, .recommendation-panel h2, dialog h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.025em; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .65rem; white-space: nowrap; }
.legend i { width: 7px; height: 7px; border-radius: 50%; margin-left: 4px; }
.legend .ok { background: var(--green); } .legend .warning { background: var(--yellow); } .legend .error { background: var(--red); }
.pipeline { display: flex; flex-direction: column; }
.stage { position: relative; padding: 0 0 20px 50px; min-height: 82px; }
.stage:last-child { padding-bottom: 0; }
.stage::before { content: ""; position: absolute; top: 24px; bottom: 0; left: 17px; width: 1px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage-node { position: absolute; left: 0; top: 1px; width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .82rem; font-weight: 900; }
.stage[data-status="ok"] .stage-node { color: var(--green); border-color: rgba(53,208,127,.35); background: rgba(53,208,127,.08); }
.stage[data-status="warning"] .stage-node { color: var(--yellow); border-color: rgba(247,189,69,.4); background: rgba(247,189,69,.09); }
.stage[data-status="error"] .stage-node { color: var(--red); border-color: rgba(255,56,86,.4); background: rgba(255,56,86,.09); }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-name { color: #8c9ab0; font-size: .68rem; font-weight: 800; }
.stage-summary { margin: 4px 0 5px; font-weight: 850; font-size: .93rem; }
.stage-detail { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.stage-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.metric-chip { padding: 5px 8px; border-radius: 7px; background: #0a0e15; color: #a9b6c8; font-size: .63rem; }
.stage-action { flex: none; border: 1px solid rgba(79,140,255,.45); border-radius: 8px; padding: 7px 10px; background: rgba(79,140,255,.1); color: #a9c6ff; font-size: .67rem; font-weight: 850; cursor: pointer; }
.side-column { display: flex; flex-direction: column; gap: 14px; }
.client-panel .status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); }
.client-panel[data-state="ok"] .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(53,208,127,.1); }
.client-panel[data-state="error"] .status-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(255,56,86,.1); }
.client-panel strong { display: block; font-size: 1rem; }
.client-panel > p, .recommendation-panel > p { color: var(--muted); font-size: .75rem; line-height: 1.65; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 8px; border: 1px solid var(--line); background: #151d2a; }
.recommendation-panel { flex: 1; }
.recommendation-panel > p { color: #c7d1df; }
.admin-note { margin-top: 18px; padding: 12px; border-radius: 10px; background: #0b0f16; color: #728096; font-size: .68rem; line-height: 1.5; }
.history-panel { margin-top: 14px; }
#availability { color: var(--muted); font-size: .72rem; }
.history-track { height: 52px; display: flex; align-items: stretch; gap: 2px; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #090d13; }
.history-bar { min-width: 3px; flex: 1; border-radius: 2px; background: #243044; }
.history-bar[data-state="healthy"] { background: var(--green); }
.history-bar[data-state="warning"] { background: var(--yellow); }
.history-bar[data-state="critical"] { background: var(--red); }
.history-axis { display: flex; justify-content: space-between; margin-top: 7px; color: #5f6b7c; font-size: .6rem; }
.event-list { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.event-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 12px 13px; border-radius: 10px; background: #0b1018; }
.event-item i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.event-item[data-level="critical"] i, .event-item[data-level="error"] i { background: var(--red); }
.event-item[data-level="warning"] i { background: var(--yellow); }
.event-item[data-level="ok"] i, .event-item[data-level="healthy"] i { background: var(--green); }
.event-item p { margin: 0; font-size: .7rem; line-height: 1.45; }
.event-item time { color: #66758a; font-size: .62rem; white-space: nowrap; }
.empty-state { margin: 0; color: var(--muted); font-size: .72rem; }
.skeleton-line { height: 74px; margin-bottom: 8px; border-radius: 11px; background: linear-gradient(90deg, #121925 25%, #1b2433 45%, #121925 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
footer { width: min(1240px, calc(100% - 40px)); margin: 0 auto 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.07); display: flex; justify-content: space-between; color: #596679; font-size: .65rem; }
dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel); box-shadow: 0 30px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: 26px; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); font-size: .76rem; line-height: 1.6; }
.dialog-close { position: absolute; right: 16px; top: 14px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.dialog-card label { display: block; margin: 20px 0 7px; color: #9dabc0; font-size: .7rem; font-weight: 800; }
.dialog-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--text); background: #090d14; }
.dialog-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,140,255,.14); }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: #ff8194 !important; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(380px, calc(100% - 44px)); padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; background: #151d2a; box-shadow: 0 18px 60px rgba(0,0,0,.45); color: var(--text); font-size: .75rem; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .side-column { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .site-header { height: 64px; padding: 0 15px; }
  .brand small, .public-pill { display: none; }
  .shell { width: min(100% - 24px, 1240px); margin-top: 16px; }
  .status-hero { min-height: 200px; padding: 24px 20px; align-items: flex-start; gap: 16px; }
  .hero-signal { flex-basis: 56px; width: 56px; height: 56px; margin-top: 8px; }
  .hero-signal span:nth-child(2) { width: 42px; height: 42px; }
  .hero-signal span:nth-child(3) { width: 58px; height: 58px; }
  .hero-meta { position: absolute; right: 16px; top: 14px; }
  .hero-meta > span { display: none; }
  .hero-copy h1 { margin-top: 3px; }
  .kpi-card { padding: 15px; min-height: 104px; }
  .kpi-card strong { font-size: 1.2rem; }
  .panel { padding: 19px; }
  .side-column { grid-template-columns: 1fr; }
  .legend { display: none; }
  .stage { padding-left: 45px; }
  .stage-head { align-items: flex-start; }
  .stage-action { padding: 6px 8px; }
  .event-list { grid-template-columns: 1fr; }
  footer { width: calc(100% - 28px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
