/* Speech - shared design tokens and components.
   Token source: flow-design-studio DESIGN-SYSTEM.md (warm cream desktop surface
   + white admin surface). No external fonts, no CDNs. */

:root {
  /* Surfaces */
  --shell: #F5F4F1;
  --panel: #FCFCFB;
  --card: #F5F4F1;
  --popover: #FFFFFF;
  --nav-active: #EEEBE4;
  --row-hover: #F8F7F4;
  --chip-hover: #EBE7DE;

  /* Text */
  --ink: #1A1A1A;
  --text-2: #71716E;
  --text-3: #8A8983;
  --placeholder: #9A9A96;

  /* Borders */
  --hairline: #ECE9E2;
  --row-sep: #F0EDE7;
  --divider: #E8E6E1;
  --input-border: #D9D6CD;
  --input-focus: #4D4A43;

  /* Actions */
  --btn-black: #1A1A1A;
  --btn-black-disabled: #8B8B8A;
  --btn-beige: #EEEBE4;

  /* Accents */
  --chip-purple: #ECD8FC;
  --accent-purple: #6A36A0;
  --teal: #2E5B5C;
  --teal-mid: #3E7772;
  --teal-fill: #D4ECEA;
  --red: #DD524C;
  --green: #3D9A50;
  --amber: #DA9B35;

  /* Dark banner */
  --banner-dark: #0E0D0C;
  --banner-cream: #F5F1E8;
  --banner-cream-body: #EFE9DD;
  --banner-cta: #E9E6DF;

  /* Admin (white surface) */
  --a-page: #FFFFFF;
  --a-sidebar: #FAFAFA;
  --a-card: #FCFCFB;
  --a-nav-active: #EFEFEF;
  --a-border: #E5E5E5;
  --a-border-light: #EDEDED;
  --a-ink: #18181B;
  --a-text-2: #71717A;
  --a-axis: #8A8F92;
  --a-gridline: #EFEFEF;
  --a-black-btn: #17171B;
  --a-avatar: #1E3A5F;

  /* Type */
  --font-serif: "Iowan Old Style", Georgia, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Shadows */
  --shadow-popover: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--shell);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: inherit; }

::selection { background: var(--chip-purple); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Type scale ---------- */

.overline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.serif-display {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.serif-display em,
.serif-display i {
  font-style: italic;
}

.small { font-size: 13.5px; color: var(--text-2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.btn-black {
  background: var(--btn-black);
  color: #FFFFFF;
}
.btn-black:hover { background: #000000; }
.btn-black:disabled { background: var(--btn-black-disabled); cursor: default; }

.btn-beige {
  background: var(--btn-beige);
  color: var(--ink);
}
.btn-beige:hover { background: var(--chip-hover); }

.btn-light {
  background: var(--banner-cta);
  color: var(--ink);
}
.btn-light:hover { background: #FFFFFF; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 0 12px;
}
.btn-ghost:hover { background: var(--nav-active); color: var(--ink); }

.btn .icon { flex: 0 0 auto; }

/* ---------- Icons ---------- */

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icon-20 { width: 20px; height: 20px; }

/* ---------- Site header (public pages) ---------- */

.site-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

.brand .brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;
  transition: background-color 140ms ease;
}
.nav-link:hover { background: var(--nav-active); }

/* ---------- Sheet: content panel floating on the shell frame ---------- */

.sheet {
  max-width: 1080px;
  margin: 0 auto 20px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
}

.card-bordered {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  background: #FFFFFF;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
}

.input::placeholder { color: var(--placeholder); }

.input:focus {
  outline: none;
  border: 2px solid var(--input-focus);
  padding: 0 12px;
}

.form-error {
  display: none;
  font-size: 13.5px;
  color: var(--red);
  margin: 4px 0 12px;
}
.form-error.visible { display: block; }

.form-note {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 4px 0 12px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--hairline);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 12px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skeleton {
  display: inline-block;
  min-width: 64px;
  border-radius: 6px;
  background: var(--nav-active);
  color: transparent;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
