:root {
  color-scheme: light;
  --paper: #f5f3ee;
  --ink: #282722;
  --muted: #726f67;
  --line: #d9d6cf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

.shell { width: min(100% - 96px, 1080px); margin: 0 auto; }
.site-header {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand span { font-weight: 400; color: var(--muted); }
.quiet {
  min-height: 44px;
  padding: 10px 0 10px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.quiet:hover, .back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -2px;
}
h2 { margin: 0; font-weight: 500; }
p { color: var(--muted); line-height: 1.6; }

.hub-main {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  align-items: start;
  gap: 64px;
  padding: 116px 0 100px;
}
.hub-main h1 { padding-top: 17px; }
.projects { border-top: 1px solid var(--line); }
.project {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 116px;
  padding: 24px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color 150ms ease;
}
.project:hover { background: #eae7df; }
.project-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  height: 44px;
}
.project-icon svg { display: block; width: 30px; height: 30px; }
.project h2 { font-size: 24px; letter-spacing: -.6px; }
.project-arrow {
  margin-left: auto;
  padding-left: 12px;
  font-size: 26px;
  color: var(--muted);
}
.project:hover .project-arrow { color: var(--ink); }

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 112px);
  padding: 64px 0 112px;
}
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { margin-bottom: 48px; font-size: 56px; }
label { display: block; margin-bottom: 12px; font-size: 14px; }
input[type=password] {
  width: 100%;
  height: 54px;
  padding: 12px 16px;
  border: 1px solid #bcb8ae;
  border-radius: 4px;
  background: #fffdfa;
  color: var(--ink);
  font-size: 16px;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
}
.primary:hover { background: #46443d; }
.error { min-height: 20px; margin: 12px 0 20px; color: #a02d22; font-size: 13px; }

.dashboard-main { max-width: 800px; padding: 44px 0 80px; }
.back { display: inline-block; padding: 8px 0; color: var(--muted); font-size: 14px; }
.dashboard-main h1 { margin: 36px 0 48px; }
.status-panel { padding: 24px 0; border-block: 1px solid var(--line); }
.status-panel h2 { font-size: 24px; }
.status-panel p { margin: 8px 0 0; font-size: 14px; }
.command-panel { padding-top: 44px; }
.command-panel > h2 { margin-bottom: 24px; font-size: 24px; }
.command { display: flex; align-items: baseline; gap: 28px; padding: 20px 0; border-top: 1px solid var(--line); }
.command code { flex: 0 0 180px; font-size: 13px; }
.command p { margin: 0; font-size: 14px; }

@media (max-width: 850px) {
  .hub-main { grid-template-columns: 1fr; gap: 48px; padding-top: 64px; }
  .hub-main h1 { padding-top: 0; }
}

@media (max-width: 540px) {
  .shell { width: calc(100% - 40px); }
  .site-header { height: 84px; }
  .brand { font-size: 22px; }
  .hub-main { padding: 48px 0 64px; gap: 36px; }
  .project { min-height: 100px; gap: 12px; padding: 20px 4px; }
  .project h2 { font-size: 21px; }
  .project-icon { flex-basis: 36px; height: 36px; }
  .project-icon svg { width: 27px; height: 27px; }
  .login-main { min-height: calc(100dvh - 84px); padding: 48px 0 84px; }
  .login-box h1 { font-size: 48px; margin-bottom: 36px; }
  .dashboard-main h1 { font-size: 44px; }
  .command { display: block; }
  .command p { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .project { transition: none; }
}

/* Bot dashboard */
.dashboard-shell { max-width: 1200px; }
.bot-dashboard { padding: 36px 0 80px; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 28px 0; }
.dashboard-heading h1 { font-size: clamp(40px, 5vw, 60px); }
.dashboard-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.secondary { min-height: 42px; padding: 10px 14px; border: 1px solid #bcb8ae; border-radius: 4px; background: transparent; color: var(--ink); font-size: 13px; }
.secondary:hover { background: #eae7df; }
.secondary:disabled { opacity: .5; cursor: default; }
.connection-line { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.dashboard-error { padding: 14px; border-left: 3px solid #a02d22; color: #a02d22; background: #f4e6de; font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 4px; }
.metric { padding: 24px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric h2 { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.metric strong { display: block; font-size: 25px; font-weight: 500; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.metric > span { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
[data-state="good"] { color: #336447; }
[data-state="bad"] { color: #a02d22; }
[data-state="warning"] { color: #85631d; }
.dashboard-section { margin-top: 40px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h2 { font-size: 23px; letter-spacing: -.5px; }
.inline-label { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 13px; }
select, input[type=search] { border: 1px solid #bcb8ae; border-radius: 4px; padding: 10px 12px; background: #fffdfa; color: var(--ink); font: inherit; min-height: 42px; }
select:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.usage-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.usage-summary strong { display: block; font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.usage-summary span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.traffic-chart { margin: 28px 0; }
.traffic-chart svg { display: block; width: 100%; height: 130px; }
.traffic-chart rect { fill: #7a8871; }
.traffic-chart line { stroke: var(--line); }
.traffic-chart figcaption { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.table-scroll { overflow-x: auto; }
.usage-table, .log-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
th, td { padding: 16px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.usage-table th:not(:first-child), .usage-table td:not(:first-child) { text-align: right; }
.section-note { font-size: 12px; margin: 12px 0 0; }
.dashboard-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.details { margin: 0; font-size: 14px; }
.details > div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.log-filters { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.log-filters label { margin: 0; font-size: 12px; color: var(--muted); }
.log-filters input, .log-filters select { display: block; width: 100%; margin-top: 8px; font-size: 14px; }
.log-table { min-width: 620px; }
.log-table td:first-child { width: 170px; color: var(--muted); }
.log-table td:nth-child(2) { width: 90px; }
.log-level { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.log-level.info { color: #336447; }
.log-level.warning { color: #85631d; }
.log-level.error { color: #a02d22; }
.log-empty { color: var(--muted); text-align: center; padding: 32px !important; }
.command-guide { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.command-guide summary { cursor: pointer; font-size: 18px; margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 950px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-columns { gap: 32px; }
}
@media (max-width: 650px) {
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .connection-line { flex-direction: column; gap: 8px; }
  .metric { padding: 18px 14px; }
  .metric strong { font-size: 22px; }
  .usage-summary { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .dashboard-columns { grid-template-columns: 1fr; gap: 0; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .log-filters { grid-template-columns: 1fr 1fr; gap: 12px; }
  .log-filters label:first-child { grid-column: 1 / -1; }
  .traffic-chart figcaption span:nth-child(2) { display: none; }
  .usage-table { min-width: 580px; }
}
