/* ---------- Design tokens: soft neumorphic light gray (reference style) ---------- */
:root {
  --bg: #cfd3d8;
  --panel: #e8eaed;
  --panel-2: #eef0f3;
  --card: #f4f5f7;
  --ink: #1f2226;
  --ink-2: #3b4047;
  --muted: #7a8089;
  --muted-2: #a2a8b0;
  --line: rgba(20, 24, 30, 0.07);
  --rail: #26282c;
  --rail-ink: #d6d9de;
  --danger: #d14540;
  --ok: #2f8f55;
  --info: #3b6ad1;
  --tag-bg: #e1e4e9;
  --shadow-out: 10px 10px 24px rgba(30, 34, 40, 0.12), -8px -8px 20px rgba(255, 255, 255, 0.8);
  --shadow-out-sm: 6px 6px 14px rgba(30, 34, 40, 0.10), -5px -5px 12px rgba(255, 255, 255, 0.8);
  --shadow-in: inset 5px 5px 12px rgba(30, 34, 40, 0.09), inset -5px -5px 12px rgba(255, 255, 255, 0.85);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --font: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 15% 0%, #e3e6ea 0%, var(--bg) 55%, #c4c8ce 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
a { color: inherit; }
.ms {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ---------- Layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 72px 300px minmax(0, 1fr);
  gap: 18px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px;
  min-height: 100vh;
}

/* ---------- Rail ---------- */
.rail {
  background: var(--rail);
  color: var(--rail-ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-out);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
}
.rail-logo {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #3a3d43, #202226);
  box-shadow: 4px 4px 10px rgba(0,0,0,.35), -2px -2px 6px rgba(255,255,255,.06);
  margin-bottom: 22px;
}
.rail-logo .ms { font-size: 22px; color: #fff; }
.rail-nav { display: flex; flex-direction: column; gap: 10px; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; color: var(--rail-ink);
  transition: background .2s, color .2s, box-shadow .2s;
  text-decoration: none;
}
.rail-btn:hover { background: rgba(255,255,255,.07); }
.rail-btn.active {
  background: #3a3d43; color: #fff;
  box-shadow: inset 3px 3px 8px rgba(0,0,0,.45), inset -2px -2px 6px rgba(255,255,255,.06);
}
.rail-bottom { margin-top: auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-out);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow-y: auto;
}
.date-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-out-sm);
  padding: 16px 18px;
}
.date-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.date-label .ms { font-size: 16px; }
.date-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.date-day { font-size: 54px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
.date-meta { display: flex; flex-direction: column; gap: 2px; }
.date-ym { font-size: 16px; font-weight: 600; }
.date-dow { font-size: 13px; color: var(--muted); }
.clock {
  margin-top: 12px; padding: 8px 12px; border-radius: 10px;
  box-shadow: var(--shadow-in); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 15px; color: var(--ink-2);
}

.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-title { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.nav-item .ms { font-size: 19px; color: var(--muted); }
.nav-item .nav-text { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.45); }
.nav-item.active { background: var(--card); box-shadow: var(--shadow-in); color: var(--ink); }
.nav-item.active .ms { color: var(--ink); }
.nav-sub { padding-left: 36px; font-size: 13px; position: relative; }
.nav-sub .ms { font-size: 17px; }
.nav-sub::before { content: ""; position: absolute; left: 21px; top: -2px; bottom: -2px; width: 1px; background: rgba(20, 24, 30, 0.12); }
.count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--panel-2); box-shadow: var(--shadow-in);
  font-size: 12px; font-weight: 600; color: var(--muted);
  display: grid; place-items: center;
}
.count-danger { color: var(--danger); }
.sync-box { margin-top: auto; padding: 12px 12px 4px; font-size: 12px; color: var(--ink-2); }
.sync-line { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sync-line .ms { font-size: 16px; color: var(--muted); }
.sync-line strong { margin-left: auto; font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Main ---------- */
.main {
  background: var(--panel-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-out);
  padding: 26px 28px 32px;
  min-width: 0;
}
.main-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 20px; }
.main-head > div:first-child { flex: 1; min-width: 0; }
.main-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.main-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Legend: a boxed panel on the right, one line per notation */
.legend {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
  padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-in);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.legend-item { display: flex; align-items: center; gap: 10px; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; min-width: 150px; }
.legend-item .dday { height: 18px; padding: 0 7px; font-size: 11px; }
.legend-item .pill { height: 18px; font-size: 10.5px; }
.legend-sym { font-weight: 600; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm);
  padding: 16px 18px;
}
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 40px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.1; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-danger .kpi-value { color: var(--danger); }

/* Recent updates strip */
.recent-strip { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  padding: 9px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-out-sm);
}
.recent-item .recent-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-item .recent-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.recent-more { align-self: flex-end; font-size: 12px; color: var(--info); background: none; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px; }
.search, .select {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-in); color: var(--muted); font-size: 13px;
}
.search { flex: 1; min-width: 240px; }
.search .ms, .select .ms { font-size: 18px; }
.search input, .select select { border: 0; background: transparent; outline: none; width: 100%; color: var(--ink); font-size: 13px; }
.select select { cursor: pointer; padding-right: 4px; }
.toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-out-sm); cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--ink-2);
}
.toggle input { margin: 0; width: 14px; height: 14px; accent-color: var(--ink); }

