*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
:root {
  --navy: #172136;
  --navy-2: #26364f;
  --cream: #f5efe4;
  --cream-2: #ebe1d0;
  --panel: #fffaf2;
  --panel-2: #f8efe2;
  --ink: #192235;
  --muted: #747783;
  --line: #dfd1bd;
  --gold: #c5a04b;
  --green: #2f8f67;
  --red: #b75a54;
  --blue: #3d6f9f;
  --shadow: 0 1px 2px rgba(22, 32, 51, 0.04), 0 24px 70px rgba(22, 32, 51, 0.12);
  --font-serif: "Playfair Display", ui-serif, Georgia, serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,250,242,0.85), rgba(245,239,228,0.96) 34%, rgba(245,239,228,1)),
    var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 58px;
}
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, #121b2d 0%, var(--navy) 46%, #10192a 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}
.brand {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 10px;
  background: linear-gradient(180deg, #fff8e8, #ead8ad);
  color: var(--navy);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 10px 24px rgba(0,0,0,0.18);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(197,160,75,0.5);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff8e8;
  place-items: center;
}
.menu-lines,
.menu-lines::before,
.menu-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.menu-lines {
  position: relative;
}
.menu-lines::before,
.menu-lines::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-lines::before { top: -6px; }
.menu-lines::after { top: 6px; }
.sidebar.menu-open .menu-lines {
  background: transparent;
}
.sidebar.menu-open .menu-lines::before {
  transform: translateY(6px) rotate(45deg);
}
.sidebar.menu-open .menu-lines::after {
  transform: translateY(-6px) rotate(-45deg);
}
.nav-stack, .sidebar-foot {
  display: grid;
  gap: 8px;
}
.nav-stack { margin-top: 10px; }
.sidebar-foot { margin-top: auto; }
.nav-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: rgba(255,255,255,0.72);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  position: relative;
}
.nav-button:hover, .nav-button.active {
  color: white;
  background: rgba(255,255,255,0.115);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.nav-button.active::before {
  content: "";
  width: 4px;
  height: 24px;
  border-radius: 99px;
  background: var(--gold);
  position: absolute;
  left: -12px;
}
.nav-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 800;
}
[data-icon] svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.workspace {
  min-width: 0;
  padding: 34px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--navy);
}
.summary {
  margin: 9px 0 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 0.98rem;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.search-box, .agent-switch, .refresh-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,250,242,0.82);
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--muted);
}
.refresh-button {
  color: var(--navy);
  font-weight: 800;
}
.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.search-box { min-width: 270px; }
.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.agent-switch span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.agent-switch select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}
.status-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.status-pill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,250,242,0.8);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--green);
}
.dot.warn { background: var(--gold); }
.dot.danger { background: var(--red); }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.module {
  grid-column: span 4;
  min-width: 0;
  background: rgba(255,250,242,0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.module.wide { grid-column: span 8; }
.module.full { grid-column: 1 / -1; }
.module.compact { grid-column: span 6; }
.module.tall { min-height: 470px; }
.module-header {
  min-height: 66px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff8ea, #fbf1df);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.module-header > [data-icon] {
  color: var(--gold);
  opacity: 0.78;
}
.module-header > [data-icon] svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
}
.module-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--navy);
}
.module-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.module-body {
  padding: 18px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.metric-card {
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,250,242,0.86), rgba(248,239,226,0.92));
  display: grid;
  align-content: space-between;
}
.metric-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}
.metric-value {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1;
}
.metric-note {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
}
.list {
  display: grid;
  gap: 11px;
}
.row {
  min-height: 52px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}
.row.clickable {
  border-radius: 6px;
  padding: 6px;
  margin: -6px;
  cursor: pointer;
}
.row.clickable:hover {
  background: rgba(197, 160, 75, 0.09);
}
.row-icon {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  display: grid;
  place-items: center;
}
.row-icon svg {
  width: 15px;
  height: 15px;
}
.row strong {
  display: block;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}
