:root {
  --brand-slate: #1f2c35;
  --brand-slate-strong: #17232b;
  --brand-gold: #bd8d32;
  --bg-primary: #f5f1e8;
  --bg-surface: #fffcf6;
  --bg-tertiary: #ece4d6;
  --text-primary: #1f2c35;
  --text-secondary: #526069;
  --text-tertiary: #74818a;
  --text-muted: #968d7e;
  --border-color: #d8cfbf;
  --border-light: #f0e6e0;
  --accent: #bd8d32;
  --accent-text: #8f6821;
  --accent-on: #fffcf6;
  --highlight: #F0B67F;
  --highlight-soft: rgba(240,182,127,.12);
  --blush: #efd0ca;
  --shadow-sm: 0 1px 2px rgba(36,22,35,.06);
  --shadow-md: 0 8px 24px rgba(36,22,35,.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition: .2s ease;
  --stage-dev: #94A4B8;
  --stage-preview: #8B6BB8;
  --stage-rollout: #F0B67F;
  --stage-ga: #5BA66A;
  --stage-retiring: #D4614C;
}
[data-theme="dark"] {
  --bg-primary: #162029;
  --bg-surface: #1f2c35;
  --bg-tertiary: #293640;
  --text-primary: #f6f1e7;
  --text-secondary: #d4c7ad;
  --text-tertiary: #a99777;
  --text-muted: #7d6f5c;
  --border-color: #33424c;
  --border-light: #33424c;
  --highlight-soft: rgba(240,182,127,.08);
}

*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg-primary);color:var(--text-primary);
  transition:background var(--transition),color var(--transition);
  line-height:1.5;min-height:100vh
}
button,input,select{font:inherit}a{color:var(--accent-text);text-decoration:none}a:hover{text-decoration:underline}

.shell{width:min(100% - 28px,1240px);margin:0 auto;padding:20px 0 48px}

/* ===== Header ===== */
.site-header{
  background:linear-gradient(135deg,var(--brand-slate-strong),var(--brand-slate));
  color:#fff;padding:1rem 1.5rem .65rem
}
.header-content{
  max-width:1240px;margin:0 auto;display:flex;align-items:center;
  justify-content:space-between;gap:.8rem;flex-wrap:wrap
}
.logo{display:flex;align-items:center;gap:.6rem}
.brand-logo{width:100px;height:auto;flex-shrink:0}
.logo h1{font-size:1.2rem;font-weight:700;letter-spacing:-.3px;line-height:1.2}
.logo .subtitle{font-size:.72rem;opacity:.82;font-weight:400}
.header-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.last-updated{
  display:inline-flex;align-items:center;gap:.35rem;height:28px;
  padding:0 .7rem;border:1px solid rgba(255,255,255,.25);
  border-radius:999px;background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.82);font-size:.7rem;font-weight:700;white-space:nowrap
}
.last-updated::before{
  content:"";width:7px;height:7px;border-radius:999px;background:var(--stage-ga)
}
.last-updated.stale{color:#D4614C;border-color:#D4614C}
.last-updated.stale::before{background:#D4614C}
.theme-toggle{
  width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,.25);border-radius:50%;
  background:rgba(255,255,255,.08);cursor:pointer;font-size:.95rem;color:#fff
}
.theme-toggle:hover{background:rgba(255,255,255,.2)}
.about-toggle,.primary-button{
  border:1px solid rgba(255,255,255,.25);border-radius:999px;
  background:rgba(255,255,255,.08);color:#fff;cursor:pointer;
  font-weight:700;padding:.3rem .75rem;font-size:.75rem;
  transition:background var(--transition),border-color var(--transition)
}
.about-toggle:hover,.primary-button:hover{background:rgba(255,255,255,.2)}
.primary-button{background:var(--accent);border-color:var(--accent);color:var(--accent-on)}
.primary-button:hover{background:var(--accent-text)}

/* ===== Hero panel ===== */
.panel{
  background:var(--bg-surface);border:1px solid var(--border-color);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)
}
.hero{margin-bottom:18px}
.hero-main{padding:28px 32px}
.hero h1{
  margin:0 0 12px;font-size:clamp(28px,5vw,48px);
  line-height:1.05;letter-spacing:-.04em
}
.hero-copy{
  max-width:700px;margin:0;color:var(--text-secondary);font-size:16px
}
.hero-sources{
  display:flex;align-items:flex-start;gap:18px;margin:24px 0 0;flex-wrap:wrap
}
.hero-source{
  appearance:none;background:none;border:0;padding:0;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:8px;
  color:var(--text-secondary);transition:transform .12s ease
}
.hero-source:hover{transform:translateY(-2px)}
.hero-source.is-off .hero-source-logo{
  border-color:var(--border-color);opacity:.45
}
.hero-source-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:52px;height:52px;border-radius:14px;
  background:var(--highlight-soft);border:1.5px solid var(--accent)
}
.hero-source-logo img{width:30px;height:30px}
.hero-source-name{font-size:12px;font-weight:700;text-align:center}
.hero-source.is-planned{cursor:default;opacity:.6}
.hero-source.is-planned:hover{transform:none}

