@import url("./safe-area.css");

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-sidebar: #050607;
  --bg-soft: #050607;
  --surface: #0b0d0e;
  --surface-raised: #141719;
  --surface-hover: #222729;
  --line: #343a3d;
  --line-soft: #23282a;
  --text: #fdfefd;
  --text-secondary: #f5f7f6;
  --text-quote: #e2e7e4;
  --muted: #d2d7d4;
  --faint: #b9bfbc;
  --mint: #7ac7a7;
  --mint-bright: #9ad9bd;
  --mint-ink: #122019;
  --blue: #82b5e8;
  --violet: #b7a1e8;
  --amber: #e7bb70;
  --red: #df8d87;
  /* Two-column sidebar follows the window; the floor keeps rows readable and
   * leaves the main column at least ~540px at the 821px two-column threshold.
   * A width dragged on this device replaces the default within the same floor
   * and main-column minimum (sidebar-resize-controller.js). */
  --sidebar-default-width: clamp(280px, calc(22vw + 40px), 420px);
  --sidebar-width: clamp(280px, var(--sidebar-preferred-width, var(--sidebar-default-width)), calc(var(--content-width) - 540px));
  --topbar-height: 58px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 17px;
  --font-size-base: 15.5px;
  --font-size-secondary: 13px;
  --font-size-title: 20px;
  --font-size-code: 14.5px;
  --font-size-table: 14.5px;
  --font-size-composer: 15.5px;
  --font-size-navigation: 14.5px;
  /* Scales fixed chrome sizes with the chosen font size; hierarchy is kept. */
  --font-scale: 1.1;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

html[data-font-size="small"] { --font-size-base: 14px; --font-size-secondary: 12px; --font-size-title: 18px; --font-size-code: 13px; --font-size-table: 13px; --font-size-composer: 14px; --font-size-navigation: 13px; --font-scale: 1; }
html[data-font-size="default"] { --font-size-base: 15.5px; --font-size-secondary: 13px; --font-size-title: 20px; --font-size-code: 14.5px; --font-size-table: 14.5px; --font-size-composer: 15.5px; --font-size-navigation: 14.5px; --font-scale: 1.1; }
html[data-font-size="large"] { --font-size-base: 17px; --font-size-secondary: 14px; --font-size-title: 22px; --font-size-code: 16px; --font-size-table: 16px; --font-size-composer: 17px; --font-size-navigation: 16px; --font-scale: 1.2; }
html[data-font-size="xlarge"] { --font-size-base: 19px; --font-size-secondary: 15.5px; --font-size-title: 24px; --font-size-code: 18px; --font-size-table: 18px; --font-size-composer: 19px; --font-size-navigation: 18px; --font-scale: 1.35; }
html[data-font-size="xxlarge"] { --font-size-base: 21px; --font-size-secondary: 17px; --font-size-title: 26px; --font-size-code: 20px; --font-size-table: 20px; --font-size-composer: 21px; --font-size-navigation: 20px; --font-scale: 1.5; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f7;
  --bg-sidebar: #ecefed;
  --bg-soft: #f1f3f2;
  --surface: #fff;
  --surface-raised: #f7f9f8;
  --surface-hover: #e8ecea;
  --line: #ccd2cf;
  --line-soft: #dfe3e1;
  --text: #181d1a;
  --text-secondary: #414945;
  --text-quote: #59635e;
  --muted: #536057;
  --faint: #59655e;
  --mint: #287856;
  --mint-bright: #216b4c;
  --mint-ink: #f5fffa;
  --blue: #2f70ad;
  --violet: #7655b5;
  --amber: #8b641f;
  --red: #a3453d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--text);
  background: var(--bg);
  font-size: var(--font-size-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.message-stream,
.markdown-body,
.markdown-body code,
.markdown-body table,
.composer,
.composer-controls,
.thread-list,
.action-center,
.detail-sheet,
.settings-page,
.runtime-policy-page {
  font-size: var(--font-size-base);
}

.composer-note,
.thread-context,
.list-heading,
.section-label,
.markdown-body figcaption,
.settings-page small,
.runtime-policy-page small {
  font-size: var(--font-size-secondary);
}

.thread-topbar #detail-title,
.settings-page h1,
.settings-page h2 {
  font-size: var(--font-size-title);
}

.markdown-body,
.markdown-table-wrap,
.markdown-body pre,
.markdown-body code,
.composer-shell,
.thread-list,
.settings-page-main,
.runtime-policy-page-main {
  min-width: 0;
  max-width: 100%;
}

button,
textarea,
input {
  font: inherit;
}

button {
  min-width: 44px;
  min-height: 44px;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: calc(8px + var(--content-left));
  min-height: 44px;
  padding: 11px 15px;
  color: var(--mint-ink);
  background: var(--mint);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.count-badge {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  place-items: center;
  color: var(--mint-ink);
  background: var(--mint);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
}

.status-live {
  background: var(--mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 12%, transparent);
}

.status-waiting {
  background: var(--amber);
}

.status-blocked,
.status-failed {
  background: var(--red);
}

@media (prefers-reduced-motion: no-preference) {
  .skip-link,
  .sidebar,
  .action-center,
  .detail-sheet {
    transition: transform 150ms ease, opacity 150ms ease;
  }
}
