:root {
  --paper: #f3f1eb;
  --paper-deep: #e8e5dc;
  --ink: #17201c;
  --muted: #6c746e;
  --line: #d6d3ca;
  --lime: #c9f45c;
  --green: #1d5d47;
  --green-dark: #102f26;
  --coral: #ff7557;
  --white: #fffefa;
  --shadow: 0 18px 60px rgba(27, 38, 32, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; }
a { color: inherit; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:where(button, a, select, input, textarea):focus-visible { outline: 3px solid color-mix(in srgb, var(--lime) 72%, white); outline-offset: 3px; }
.shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 999; left: 16px; top: -60px; padding: 12px 18px; background: var(--ink); color: white; border-radius: 10px; }
.skip-link:focus { top: 16px; }

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: rgba(243, 241, 235, .88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23, 32, 28, .08);
}
.brand { display: inline-flex; width: max-content; align-items: center; gap: 11px; text-decoration: none; font-family: Manrope, sans-serif; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { position: relative; width: 29px; height: 25px; display: flex; align-items: flex-end; gap: 3px; }
.brand-mark i { display: block; width: 7px; background: var(--ink); border-radius: 8px; transform: skew(-9deg); }
.brand-mark i:nth-child(1) { height: 13px; }
.brand-mark i:nth-child(2) { height: 23px; background: var(--green); }
.brand-mark i:nth-child(3) { height: 18px; background: var(--lime); }
.topnav { display: flex; gap: 7px; padding: 5px; background: rgba(255,255,255,.52); border: 1px solid rgba(23,32,28,.08); border-radius: 999px; }
.topnav a { padding: 8px 15px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.topnav a:hover, .topnav a.active { color: var(--ink); background: var(--white); box-shadow: 0 3px 12px rgba(23,32,28,.07); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.live-badge { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #eba147; box-shadow: 0 0 0 4px rgba(235,161,71,.14); }
.live-badge.online .pulse-dot { background: #47aa78; box-shadow: 0 0 0 4px rgba(71,170,120,.14); animation: breathe 2s infinite; }
.live-badge.offline .pulse-dot { background: #9ca29e; box-shadow: none; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(71,170,120,0); } }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; font-size: 19px; transition: .2s ease; }
.icon-button:hover { transform: rotate(25deg); background: var(--white); }
.icon-button.loading { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { padding-top: 86px; }
.eyebrow, .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--green); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 27px; }
.eyebrow span { width: 24px; height: 2px; background: var(--green); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 70px; align-items: end; }
h1, h2, h3 { font-family: Manrope, sans-serif; margin: 0; }
h1 { max-width: 790px; font-size: clamp(48px, 6.3vw, 86px); line-height: .96; letter-spacing: -.065em; font-weight: 700; }
h1 em { color: var(--green); font-style: normal; }
.hero-copy { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.brief-card { min-height: 265px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; border-radius: var(--radius); color: var(--white); background: var(--green-dark); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.brief-card::after { content: ""; position: absolute; right: -65px; top: -85px; width: 220px; height: 220px; border: 44px solid rgba(201,244,92,.1); border-radius: 50%; }
.brief-topline { position: relative; z-index: 1; display: flex; justify-content: space-between; color: #aebdb6; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.brief-lead { position: relative; z-index: 1; max-width: 390px; margin: 22px 0; font-family: Manrope, sans-serif; font-size: 22px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; }
.brief-meta { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.13); }
.brief-meta small { display: block; color: #9dada6; margin-bottom: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.brief-meta strong { font-size: 14px; }

.control-strip { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); background: rgba(255,255,255,.36); border-radius: 16px; }
.control-strip label { position: relative; padding: 15px 19px; border-right: 1px solid var(--line); }
.control-strip label:last-child { border-right: 0; }
.control-strip label span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.control-strip select { width: 100%; appearance: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 8px) 52%,calc(100% - 3px) 52%; background-size: 5px 5px,5px 5px; background-repeat:no-repeat; }
.control-strip label:focus-within { background: rgba(255,255,255,.65); }

.section { padding: 112px 0 0; scroll-margin-top: 70px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 34px; }
.kicker { margin: 0 0 10px; }
h2 { font-size: clamp(32px, 4vw, 49px); line-height: 1.06; letter-spacing: -.045em; }
.section-note { max-width: 470px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.platform-card { position: relative; min-height: 234px; padding: 23px; text-align: left; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: rgba(255,255,255,.42); cursor: pointer; overflow: hidden; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.platform-card:hover { transform: translateY(-4px); background: var(--white); }
.platform-card.selected { border-color: var(--platform-color); background: var(--white); box-shadow: 0 12px 32px rgba(23,32,28,.07); }
.platform-card::after { content: ""; position: absolute; right: -43px; top: -43px; width: 125px; height: 125px; border-radius: 50%; background: color-mix(in srgb, var(--platform-color) 13%, transparent); }
.platform-card-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.platform-name { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.platform-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--platform-color); font-family: Manrope, sans-serif; font-weight: 800; }
.platform-arrow { color: var(--muted); font-size: 18px; }
.audience-number { display: block; margin-top: 24px; font: 700 42px/1 Manrope, sans-serif; letter-spacing: -.055em; }
.audience-metric { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.platform-card-bottom { position: absolute; left: 23px; right: 23px; bottom: 19px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.platform-card-bottom small { max-width: 190px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.best-window { padding: 5px 8px; border-radius: 7px; color: var(--ink); background: color-mix(in srgb, var(--platform-color) 18%, white); font-size: 10px; font-weight: 800; white-space: nowrap; }
.metric-caveat { display: flex; gap: 13px; align-items: center; margin-top: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); }
.metric-caveat > span { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; color: var(--green); background: rgba(29,93,71,.1); border-radius: 50%; font-family: Georgia, serif; font-weight: bold; }
.metric-caveat p { margin: 0; font-size: 12px; line-height: 1.5; }
.metric-caveat strong { color: var(--ink); }

.planner-heading { margin-bottom: 27px; }
.selected-platform { display: inline-flex; align-items: center; gap: 6px; padding: 10px 15px; border-radius: 10px; color: white; background: var(--green); font-size: 12px; font-weight: 800; transition: background-color .2s ease; }
.selected-platform i { font-size: .95em; }
.planner-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 15px; }
.panel { padding: 26px; border: 1px solid var(--line); background: rgba(255,255,255,.48); border-radius: var(--radius); }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.panel-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.panel h3, .dark-panel h3 { font-size: 19px; letter-spacing: -.025em; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.legend span { width: 21px; height: 3px; border-radius: 9px; background: var(--green); }
.chart-wrap { height: 270px; margin: 23px -4px 0; }
.day-night-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.period-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 13px; background: #efede6; }
.period-card.night { color: #e9eee9; background: var(--green-dark); }
.period-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.6); font-size: 18px; }
.night .period-icon { background: rgba(255,255,255,.1); }
.period-card small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 9px; }
.night small { color: #99aaa3; }
.period-card strong { font: 700 21px Manrope, sans-serif; }
.period-tag { margin-left: auto; padding: 4px 7px; border-radius: 6px; background: rgba(255,255,255,.62); color: var(--green); font-size: 9px; font-weight: 800; }
.night .period-tag { background: rgba(255,255,255,.09); color: var(--lime); }
.model-note { margin: 13px 1px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.confidence { padding: 5px 8px; border: 1px solid rgba(29,93,71,.22); border-radius: 7px; color: var(--green); font-size: 9px; font-weight: 800; white-space: nowrap; }
.recommendation-panel { --recommendation-color: var(--green); position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--white); box-shadow: 0 12px 34px rgba(23,32,28,.055); }
.recommendation-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--recommendation-color); }
.recommendation-panel > * { position: relative; z-index: 1; }
.next-window { margin-top: 39px; padding: 25px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.next-window span, .next-window small { display: block; color: var(--muted); }
.next-window span { font-size: 13px; font-weight: 700; }
.next-window strong { display: block; margin: 3px 0; font: 700 clamp(36px, 4.2vw, 53px)/1 Manrope, sans-serif; letter-spacing: -.055em; }
.next-window small { font-size: 10px; }
.recommendation-copy { min-height: 58px; margin: 20px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.content-prompt { padding: 14px; border-radius: 12px; background: #e9e6dc; }
.content-prompt span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.content-prompt strong { font-size: 12px; line-height: 1.4; }
.primary-button { margin-top: auto; min-height: 47px; display: flex; justify-content: space-between; align-items: center; padding: 0 17px; border: 0; border-radius: 12px; color: white; background: var(--green); box-shadow: 0 8px 20px rgba(29,93,71,.16); font-weight: 800; cursor: pointer; transition: .2s ease; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-2px); }
.heatmap-panel { margin-top: 15px; }
.heat-legend { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.heat-legend i { width: 13px; height: 13px; border-radius: 3px; background: rgba(29,93,71,.1); }
.heat-legend i:nth-of-type(2) { background: rgba(29,93,71,.28); }
.heat-legend i:nth-of-type(3) { background: rgba(29,93,71,.48); }
.heat-legend i:nth-of-type(4) { background: rgba(29,93,71,.7); }
.heat-legend i:nth-of-type(5) { background: var(--green); }
.heatmap { min-width: 850px; display: grid; grid-template-columns: 42px repeat(24, 1fr); gap: 4px; margin-top: 25px; }
.heatmap-scroll { overflow-x: auto; padding-bottom: 3px; }
.heat-label { display: grid; place-items: center start; min-height: 18px; color: var(--muted); font-size: 9px; font-weight: 700; }
.heat-hour { place-items: end center; }
.heat-cell { min-height: 22px; border-radius: 4px; background: var(--green); transition: transform .16s ease; }
.heat-cell:hover { transform: scale(1.18); outline: 2px solid var(--paper); z-index: 1; }

.fit-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 15px; }
.fit-bars { display: grid; gap: 17px; }
.fit-row { display: grid; grid-template-columns: 115px 1fr 47px; align-items: center; gap: 15px; }
.fit-platform { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
.fit-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--fit-color); }
.fit-track { position: relative; height: 9px; border-radius: 99px; background: #dfdcd3; overflow: hidden; }
.fit-fill { height: 100%; border-radius: inherit; background: var(--fit-color); transform-origin: left; animation: grow .55s ease both; }
@keyframes grow { from { transform: scaleX(0); } }
.fit-score { font: 700 13px Manrope, sans-serif; text-align: right; }
.insight-panel { min-height: 300px; display: flex; flex-direction: column; color: white; background: var(--green); border-color: var(--green); }
.insight-panel .panel-label { color: #b9d1c6; }
.insight-quote { margin: 26px 0; font: 600 clamp(21px, 2.5vw, 30px)/1.4 Manrope, sans-serif; letter-spacing: -.035em; }
.insight-footer { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); }
.insight-footer small { display: block; color: #b9d1c6; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.insight-footer strong { display: block; margin-top: 4px; }

.live-section { margin-top: 112px; padding: 92px 0; color: white; background: var(--green-dark); }
.section-heading.light .kicker { color: var(--lime); }
.section-heading.light .section-note { color: #a5b3ad; }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.dark-panel { min-height: 400px; padding: 27px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); background: rgba(255,255,255,.035); }
.dark-panel .panel-label { color: #95a8a0; }
.source-chip { padding: 5px 8px; border-radius: 6px; color: var(--lime); background: rgba(201,244,92,.1); font-size: 9px; font-weight: 800; }
.trends-list { list-style: none; padding: 0; margin: 25px 0 0; counter-reset: trends; }
.trend-item { counter-increment: trends; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid rgba(255,255,255,.09); }
.trend-item::before { content: counter(trends, decimal-leading-zero); color: #81938b; font: 600 10px Manrope, sans-serif; }
.trend-item a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; font-size: 13px; font-weight: 600; }
.trend-item a:hover { color: var(--lime); }
.trend-volume { color: #9eb0a8; font-size: 10px; }
.attention-list { margin-top: 25px; display: grid; gap: 9px; }
.attention-row { display: grid; grid-template-columns: 110px 1fr 70px 60px; align-items: center; gap: 12px; min-height: 39px; }
.attention-name { font-size: 11px; font-weight: 700; }
.attention-track { height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.attention-fill { height: 100%; border-radius: inherit; background: var(--lime); }
.attention-value { color: #d7e0dc; font-size: 10px; text-align: right; }
.change { padding: 4px 6px; border-radius: 6px; font-size: 9px; font-weight: 800; text-align: center; }
.change.up { color: var(--lime); background: rgba(201,244,92,.08); }
.change.down { color: #ff9c87; background: rgba(255,117,87,.09); }
.dark-note { margin: 19px 0 0; color: #84968e; font-size: 10px; line-height: 1.5; }
.skeleton-row { height: 42px; margin-bottom: 7px; border-radius: 8px; background: linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.09),rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.method-card { padding: 22px; border-top: 1px solid var(--ink); background: rgba(255,255,255,.28); }
.method-card > span { color: var(--green); font: 700 10px Manrope, sans-serif; }
.method-card h3 { margin: 27px 0 9px; font-size: 16px; }
.method-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.source-list { margin-top: 38px; border-top: 1px solid var(--line); }
.source-row { display: grid; grid-template-columns: 1.1fr 1.7fr 110px 24px; gap: 20px; align-items: center; min-height: 62px; border-bottom: 1px solid var(--line); text-decoration: none; }
.source-row:hover .source-title { color: var(--green); }
.source-title { font-size: 12px; font-weight: 800; }
.source-detail { color: var(--muted); font-size: 11px; }
.source-date { color: var(--muted); font-size: 10px; text-align: right; }
.source-arrow { font-size: 17px; }

footer { margin-top: 110px; padding: 34px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: 11px; }
.footer-inner div { display: flex; gap: 13px; align-items: center; }
.footer-inner strong { color: var(--ink); font: 800 14px Manrope, sans-serif; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 10px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 35px; }
  .brief-card { min-height: 235px; }
  .control-strip { grid-template-columns: 1fr 1fr; }
  .control-strip label:nth-child(2) { border-right: 0; }
  .control-strip label:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .planner-grid, .fit-layout { grid-template-columns: 1fr; }
  .recommendation-panel { min-height: 475px; }
  .method-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1240px); }
  .topbar { height: 62px; padding: 0 14px; }
  .live-badge { display: none; }
  .hero { padding-top: 55px; }
  h1 { font-size: clamp(44px, 14vw, 62px); }
  .hero-copy { font-size: 15px; }
  .brief-card { padding: 22px; }
  .control-strip { grid-template-columns: 1fr; margin-top: 42px; }
  .control-strip label { border-right: 0; border-bottom: 1px solid var(--line); }
  .control-strip label:last-child { border-bottom: 0; }
  .section { padding-top: 82px; }
  .section-heading { display: block; }
  .section-note { margin-top: 15px; }
  .platform-grid { grid-template-columns: 1fr; }
  .platform-card { min-height: 212px; }
  .planner-heading .selected-platform { display: inline-block; margin-top: 18px; }
  .panel, .dark-panel { padding: 20px; border-radius: 17px; }
  .chart-wrap { height: 230px; }
  .day-night-grid { grid-template-columns: 1fr; }
  .heat-legend { display: none; }
  .fit-row { grid-template-columns: 95px 1fr 40px; gap: 10px; }
  .live-section { margin-top: 82px; padding: 72px 0; }
  .live-grid { grid-template-columns: 1fr; }
  .attention-row { grid-template-columns: 84px 1fr 58px; }
  .attention-row .change { display: none; }
  .method-grid { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: 1fr 24px; padding: 13px 0; gap: 10px; }
  .source-detail, .source-date { grid-column: 1; text-align: left; }
  .source-arrow { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .footer-inner, .footer-inner div { display: block; }
  .footer-inner span { display: block; margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Compact command-center view */
.cockpit-head {
  padding-top: 12px;
  display: grid;
  grid-template-columns: minmax(300px, .86fr) minmax(540px, 1.14fr);
  gap: 10px 14px;
  align-items: stretch;
}
.dashboard-title {
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.34);
}
.dashboard-title .eyebrow { margin: 0 0 5px; font-size: 9px; }
.dashboard-title h1 { max-width: none; font-size: clamp(23px, 2.2vw, 32px); line-height: 1.02; letter-spacing: -.045em; }
.cockpit-summary { max-width: 650px; margin: 5px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.automation-nav-link { display: inline-flex; align-items: center; gap: 6px; }
.automation-nav-link span { padding: 2px 5px; border-radius: 99px; color: var(--green-dark); background: var(--lime); font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.automation-shortcut { display: none; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--green-dark); background: rgba(255,255,255,.52); text-decoration: none; font-size: 9px; font-weight: 800; }
.quick-brief { display: flex; gap: 14px; margin-top: 9px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.quick-brief strong { margin-left: 3px; color: var(--ink); }

.manila-clock {
  --signal-color: #7d8882;
  min-height: 98px;
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--signal-color) 55%, var(--line));
  border-radius: 16px;
  color: white;
  background: var(--green-dark);
  box-shadow: inset 4px 0 0 var(--signal-color);
  transition: border-color .35s ease, box-shadow .35s ease;
}
.manila-clock.signal-warming { --signal-color: #e8ac4d; }
.manila-clock.signal-strong { --signal-color: var(--lime); }
.manila-clock.signal-peak { --signal-color: var(--coral); animation: signalGlow 1.8s ease-in-out infinite; }
@keyframes signalGlow { 50% { box-shadow: inset 4px 0 0 var(--signal-color), 0 0 0 4px color-mix(in srgb, var(--signal-color) 13%, transparent); } }
.clock-face { padding-right: 14px; border-right: 1px solid rgba(255,255,255,.12); }
.clock-label { display: flex; align-items: center; gap: 6px; color: #a9bab2; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.clock-label strong { margin-left: auto; padding: 3px 6px; color: var(--signal-color); border-radius: 99px; background: color-mix(in srgb, var(--signal-color) 12%, transparent); }
.clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal-color) 15%, transparent); }
.clock-time-row { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; }
#manilaClock { color: var(--signal-color); font: 700 32px/.95 Manrope, sans-serif; letter-spacing: -.055em; font-variant-numeric: tabular-nums; transition: color .35s ease; }
#manilaPeriod { color: #a8b8b1; font: 700 10px Manrope, sans-serif; }
#manilaDate { margin: 6px 0 0; color: #8fa199; font-size: 8px; }
.clock-opportunity { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.clock-opportunity-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #91a39b; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.alert-button { padding: 4px 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 99px; color: white; background: rgba(255,255,255,.07); font-size: 8px; font-weight: 800; cursor: pointer; }
.alert-button:hover, .alert-button.enabled { color: var(--green-dark); background: var(--lime); border-color: var(--lime); }
#clockPlatform { margin-top: 3px; font: 700 17px/1.1 Manrope, sans-serif; letter-spacing: -.025em; }
#clockMessage { margin: 2px 0 5px; color: #a8b8b1; font-size: 9px; }
.clock-platforms { display: flex; flex-wrap: wrap; gap: 3px; }
.clock-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 5px; border: 1px solid rgba(255,255,255,.09); border-radius: 5px; color: #9eb0a8; font-size: 7px; }
.clock-chip i { width: 5px; height: 5px; border-radius: 50%; }
.clock-chip b { color: #dbe4df; font-variant-numeric: tabular-nums; }
.clock-chip.peak { color: #ffd0c5; border-color: rgba(255,117,87,.34); }
.clock-chip.strong { color: var(--lime); border-color: rgba(201,244,92,.26); }

.cockpit-head .control-strip {
  grid-column: 1 / -1;
  min-height: 48px;
  margin-top: 0;
  border-radius: 12px;
}
.cockpit-head .control-strip label { display: flex; flex-direction: column; justify-content: center; padding: 8px 15px; }
.cockpit-head .control-strip label span { margin-bottom: 1px; font-size: 8px; }
.cockpit-head .control-strip select { font-size: 11px; }

.platform-section { padding-top: 10px; }
.compact-heading { min-height: 25px; margin-bottom: 7px; align-items: center; }
.compact-heading .kicker { margin: 0 0 2px; font-size: 8px; }
.compact-heading h2 { font-size: 17px; letter-spacing: -.03em; }
.compact-heading .section-note { max-width: 520px; font-size: 9px; line-height: 1.35; }
.platform-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.platform-card { min-height: 111px; padding: 10px; border-radius: 12px; }
.platform-card:hover { transform: translateY(-2px); }
.platform-card::after { right: -25px; top: -29px; width: 70px; height: 70px; }
.platform-name { gap: 6px; font-size: 10px; }
.platform-icon { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.platform-icon i { font-size: 11px; }
.platform-arrow { font-size: 11px; }
.audience-number { margin-top: 9px; font-size: 25px; }
.audience-metric { margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 8px; }
.platform-card-bottom { left: 10px; right: 10px; bottom: 8px; align-items: center; }
.platform-card-bottom small { display: none; }
.best-window { margin-left: auto; padding: 3px 5px; font-size: 7px; }
.metric-caveat { display: none; }

.planner-section { padding-top: 10px; }
.planner-heading { margin-bottom: 7px; }
.planner-heading .selected-platform { padding: 5px 8px; border-radius: 7px; font-size: 8px; }
.planner-grid { grid-template-columns: minmax(0, 1.75fr) minmax(260px, .62fr); gap: 8px; }
.planner-grid .panel { height: 258px; padding: 14px 16px; border-radius: 14px; }
.planner-grid .recommendation-panel { min-height: 0; }
.panel-heading { gap: 10px; }
.planner-grid .panel-label, .heatmap-panel .panel-label { margin-bottom: 2px; font-size: 7px; }
.planner-grid .panel h3, .heatmap-panel h3 { font-size: 13px; }
.legend { font-size: 7px; }
.chart-wrap { height: 126px; margin: 6px -2px 0; }
.day-night-grid { gap: 6px; margin-top: 5px; }
.period-card { gap: 7px; padding: 5px 7px; border-radius: 8px; }
.period-icon { width: 25px; height: 25px; font-size: 12px; }
.period-card small { margin-bottom: 0; font-size: 7px; }
.period-card strong { font-size: 14px; }
.period-tag { padding: 2px 4px; font-size: 6px; }
.model-note { display: none; }
.confidence { padding: 3px 5px; font-size: 6px; }
.next-window { margin-top: 10px; padding: 8px 0; }
.next-window span { font-size: 9px; }
.next-window strong { margin: 1px 0; font-size: 30px; }
.next-window small { font-size: 7px; }
.recommendation-copy { min-height: 34px; margin: 8px 0 7px; font-size: 9px; line-height: 1.4; }
.content-prompt { padding: 8px 9px; border-radius: 8px; }
.content-prompt span { margin-bottom: 2px; font-size: 6px; }
.content-prompt strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 8px; line-height: 1.35; }
.primary-button { min-height: 31px; margin-top: 6px; padding: 0 10px; border-radius: 8px; font-size: 9px; }
.heatmap-panel { margin-top: 8px; padding: 10px 13px; border-radius: 14px; }
.heat-legend { font-size: 7px; }
.heat-legend i { width: 9px; height: 9px; }
.heatmap { min-width: 760px; gap: 3px; margin-top: 6px; }
.heat-label { min-height: 10px; font-size: 7px; }
.heat-cell { min-height: 10px; border-radius: 3px; }

@media (min-width: 701px) {
  .topbar { height: 52px; padding: 0 22px; }
  .topnav a { padding: 6px 11px; font-size: 10px; }
  .live-badge { padding: 6px 9px; font-size: 9px; }
  .icon-button { width: 31px; height: 31px; }
}

@media (min-width: 701px) and (max-width: 1099px) {
  .cockpit-head { grid-template-columns: .82fr 1.18fr; }
  .manila-clock { grid-template-columns: 180px 1fr; }
  #manilaClock { font-size: 27px; }
  .platform-grid { grid-template-columns: repeat(4, 1fr); }
  .platform-card { min-height: 95px; }
  .audience-number { margin-top: 5px; font-size: 22px; }
  .platform-card-bottom { bottom: 6px; }
}

@media (max-width: 980px) {
  .automation-shortcut { display: inline-flex; }
}

@media (max-width: 700px) {
  .cockpit-head { display: block; padding-top: 12px; }
  .dashboard-title { min-height: auto; }
  .dashboard-title h1 { font-size: 25px; }
  .cockpit-summary { white-space: normal; }
  .quick-brief { flex-wrap: wrap; }
  .manila-clock { grid-template-columns: 1fr; margin-top: 9px; }
  .clock-face { padding-right: 0; padding-bottom: 10px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .cockpit-head .control-strip { margin-top: 9px; grid-template-columns: 1fr 1fr; }
  .cockpit-head .control-strip label { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .platform-section, .planner-section { padding-top: 28px; }
  .compact-heading { display: block; }
  .compact-heading .section-note { margin-top: 7px; }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .platform-card { min-height: 112px; }
  .planner-grid { grid-template-columns: 1fr; }
  .planner-grid .panel { height: auto; min-height: 310px; }
  .chart-wrap { height: 170px; }
  .recommendation-panel { min-height: 330px !important; }
  .heatmap-panel { margin-top: 8px; }
}

/* Interactive daily content planner */
.day-planner-section { padding-top: 96px; scroll-margin-top: 62px; }
.planner-live-pill { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(29,93,71,.2); border-radius: 999px; color: var(--green); background: rgba(255,255,255,.4); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.planner-live-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(29,93,71,.1); animation: breathe 2s infinite; }
.day-planner-controls { display: grid; grid-template-columns: 1fr 1.1fr 1.25fr 1.45fr 1fr; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.42); overflow: hidden; }
.day-planner-controls label { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 12px 15px; border-right: 1px solid var(--line); }
.day-planner-controls label:last-child { border-right: 0; }
.day-planner-controls label > span { margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.day-planner-controls input[type="date"], .day-planner-controls input[type="text"], .day-planner-controls select { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 700; }
.day-planner-controls input[type="text"]::placeholder { color: #a1a7a2; font-weight: 500; }
.post-count-control output { margin-left: 4px; color: var(--green); font: 800 11px Manrope, sans-serif; }
.post-count-control input[type="range"] { width: 100%; accent-color: var(--green); cursor: pointer; }
.day-planner-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .72fr); gap: 12px; margin-top: 12px; }
.planner-graph-panel, .schedule-panel { min-height: 430px; }
.planner-graph-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.planner-graph-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--coral); }
.planner-chart-wrap { height: 235px; margin-top: 15px; }
.weekday-strength { height: 105px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; align-items: end; margin-top: 15px; padding: 7px 8px 0; border-top: 1px solid var(--line); }
.weekday-column { position: relative; height: 88px; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; align-items: end; padding: 3px 4px 0; border-radius: 7px; }
.weekday-column i { width: min(34px, 55%); min-height: 12px; display: block; border-radius: 5px 5px 2px 2px; background: #afc7bd; transition: height .35s ease; }
.weekday-column.selected { background: rgba(29,93,71,.06); }
.weekday-column.selected i { background: var(--green); }
.weekday-column strong { margin-top: 4px; font-size: 8px; }
.weekday-column small { color: var(--muted); font-size: 7px; }
.weekday-score { position: absolute; top: 0; color: var(--muted); font-size: 7px; font-weight: 800; }
.schedule-panel { display: flex; flex-direction: column; }
.copy-plan-button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: transparent; font-size: 8px; font-weight: 800; cursor: pointer; }
.copy-plan-button:hover { color: white; background: var(--green); border-color: var(--green); }
.scheduled-posts { display: grid; gap: 7px; margin-top: 19px; }
.scheduled-post { --post-color: var(--green); display: grid; grid-template-columns: 25px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.45); }
.post-order { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.post-order span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--post-color); font-size: 7px; font-weight: 800; }
.post-order i { width: 1px; flex: 1; min-height: 15px; background: var(--line); }
.scheduled-post:last-child .post-order i { opacity: 0; }
.post-details { min-width: 0; }
.post-details small { display: block; color: var(--muted); font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.post-details strong { display: block; margin: 2px 0; font: 800 22px/1 Manrope, sans-serif; letter-spacing: -.04em; }
.post-details p { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 8px; }
.post-score { color: var(--post-color); font: 800 18px Manrope, sans-serif; }
.post-score small { font-size: 7px; }
.schedule-note { margin: auto 0 0; padding-top: 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 8px; line-height: 1.45; }
.platform-window-compare { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 8px; }
.platform-window { --window-color: var(--green); min-width: 0; display: grid; grid-template-columns: 25px 1fr auto; gap: 7px; align-items: center; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.38); text-align: left; cursor: pointer; }
.platform-window:hover, .platform-window.selected { border-color: var(--window-color); background: var(--white); }
.platform-window-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--window-color); font-size: 11px; }
.platform-window span:nth-child(2) { min-width: 0; }
.platform-window small, .platform-window strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.platform-window small { color: var(--muted); font-size: 7px; }
.platform-window strong { margin-top: 1px; font-size: 10px; }
.platform-window > b { color: var(--window-color); font-size: 10px; }

@media (max-width: 980px) {
  .day-planner-controls { grid-template-columns: 1fr 1fr; }
  .day-planner-controls label { border-bottom: 1px solid var(--line); }
  .day-planner-controls label:nth-child(even) { border-right: 0; }
  .day-planner-controls label:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .day-planner-grid { grid-template-columns: 1fr; }
  .planner-graph-panel, .schedule-panel { min-height: auto; }
  .schedule-panel { min-height: 390px; }
  .platform-window-compare { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 700px) {
  .day-planner-section { padding-top: 72px; }
  .day-planner-section .section-heading { display: block; }
  .planner-live-pill { width: max-content; margin-top: 12px; }
  .day-planner-controls { grid-template-columns: 1fr; }
  .day-planner-controls label, .day-planner-controls label:nth-child(even) { border-right: 0; }
  .day-planner-controls label:last-child { grid-column: auto; }
  .planner-chart-wrap { height: 190px; }
  .platform-window-compare { grid-template-columns: 1fr 1fr; }
  .platform-window:last-child { grid-column: 1 / -1; }
}

/* Mobile usability and narrow-screen containment */
@media (max-width: 420px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .shell { width: calc(100% - 24px); }

  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
  .brand { min-width: 0; gap: 8px; font-size: 15px; }
  .brand-mark { flex: 0 0 auto; transform: scale(.9); transform-origin: left center; }
  .topbar-actions { gap: 7px; }
  .automation-shortcut { min-height: 36px; padding: 7px 9px; }

  .cockpit-head { padding-top: 10px; }
  .dashboard-title { padding: 14px; }
  .dashboard-title h1 { font-size: clamp(23px, 7.4vw, 28px); }
  .cockpit-summary { font-size: 11px; line-height: 1.45; }
  .quick-brief { gap: 7px 12px; font-size: 8px; line-height: 1.4; }

  .manila-clock { padding: 14px; }
  #manilaClock { font-size: clamp(29px, 9vw, 35px); }
  .clock-opportunity-top { align-items: flex-start; }
  .alert-button { min-height: 32px; padding-inline: 10px; }
  #clockPlatform { font-size: 18px; }
  #clockMessage { font-size: 10px; }
  .clock-chip { padding: 4px 6px; font-size: 7px; }

  .cockpit-head .control-strip label { min-width: 0; min-height: 57px; padding: 9px 12px; }
  .cockpit-head .control-strip label span { font-size: 8px; }
  .cockpit-head .control-strip select { min-width: 0; padding-right: 22px; font-size: 11px; background-position: calc(100% - 11px) 52%, calc(100% - 6px) 52%; }

  .platform-section, .planner-section { padding-top: 32px; }
  .compact-heading h2 { font-size: 19px; }
  .compact-heading .section-note { font-size: 10px; }
  .platform-grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(236px, 82vw);
    gap: 9px;
    padding: 2px 1px 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }
  .platform-card {
    width: 100%;
    min-width: 0;
    min-height: 142px;
    padding: 13px;
    scroll-snap-align: start;
  }
  .platform-name { font-size: 11px; }
  .platform-icon { width: 27px; height: 27px; font-size: 11px; }
  .audience-number { margin-top: 14px; font-size: 31px; }
  .audience-metric { max-width: calc(100% - 6px); white-space: normal; font-size: 9px; line-height: 1.25; }
  .platform-card-bottom { left: 13px; right: 13px; bottom: 10px; }
  .best-window { padding: 4px 7px; font-size: 8px; }

  .planner-grid, .planner-grid > *, .day-planner-grid, .day-planner-grid > *, .fit-layout, .fit-layout > * { min-width: 0; }
  .panel, .planner-grid .panel, .dark-panel { min-width: 0; padding: 17px; }
  .planner-grid .panel { min-height: 0; }
  .planner-grid .activity-panel { min-height: 365px; }
  .planner-grid .recommendation-panel { min-height: 350px !important; }
  .panel-heading { flex-wrap: wrap; gap: 8px 12px; }
  .planner-grid .panel-label, .heatmap-panel .panel-label { font-size: 8px; }
  .planner-grid .panel h3, .heatmap-panel h3 { font-size: 15px; }
  .legend { font-size: 8px; }
  .chart-wrap, .planner-chart-wrap { width: 100%; max-width: 100%; overflow: hidden; }
  .chart-wrap canvas, .planner-chart-wrap canvas { max-width: 100% !important; }
  .chart-wrap { height: 185px; }
  .model-note { display: block; font-size: 9px; }
  .period-card { min-width: 0; padding: 9px; }
  .period-card strong { font-size: 17px; }
  .next-window strong { font-size: 38px; }
  .recommendation-copy { font-size: 11px; }
  .content-prompt strong { font-size: 10px; }
  .primary-button { min-height: 44px; font-size: 11px; }
  .heatmap-panel { padding: 15px; }
  .heatmap-scroll { width: 100%; max-width: 100%; overscroll-behavior-inline: contain; }

  .day-planner-section { padding-top: 66px; }
  .planner-live-pill { max-width: 100%; width: fit-content; font-size: 8px; }
  .day-planner-controls label { min-height: 62px; padding: 12px 13px; }
  .day-planner-controls label > span { font-size: 9px; }
  .day-planner-controls input[type="date"], .day-planner-controls input[type="text"], .day-planner-controls select { min-height: 30px; font-size: 13px; }
  .planner-chart-wrap { height: 195px; }
  .weekday-strength { gap: 3px; padding-inline: 2px; }
  .weekday-column { padding-inline: 1px; }
  .scheduled-post { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 8px; }
  .post-details strong { font-size: 20px; }
  .platform-window-compare { grid-template-columns: 1fr; }
  .platform-window, .platform-window:last-child { grid-column: auto; min-height: 50px; }

  .fit-row { grid-template-columns: 82px minmax(0, 1fr) 38px; gap: 8px; }
  .fit-platform { min-width: 0; font-size: 10px; }
  .insight-quote { font-size: 21px; }
  .live-section { margin-top: 72px; padding: 64px 0; }
  .dark-panel { min-height: auto; }
  .dark-panel .panel-heading { display: block; }
  .source-chip { display: inline-block; margin-top: 9px; }
  .trend-item { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; }
  .trend-volume { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .attention-row { grid-template-columns: 72px minmax(0, 1fr) 58px; gap: 8px; }
  .source-row { min-width: 0; }
  .source-title, .source-detail { overflow-wrap: anywhere; }
  footer { margin-top: 72px; }
  .footer-inner { text-align: center; }
  .footer-inner p { line-height: 1.5; }
}

@media (max-width: 340px) {
  .automation-shortcut span { display: none; }
  .automation-shortcut { width: 36px; justify-content: center; padding-inline: 0; }
  .cockpit-head .control-strip { grid-template-columns: 1fr; }
  .cockpit-head .control-strip label { border-right: 0; }
  .cockpit-head .control-strip label:last-child { border-bottom: 0; }
  .platform-grid { grid-auto-columns: minmax(224px, 86vw); }
}