.hero-about{
  margin-top:24px;padding-top:20px;border-top:1px solid var(--border-color);
  color:var(--text-secondary);font-size:13px;line-height:1.6
}
.hero-about p{margin:0 0 6px}
.hero-about p:last-child{margin-bottom:0}

/* ===== Announcement summary ===== */
.announcement-summary{
  background:linear-gradient(135deg,rgba(189,141,50,.12) 0%,rgba(31,44,53,.06) 100%);
  border:1px solid var(--accent);border-radius:var(--radius-lg);
  padding:1.25rem 1.5rem;margin-bottom:18px
}
.announcement-summary h2{
  font-size:1rem;font-weight:600;color:var(--accent);
  margin-bottom:.5rem;display:flex;align-items:center;gap:.4rem
}
.announcement-summary.is-unavailable{
  border-color:var(--border-color);
  background:linear-gradient(135deg,var(--bg-primary) 0%,var(--bg-surface) 100%)
}
.announcement-summary p{
  font-size:.88rem;color:var(--text-secondary);line-height:1.6;margin-bottom:.4rem
}
.announcement-summary p:last-child{margin-bottom:0}
.announcement-summary-note{opacity:.7;font-size:.78rem;color:var(--text-tertiary)}
.is-hidden{display:none!important}

/* ===== Filters panel ===== */
.filters-panel{margin-bottom:18px}
.refine-panel{padding:20px 24px;display:flex;flex-direction:column;gap:14px}
.refine-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.refine-head h3{margin:0;font-size:15px}
.hero-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.result-summary{color:var(--text-tertiary);font-size:12px;font-weight:700}
.refine-group{display:flex;flex-direction:column;gap:6px}
.refine-label{
  color:var(--text-muted);font-size:10px;font-weight:800;
  letter-spacing:.1em;text-transform:uppercase
}
.refine-chip-row{display:flex;flex-wrap:wrap;gap:6px}
.refine-panel select,.refine-panel input[type="search"]{
  width:100%;border:1px solid var(--border-color);border-radius:12px;
  background:var(--bg-primary);color:var(--text-primary);
  outline:none;padding:9px 12px;font-weight:600
}
.refine-panel select:focus,.refine-panel input:focus{border-color:var(--accent)}
.filter-chip{
  padding:6px 11px;font-size:12px;font-weight:700;
  border:1px solid var(--border-color);border-radius:999px;
  background:var(--bg-surface);color:var(--text-secondary);
  cursor:pointer;transition:all var(--transition)
}
.filter-chip:hover{background:var(--bg-tertiary)}
.filter-chip.active{background:var(--accent);border-color:var(--accent);color:var(--accent-on)}
.filter-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}

/* ===== Retirement panel ===== */
.retirement-panel{margin-bottom:18px}
.daily-panel{padding:24px;display:flex;flex-direction:column;gap:20px}
.sync-card{
  border:1px solid var(--border-color);border-radius:18px;
  background:var(--bg-primary);padding:18px
}
.sync-label{
  color:var(--text-muted);font-size:11px;font-weight:800;
  letter-spacing:.1em;text-transform:uppercase
}
.sync-time{
  margin:8px 0 4px;color:var(--text-primary);
  font-size:24px;font-weight:800;letter-spacing:-.04em
}
.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.metric{
  border:1px solid var(--border-color);border-radius:16px;
  padding:14px;background:var(--bg-surface)
}
.metric strong{display:block;color:var(--text-primary);font-size:22px;line-height:1}
.metric span{color:var(--text-secondary);font-size:12px;font-weight:700}