/* Result line: what the list is currently showing */
.result-line { display: flex; align-items: center; gap: 10px; padding: 2px 18px 10px; font-size: 13px; color: var(--ink-2); }
.result-line strong { font-weight: 600; color: var(--ink); }
.result-line .muted { color: var(--muted); }
.link-btn { font-size: 12px; color: var(--info); padding: 0; background: none; }
.link-btn:hover { text-decoration: underline; }

/* Model list */
.list-head, .model-row { display: grid; grid-template-columns: 1.5fr 1.7fr 1.7fr 0.7fr; gap: 16px; }
.list-head { padding: 2px 18px 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.list-head .ms { font-size: 15px; margin-right: 4px; }
.model-list { display: flex; flex-direction: column; gap: 10px; }
.model-row {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm);
  padding: 14px 18px; cursor: pointer; align-items: start;
  transition: transform .12s, box-shadow .12s;
}
.model-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-out); }
.model-row.shut_down { opacity: .6; }
.col-model { min-width: 0; }
.model-name { font-weight: 600; font-size: 15px; line-height: 20px; }
.model-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Small neutral tags (family, preview, platform) */
.tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px;
  font-size: 11px; font-weight: 500; white-space: nowrap; background: var(--tag-bg); color: var(--ink-2);
}
.tag-preview { background: #e3eafb; color: var(--info); }
.tag-ai_studio { background: #e7e4fa; color: #5b43b8; }
.tag-google_cloud { background: #e3eafb; color: var(--info); }
.tag-anthropic_api { background: #f6e7dc; color: #b5562a; }
.tag-amazon_bedrock { background: #fdf0d5; color: #9a6a00; }

/* Vendor sections: each vendor has its own column header (its two platforms) */
.vendor-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.vendor-head { display: flex; align-items: center; gap: 10px; padding: 6px 18px 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.vendor-head .count { margin-left: 2px; }

/* Platform cell: four fixed rows (id, status, end date, replacement) with a label column so values line up in every cell */
.plat { display: grid; grid-template-rows: 18px 22px 24px 18px; row-gap: 6px; min-width: 0; }
.plat > div { min-width: 0; }
.plat-id { font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-missing { color: var(--muted-2); font-family: var(--font); font-size: 13px; }
.kv { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; column-gap: 8px; }
.k { font-size: 11px; color: var(--muted); white-space: nowrap; }
.v { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-date { font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.v-muted { color: var(--muted-2); }
.v-mono { font-family: var(--mono); font-size: 11.5px; }

/* Status pills: green = available, blue = preview, red = deprecation scheduled, dark gray = shut down */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill-stable { background: #dff3e6; color: var(--ok); }
.pill-preview { background: #e3eafb; color: var(--info); }
.pill-deprecated { background: #fbe3e1; color: var(--danger); }
.pill-shut_down { background: #dfe2e6; color: var(--ink); }
.pill-unknown, .pill-experimental, .pill-latest { background: var(--tag-bg); color: var(--ink-2); }

/* D-day: red chip = days left until a confirmed end date, dark chip = days since shutdown; everything else is plain text */
.dday {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums;
  background: var(--danger); color: #fff;
}
.dday.past { background: var(--ink-2); color: #fff; }
.dday-text { font-size: 12px; color: var(--muted); }

.col-release { font-size: 13px; line-height: 18px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col-release small { display: block; color: var(--muted); font-size: 11px; }

.model-detail { grid-column: 1 / -1; display: none; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.model-row.expanded .model-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-box { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.detail-box h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.detail-box a { color: var(--info); text-decoration: none; }
.detail-box a:hover { text-decoration: underline; }
.detail-box dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.detail-box dt { color: var(--muted); }
.detail-box dd { margin: 0; }

.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ---------- Updates view ---------- */
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 6px 0 16px; color: var(--muted); font-size: 13px; }
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm); padding: 14px 18px;
  display: grid; grid-template-columns: 110px 1fr; gap: 14px;
}
.event-date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.event-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.event-name { font-weight: 600; font-size: 14px; }
.event-summary { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.event-meta { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.event-meta a { color: var(--info); text-decoration: none; }

/* ---------- Status view ---------- */
.status-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.status-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm); padding: 16px 18px; font-size: 13px; }
.status-card h3 { margin: 0 0 10px; font-size: 14px; }
.status-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.status-card dt { color: var(--muted); }
.status-card dd { margin: 0; word-break: break-all; }
.status-card ul { margin: 0; padding-left: 18px; line-height: 1.7; }
.status-card a { color: var(--info); text-decoration: none; }
.status-ok { color: var(--ok); font-weight: 600; }
.status-err { color: var(--danger); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 64px 1fr; }
  .sidebar { grid-column: 2; position: static; height: auto; }
  .main { grid-column: 2; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .rail { flex-direction: row; height: auto; position: static; padding: 10px 14px; }
  .rail-logo { margin: 0 10px 0 0; }
  .rail-nav { flex-direction: row; }
  .rail-bottom { margin-left: auto; }
  .sidebar, .main { grid-column: 1; }
  .list-head { display: none; }
  .model-row { grid-template-columns: 1fr; }
  .model-row.expanded .model-detail, .status-panel { grid-template-columns: 1fr; }
  .event { grid-template-columns: 1fr; }
  .main-head { flex-direction: column; align-items: flex-start; }
  .main-head p { white-space: normal; }
  .legend { white-space: normal; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
