/* ---------- Design tokens: soft neumorphic light gray (models.gsnhub.com 와 같은 디자인 시스템) ---------- */
: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 Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
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; }

/* 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); }
.empty { text-align: center; padding: 40px; color: var(--muted); }
/* ---------- 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; }

/* ======================================================================
   GCP Release Hub — 피드 전용 스타일
   ====================================================================== */
.rail-logo .ms { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.legend-grid { display: grid; grid-template-columns: auto auto; gap: 6px 14px; }
.legend-item .pill { height: 18px; font-size: 10.5px; }

/* 변경 유형 pill — 색은 상태 pill 팔레트를 재사용 */
.pill-ga              { background: #dff3e6; color: var(--ok); }
.pill-public_preview  { background: #e3eafb; color: var(--info); }
.pill-private_preview { background: #fdf0d5; color: #9a6a00; }
.pill-improvement     { background: var(--tag-bg); color: var(--ink-2); }
.pill-breaking_change { background: #fbe3e1; color: var(--danger); }
.pill-bug_fix         { background: #ece6fa; color: #5b43b8; }

.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-cat-ai       { background: #e7e4fa; color: #5b43b8; }
.tag-cat-compute  { background: #e3eafb; color: var(--info); }
.tag-cat-storage  { background: #fdf0d5; color: #9a6a00; }
.tag-cat-security { background: #f6e7dc; color: #b5562a; }

.kpi-value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-ok .kpi-value { color: var(--ok); }

/* 최근 중요 변경 스트립 */
.recent-item { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.recent-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-out); }
.recent-item .recent-svc { font-weight: 600; color: var(--ink); white-space: nowrap; }
.recent-title { font-weight: 600; color: var(--ink); margin-right: 4px; }

/* 기간 세그먼트 */
.segment {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 4px; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-in);
}
.segment button { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; color: var(--muted); font-weight: 500; }
.segment button.active { background: var(--panel-2); color: var(--ink); box-shadow: var(--shadow-out-sm); font-weight: 600; }

/* 날짜 그룹 */
.feed { display: flex; flex-direction: column; gap: 22px; }
.day { display: flex; flex-direction: column; gap: 10px; }
.day-head { display: flex; align-items: baseline; gap: 10px; padding: 0 18px; }
.day-date { font-size: 17px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.day-dow { font-size: 13px; color: var(--muted); }
.day-rel { font-size: 12px; color: var(--muted); }
.day-head .count { align-self: center; }
.day-today .day-rel { color: var(--ink); font-weight: 600; }

/* 피드 항목 */
.entry {
  display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 18px; align-items: start;
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm);
  padding: 15px 18px; position: relative; overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.entry::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent, transparent); }
.entry:hover { transform: translateY(-1px); box-shadow: var(--shadow-out); }
.entry.t-breaking_change { --accent: var(--danger); }
.entry.t-ga { --accent: var(--ok); }
.entry.t-public_preview, .entry.t-private_preview { --accent: var(--info); }
.entry-svc { min-width: 0; }
.entry-svc-name { font-weight: 600; font-size: 14px; line-height: 20px; cursor: pointer; }
.entry-svc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.entry-svc .model-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.entry-body { min-width: 0; }
.entry-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.entry-title { font-weight: 600; font-size: 15px; line-height: 21px; color: var(--ink); }
.entry-desc { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); margin-top: 5px; }
.entry-links { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.lnk {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  background: var(--panel-2); box-shadow: var(--shadow-out-sm); transition: box-shadow .15s, color .15s;
}
.lnk:hover { box-shadow: var(--shadow-in); color: var(--ink); }
.lnk .ms { font-size: 15px; }
mark { background: #fbe9a6; color: inherit; border-radius: 3px; padding: 0 1px; }

/* 서비스 뷰 */
.svc-cat { margin-bottom: 24px; }
.svc-cat-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; font-size: 14px; font-weight: 600; }
.svc-cat-head .ms { font-size: 19px; color: var(--muted); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.svc-card {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-out-sm);
  padding: 15px 17px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s, box-shadow .12s;
}
.svc-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-out); }
.svc-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.svc-card-name { font-weight: 600; font-size: 14px; }
.svc-card-last { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-card-latest { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; min-height: 37px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spark { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 22px; align-items: end; padding: 4px 6px; border-radius: 8px; box-shadow: var(--shadow-in); }
.spark i { display: block; border-radius: 2px; background: var(--muted-2); min-height: 2px; }
.spark i.z { background: rgba(20,24,30,.07); }
.spark i.b { background: var(--danger); }
.svc-card-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.svc-card.quiet { opacity: .72; }

/* 상태 뷰 */
.runs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.runs-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.runs-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; vertical-align: top; }
.status-card.wide { grid-column: 1 / -1; }

/* 페이지 로드 연출 */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kpi, .recent-item, .day { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.kpi:nth-child(2) { animation-delay: .05s; } .kpi:nth-child(3) { animation-delay: .1s; } .kpi:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { .kpi, .recent-item, .day { animation: none; } }

.skeleton { height: 92px; border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-out-sm); opacity: .6; }

@media (max-width: 1180px) { .entry { grid-template-columns: 190px minmax(0, 1fr); } .entry-links { grid-column: 2; flex-direction: row; } }
@media (max-width: 820px) {
  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry-links { grid-column: 1; }
  .legend-grid { grid-template-columns: auto auto; }
  .segment { width: 100%; } .segment button { flex: 1; }
  .main { padding: 20px 16px 26px; }
}

.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.section-head p { margin: 6px 0 18px; color: var(--muted); font-size: 13px; }
.svc-card-last { white-space: nowrap; flex-shrink: 0; }
.svc-card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runs-table th, .runs-table td:first-child, .runs-table td:nth-child(2), .runs-table td:last-child { white-space: nowrap; }

/* ---------- Responsive (레이아웃 셸) ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { grid-column: 2; position: static; height: auto; }
  .main { grid-column: 2; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 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; flex-direction: row; }
  .sidebar, .main { grid-column: 1; }
  .sidebar { gap: 10px; padding: 14px; }
  .date-card, .sync-box, .nav-sub { display: none; }
  .nav-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
  #service-nav { display: contents; }
  .search { min-width: 0; flex-basis: 100%; }
  .nav-title { grid-column: 1 / -1; }
  .nav-item { padding: 8px 10px; font-size: 13px; }
  .main-head p { white-space: normal; }
  .legend { white-space: normal; width: 100%; }
  .legend-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 32px; }
  .recent-item { flex-wrap: wrap; }
  .recent-item .recent-text { flex-basis: 100%; }
  .status-panel { grid-template-columns: 1fr; }
  .status-card ul { columns: 1 !important; }
}