/* ===== Retirement mini-calendar ===== */
.retirement-mini-body{margin-top:4px}
.retirement-mini-controls{
  display:flex;align-items:center;gap:.35rem;margin-bottom:.5rem;flex-wrap:wrap
}
.retirement-mini-nav-btn{
  border:1px solid var(--border-color);border-radius:var(--radius-sm);
  background:var(--bg-primary);cursor:pointer;padding:.2rem .45rem;
  font-size:.74rem;color:var(--text-secondary)
}
.retirement-mini-nav-btn:disabled{opacity:.3;cursor:default}
.retirement-mini-today-btn{margin-left:auto}
.retirement-mini-controls select{
  border:1px solid var(--border-color);border-radius:var(--radius-sm);
  background:var(--bg-primary);color:var(--text-primary);
  padding:.18rem .3rem;font-size:.74rem;cursor:pointer
}
.retirement-mini-weekdays{
  display:grid;grid-template-columns:repeat(7,1fr);
  text-align:center;font-size:.65rem;font-weight:800;
  color:var(--text-tertiary);margin-bottom:.2rem
}
.retirement-mini-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px}
.retirement-mini-day{
  text-align:center;padding:.3rem 0;font-size:.74rem;font-weight:600;
  color:var(--text-secondary);border-radius:var(--radius-sm);position:relative;cursor:default;min-height:1.8rem
}
.retirement-mini-day.is-empty{visibility:hidden}
.retirement-mini-day.is-today{background:var(--bg-tertiary);font-weight:800}
.retirement-mini-day.is-selected{background:var(--accent);color:#fff}
.retirement-mini-day.has-events{cursor:pointer}
.retirement-mini-day.has-events:hover{background:var(--bg-tertiary)}
.retirement-mini-day-num{display:block}
.retirement-mini-dot{
  position:absolute;bottom:1px;left:50%;transform:translateX(-50%);
  width:12px;height:12px;border-radius:999px;background:var(--accent);
  color:#fff;font-size:.5rem;font-weight:800;display:flex;align-items:center;justify-content:center
}
.retirement-mini-list{margin-top:.6rem}
.retirement-mini-list h3{font-size:.76rem;margin-bottom:.3rem}
.retirement-mini-list ul{list-style:none;padding:0}
.retirement-mini-list li{
  padding:.3rem 0;border-bottom:1px solid var(--border-color);
  font-size:.76rem;color:var(--text-secondary)
}
.retirement-mini-list li:last-child{border-bottom:0}
.retirement-mini-list a{font-weight:600}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ===== Cards grid ===== */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(340px,1fr));
  gap:16px
}

.update-card{
  display:flex;flex-direction:column;padding:18px;
  background:var(--bg-surface);border:1px solid var(--border-color);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);
  cursor:pointer;transition:transform var(--transition),border-color var(--transition),box-shadow var(--transition)
}
.update-card:hover{
  border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow-md)
}
.card-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-top-left{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.source-badge{
  display:inline-flex;align-items:center;gap:5px;
  border-radius:999px;font-size:11px;font-weight:800;
  padding:5px 10px;background:var(--highlight-soft);color:var(--text-secondary)
}
.status-badge{
  display:inline-flex;align-items:center;gap:6px;
  border-radius:999px;font-size:11px;font-weight:800;
  padding:4px 10px;color:var(--text-secondary)
}
.status-badge::before{
  content:"";width:8px;height:8px;border-radius:999px
}
.status-badge.stage-in-development::before{background:var(--stage-dev)}
.status-badge.stage-in-preview::before{background:var(--stage-preview)}
.status-badge.stage-rolling-out::before{background:var(--stage-rollout)}
.status-badge.stage-ga::before{background:var(--stage-ga)}
.status-badge.stage-retiring::before{background:var(--stage-retiring)}
.freshness-pill{
  display:inline-flex;align-items:center;gap:4px;
  border-radius:999px;font-size:10px;font-weight:800;padding:3px 8px;white-space:nowrap
}
.freshness-pill.new{
  background:rgba(139,107,184,.14);color:rgba(139,107,184,.8);border:1px solid rgba(139,107,184,.28)
}
.freshness-pill.updated{
  background:rgba(240,182,127,.16);color:var(--accent-text);border:1px solid rgba(240,182,127,.32)
}

.update-card h3{
  margin:0 0 10px;font-size:1.05rem;letter-spacing:-.02em;line-height:1.2;font-weight:700
}
.update-card .description{
  margin:0 0 14px;color:var(--text-secondary);font-size:.85rem;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;line-clamp:5;overflow:hidden
}
.platform-row{display:flex;flex-wrap:wrap;gap:5px;margin:-4px 0 12px}
.platform-chip{
  display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;
  border:1px solid var(--border-color);background:var(--bg-primary);
  color:var(--text-secondary);font-size:11px;font-weight:700
}
.bookmark-btn{
  background:none;border:0;cursor:pointer;font-size:1rem;color:var(--text-tertiary);
  padding:0;line-height:1;transition:color var(--transition);flex-shrink:0
}
.bookmark-btn.bookmarked{color:var(--accent)}
.bookmark-btn:hover{color:var(--accent)}

.meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:auto}
.meta-item{
  border:1px solid var(--border-color);border-radius:14px;
  padding:10px;font-size:.85rem;font-weight:700
}
.meta-item span{display:block;color:var(--text-muted);font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px}