.badge {
  border: 1px solid rgba(223, 209, 189, 0.78);
  border-radius: 999px;
  background: rgba(245, 234, 215, 0.72);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge.green { color: var(--green); background: #e1f1e8; border-color: #c8e4d4; }
.badge.gold { color: #7a6124; background: #efe1bd; border-color: #e2cf9b; }
.badge.red { color: var(--red); background: #f3dfdc; border-color: #e6c7c3; }
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.source-link {
  min-height: 24px;
  border: 1px solid rgba(197,160,75,0.38);
  border-radius: 999px;
  background: rgba(255,250,242,0.72);
  color: #7a6124;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.source-link:hover {
  background: #efe1bd;
  color: #172136;
}
.detail-link {
  justify-self: start;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.stage {
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248,239,226,0.78);
  padding: 10px;
}
.stage-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.item-card {
  padding: 11px;
  border: 1px solid rgba(222,211,194,0.9);
  border-radius: 8px;
  background: rgba(255,250,242,0.95);
  margin-bottom: 9px;
}
.item-card strong { display: block; font-size: 0.9rem; }
.item-card span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 3px; }
.chat-body {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto auto;
  padding: 0;
}
.messages {
  padding: 16px;
  max-height: 390px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}
.message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6ecdc;
  padding: 10px 11px;
  line-height: 1.45;
  font-size: 0.9rem;
}
.message.me {
  margin-left: auto;
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}
.quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
}
.prompt {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4e8d5;
  color: var(--ink);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}
.composer {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  background: linear-gradient(180deg, #fff8ea, #fbf0dd);
}
.composer input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--panel);
  padding: 0 12px;
}
.send-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  display: grid;
  place-items: center;
}
.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  justify-content: flex-end;
  background: rgba(22, 32, 51, 0.26);
}
.detail-drawer.open { display: flex; }
.detail-panel {
  width: min(430px, 100%);
  height: 100%;
  background: linear-gradient(180deg, #fffaf2, #f8efe2);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(22, 32, 51, 0.18);
  padding: 24px;
  overflow: auto;
}
.close-detail {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2e4ce;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
  float: right;
}
.detail-panel h2 {
  clear: both;
  margin: 10px 0 8px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
}
.detail-panel p {
  color: var(--muted);
  line-height: 1.55;
}
.detail-meta {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.detail-meta .badge {
  justify-self: start;
}
@media (max-width: 1180px) {
  .module, .module.wide { grid-column: span 6; }
  .module.full { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    overflow-x: auto;
    align-items: center;
  }
  .nav-stack, .sidebar-foot { display: flex; margin: 0; }
  .brand { width: 44px; flex: 0 0 44px; }
  .nav-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 0;
  }
  .nav-label { display: none; }
  .nav-button.active::before { display: none; }
  .workspace { padding: 18px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { justify-content: stretch; }
  .search-box, .agent-switch { width: 100%; }
  .module, .module.wide, .module.full { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .metric-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 18px minmax(0, 1fr); }
  .row-actions { justify-self: start; grid-column: 2; }
}

/* Premium dashboard pass: common integrations first, project stories second. */
body {
  background:
    radial-gradient(circle at 84% 8%, rgba(197,160,75,0.16), transparent 28%),
    linear-gradient(135deg, #fffaf1 0%, #f1e6d4 48%, #e8dcc8 100%);
}
.app-shell {
  grid-template-columns: 212px minmax(0, 1fr);
}
.sidebar {
  padding: 24px 15px;
  background: linear-gradient(180deg, #101a2c 0%, #17243a 55%, #101828 100%);
  box-shadow: 12px 0 40px rgba(16, 26, 44, 0.12);
}
.brand {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  color: var(--gold);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(197,160,75,0.5);
}
.brand-text { color: #fff8e8; }
.nav-button {
  min-height: 43px;
  border-radius: 12px;
  justify-content: flex-start;
}
.nav-button.active::before { left: -10px; }
.workspace {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 38px 34px 44px;
}
.topbar {
  margin-bottom: 24px;
}
.eyebrow {
  color: #9a7b34;
  font-size: 0.72rem;
}
h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  color: #172136;
}
.summary {
  max-width: 650px;
  color: #666d78;
}
.search-box,
.agent-switch,
.status-pill {
  background: rgba(255,250,242,0.62);
  border-color: rgba(223,209,189,0.72);
  box-shadow: 0 10px 28px rgba(24, 32, 49, 0.04);
}
.dashboard-grid {
  gap: 16px;
}
.module {
  background: rgba(255,250,242,0.74);
  border-color: rgba(223,209,189,0.64);
  box-shadow: 0 14px 38px rgba(24, 32, 49, 0.08);
  backdrop-filter: blur(14px);
}
.module-header {
  min-height: 68px;
  padding: 15px 18px;
  background: rgba(255,250,242,0.45);
}
.module-header > [data-icon] {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #a78337;
  background: #f0dfbd;
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(197,160,75,0.18);
}
.module-header > [data-icon] svg {
  width: 25px;
  height: 25px;
}
.module-title {
  font-size: 1.16rem;
}
.module-subtitle {
  max-width: 440px;
  color: #7a7d86;
}
.module-body {
  padding: 18px 20px 20px;
}
.module.compact .module-header {
  min-height: 54px;
  padding: 12px 14px;
}
.module.compact .module-body {
  padding: 12px 14px 14px;
}
.module.compact .module-header > [data-icon] {
  width: 36px;
  height: 36px;
}
.module.compact .module-header > [data-icon] svg {
  width: 20px;
  height: 20px;
}
.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.metric-card {
  min-height: 90px;
  padding: 12px;
  background: rgba(255,250,242,0.72);
  border-color: rgba(223,209,189,0.58);
  box-shadow: 0 12px 28px rgba(24, 32, 49, 0.05);
}
.metric-label {
  color: #6d717b;
  text-transform: none;
  font-size: 0.76rem;
  font-weight: 700;
}
.metric-value {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  color: #141c2d;
}
.metric-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.metric-note {
  font-size: 0.7rem;
}
.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #163b5e;
  background: #efdfbd;
}
.metric-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.daily-quote {
  width: 100%;
  min-height: 88px;
  border: 1px solid rgba(61,111,159,0.22);
  border-radius: 8px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(246,250,255,0.92), rgba(255,250,242,0.86));
  color: var(--navy);
  text-align: left;
  display: grid;
  gap: 10px;
}
.daily-quote:hover {
  border-color: rgba(61,111,159,0.44);
  box-shadow: 0 14px 34px rgba(24, 32, 49, 0.08);
}
.daily-quote span {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  line-height: 1.3;
}
.daily-quote strong {
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}
.daily-quote-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 22px;
  background: rgba(18, 27, 45, 0.38);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
}
.daily-quote-modal {
  width: min(520px, 100%);
  border: 1px solid rgba(223,209,189,0.8);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffaf2, #f2eadc);
  box-shadow: 0 30px 90px rgba(18, 27, 45, 0.28);
  padding: 28px;
  color: var(--navy);
  position: relative;
}
.daily-quote-modal blockquote {
  margin: 10px 0 18px;
  font-family: var(--font-serif);
  font-size: 1.58rem;
  line-height: 1.28;
}
.daily-quote-modal strong {
  color: var(--blue);
  font-size: 0.78rem;
  text-transform: uppercase;
}
.daily-quote-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 32px;
  border: 1px solid rgba(197,160,75,0.34);
  border-radius: 8px;
  background: rgba(255,250,242,0.82);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
}
.list {
  gap: 0;
}
.row {
  min-height: 58px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid rgba(223,209,189,0.5);
}
.row:last-child {
  border-bottom: 0;
}
.row.clickable {
  border-radius: 10px;
  padding: 8px;
  margin: 0;
}
.row-icon {
  color: #183a5d;
}
.row-icon svg {
  width: 17px;
  height: 17px;
}
.row strong {
  font-size: 0.94rem;
}
.row span {
  color: #737783;
  font-size: 0.79rem;
}
.badge {
  padding: 4px 8px;
  font-size: 0.68rem;
  border-color: transparent;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.project-card {
  min-height: 132px;
  border: 1px solid rgba(223,209,189,0.62);
  border-radius: 12px;
  background: rgba(255,250,242,0.76);
  padding: 15px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--ink);
}
.project-card:hover {
  background: #fffaf2;
  transform: translateY(-1px);
}
.project-card strong {
  font-size: 1rem;
}
.project-card span:not(.project-state) {
  color: #737783;
  font-size: 0.82rem;
  line-height: 1.4;
}
.project-state {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eee1c5;
  color: #7a6124;
  font-size: 0.66rem;
  font-weight: 800;
}
.project-card.green .project-state {
  color: var(--green);
  background: #dff0e6;
}
.project-card.red .project-state {
  color: var(--red);
  background: #f2ddda;
}
.chat-body {
  grid-template-rows: minmax(150px, 1fr) auto auto;
}
.message,
.composer input,
.send-button,
.prompt,
.close-detail {
  border-radius: 12px;
}
@media (max-width: 1180px) {
  .metric-grid,
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module.compact { grid-column: span 6; }
}
@media (max-width: 820px) {
  body { padding-bottom: 54px; }
  .app-shell { grid-template-columns: 1fr; }
  .workspace { padding: 12px 10px 68px; }
  .topbar {
    gap: 12px;
    margin-bottom: 10px;
  }
  h1 { font-size: 1.38rem; }
  .summary { display: none; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 52px;
    padding: 8px 10px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
  }
  .nav-stack,
  .sidebar-foot { display: none; }
  .brand {
    width: auto;
    min-width: 122px;
    height: 36px;
    flex: 0 0 auto;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .brand-text { font-size: 0.9rem; }
  .status-strip {
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  .status-pill {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.72rem;
  }
  .dashboard-grid { gap: 10px; }
  .module-header > [data-icon],
  .metric-icon {
    width: 30px;
    height: 30px;
  }
  .module.compact,
  .module,
  .module.wide,
  .module.full { grid-column: 1 / -1; }
  .row {
    min-height: 44px;
    align-items: start;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
  }
  .row.clickable { padding: 6px; }
  .row-icon svg {
    width: 14px;
    height: 14px;
  }
  .row-actions {
    justify-self: start;
    grid-column: 2;
    margin-top: 4px;
  }
}
@media (max-width: 540px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-body { padding: 10px; }
  .module-header {
    min-height: 46px;
    padding: 9px 10px;
  }
  .module-title { font-size: 0.92rem; }
  .module-subtitle { display: none; }
  .module-header > [data-icon] {
    width: 28px;
    height: 28px;
  }
  .module-header > [data-icon] svg {
    width: 16px;
    height: 16px;
  }
  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .metric-card {
    min-height: 58px;
    padding: 7px;
  }
  .metric-label {
    font-size: 0.64rem;
    line-height: 1.15;
  }
  .metric-value {
    margin-top: 3px;
    font-size: 1.08rem;
  }
  .metric-footer { display: block; }
  .metric-note {
    margin-top: 2px;
    font-size: 0.58rem;
    line-height: 1.15;
  }
  .metric-icon { display: none; }
  .row strong {
    font-size: 0.84rem;
    white-space: normal;
    overflow: visible;
  }
  .row span {
    font-size: 0.72rem;
    line-height: 1.35;
  }
  .badge {
    padding: 3px 6px;
    font-size: 0.6rem;
  }
  .search-box {
    min-width: 0;
    width: 100%;
    height: 38px;
  }
  .refresh-button {
    height: 38px;
  }
}

.reminder-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  margin-top: 0;
  overflow: hidden;
  border: 0;
  border-top: 1px solid rgba(223,209,189,0.8);
  border-radius: 0;
  background: rgba(23,33,54,0.96);
  box-shadow: 0 -12px 30px rgba(24, 32, 49, 0.12);
}

.reminder-track {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 72px;
  width: max-content;
  padding: 0 28px;
  animation: reminder-slide 100s linear infinite;
  will-change: transform;
  white-space: nowrap;
}

.reminder-ticker:hover .reminder-track {
  animation-play-state: paused;
}

.reminder-line {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  color: #fff8e8;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes reminder-slide {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* John readability pass: larger phone text and safer touch targets. */
@media (max-width: 820px) {
  body {
    padding-bottom: 62px;
    background: #f4ead9;
  }

  .workspace {
    padding: 14px 12px 78px;
  }

  .sidebar {
    height: 58px;
    padding: 9px 12px;
    overflow: visible;
  }

  .brand {
    width: 42px;
    min-width: 42px;
    height: 42px;
    gap: 10px;
    padding: 4px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text {
    display: none;
  }

  .menu-toggle {
    display: grid;
    flex: 0 0 auto;
  }

  .sidebar .nav-stack {
    display: none;
  }

  .sidebar.menu-open .nav-stack {
    position: fixed;
    top: 66px;
    right: 10px;
    z-index: 75;
    width: min(280px, calc(100vw - 20px));
    max-height: calc(100vh - 92px);
    overflow: auto;
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(197,160,75,0.42);
    border-radius: 8px;
    background: rgba(16, 26, 44, 0.98);
    box-shadow: 0 22px 60px rgba(16, 26, 44, 0.28);
  }

  .sidebar.menu-open .nav-button {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .sidebar.menu-open .nav-label {
    display: block;
    font-size: 0.95rem;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .eyebrow {
    font-size: 0.82rem;
  }

  h1 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    line-height: 1.18;
    font-weight: 800;
  }

  .status-strip {
    gap: 8px;
    margin-bottom: 12px;
  }

  .status-pill {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .dashboard-grid {
    gap: 14px;
  }

  .module {
    border-radius: 8px;
  }

  .module-header,
  .module.compact .module-header {
    min-height: 62px;
    padding: 13px 14px;
  }

  .module-title {
    font-family: var(--font-sans);
    font-size: 1.16rem;
    line-height: 1.22;
    font-weight: 800;
  }

  .module-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .module-body,
  .module.compact .module-body {
    padding: 14px;
  }

  .module-header > [data-icon],
  .module.compact .module-header > [data-icon] {
    width: 36px;
    height: 36px;
  }

  .module-header > [data-icon] svg,
  .module.compact .module-header > [data-icon] svg {
    width: 20px;
    height: 20px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    min-height: 88px;
    padding: 12px;
  }

  .metric-label {
    font-size: 0.94rem;
    line-height: 1.25;
  }

  .metric-value {
    margin-top: 3px;
    font-size: 1.82rem;
    line-height: 1.05;
    font-weight: 800;
  }

  .metric-note {
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .metric-icon {
    display: none;
  }

  .list {
    gap: 2px;
  }

  .row {
    min-height: 76px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 11px;
    padding: 10px 2px;
    align-items: start;
  }

  .row.clickable {
    padding: 10px 8px;
  }

  .row-icon {
    margin-top: 2px;
  }

  .row-icon svg {
    width: 18px;
    height: 18px;
  }

  .row strong {
    font-size: 1rem;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
  }

  .row span {
    font-size: 0.94rem;
    line-height: 1.5;
  }

  .row-actions {
    grid-column: 2;
    margin-top: 7px;
  }

  .badge,
  .source-link {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  .message {
    font-size: 1rem;
    line-height: 1.5;
  }

  .prompt {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.94rem;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .composer input,
  .send-button {
    height: 48px;
    font-size: 1rem;
  }

  .reminder-track {
    min-height: 50px;
    gap: 56px;
    padding: 0 22px;
    animation-duration: 100s;
  }

  .reminder-line {
    min-height: 34px;
    font-size: 0.94rem;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .module-body,
  .module.compact .module-body {
    padding: 12px;
  }

  .metric-card {
    min-height: 82px;
    padding: 10px;
  }

  .metric-value {
    font-size: 1.72rem;
  }
}