.cards-empty{
  grid-column:1/-1;border:1px dashed var(--border-color);
  border-radius:18px;padding:28px;text-align:center;
  color:var(--text-secondary);background:var(--bg-primary)
}
.cards-empty h3{font-size:1rem;margin-bottom:.4rem}

/* ===== Load more ===== */
.load-more-wrap{text-align:center;padding:20px 0}
.load-more-btn{
  border:1px solid var(--border-color);border-radius:999px;
  background:var(--bg-surface);color:var(--text-primary);
  cursor:pointer;font-weight:700;padding:.5rem 1.2rem;
  transition:background var(--transition)
}
.load-more-btn:hover{background:var(--bg-tertiary)}
.load-more-meta{display:block;margin-top:8px;color:var(--text-tertiary);font-size:.74rem}

/* ===== Footer ===== */
.site-footer{
  text-align:center;padding:1.5rem;color:var(--text-tertiary);
  font-size:.78rem;border-top:1px solid var(--border-color)
}

/* ===== Toast ===== */
.toast{
  position:fixed;bottom:max(.9rem,env(safe-area-inset-bottom));
  left:50%;transform:translateX(-50%) translateY(120px);
  background:var(--text-primary);color:var(--bg-primary);
  padding:.7rem 1.4rem;border-radius:var(--radius-md);
  font-size:.88rem;z-index:1000;
  transition:transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow:var(--shadow-md);white-space:nowrap
}
.toast.visible{transform:translateX(-50%) translateY(0)}

/* ===== Drawer ===== */
.drawer-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:900}
.drawer-overlay.open{display:block}
.drawer{
  position:fixed;top:0;right:-460px;width:460px;max-width:100vw;
  height:100vh;background:var(--bg-surface);
  border-left:1px solid var(--border-color);
  z-index:1000;overflow-y:auto;padding:1.4rem;
  transition:right .2s ease
}
.drawer.open{right:0}
.drawer-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.8rem}
.drawer-close{border:0;background:none;font-size:1.6rem;cursor:pointer;color:var(--text-primary)}
.drawer h2{margin:0 0 .8rem;font-size:1.2rem;line-height:1.3}
#drawerDescription{color:var(--text-secondary);font-size:.85rem;line-height:1.5}
.drawer-meta{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:.8rem 0}
.drawer-meta-item{
  border:1px solid var(--border-color);border-radius:var(--radius-sm);
  padding:.5rem;font-size:.8rem;font-weight:700
}
.drawer-meta-item span{
  display:block;color:var(--text-tertiary);font-size:.65rem;
  font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:1px
}
.drawer-history{border-top:1px solid var(--border-color);padding-top:.8rem;margin-top:.8rem}
.drawer-history h3{margin:0 0 .5rem;font-size:.88rem}
.history-event{padding:.4rem 0;border-bottom:1px solid var(--border-color);font-size:.78rem}
.history-ts{color:var(--text-tertiary);font-size:.7rem}
.history-change{margin:.15rem 0;color:var(--text-secondary)}
.history-change strong{color:var(--text-primary)}

/* ===== Responsive ===== */
@media (max-width:900px){
  .filter-row{grid-template-columns:1fr}
  .daily-panel{padding:16px}
  .metrics{grid-template-columns:repeat(3,1fr);gap:8px}
  .hero-main{padding:20px}
}
@media (max-width:768px){
  .shell{width:min(100% - 16px,1240px);padding:14px 0 32px}
  .header-content{flex-direction:column;align-items:stretch;gap:.5rem}
  .header-actions{justify-content:flex-start}
  .logo h1{font-size:1.05rem}
  .brand-logo{width:76px}
  .hero-main{padding:16px}
  .hero-sources{gap:12px}
  .hero-source-logo{width:42px;height:42px}
  .hero-source-logo img{width:24px;height:24px}
  .hero-source-name{font-size:10px}
  .refine-panel{padding:14px}
  .cards{grid-template-columns:1fr}
  .update-card{padding:14px}
  .meta-grid{grid-template-columns:1fr}
  .cards-empty{padding:20px}
  .drawer{width:100vw;right:-100vw}
  .drawer-meta{grid-template-columns:1fr}
}
@media (min-width:769px) and (max-width:1024px){
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
