/* Talk Tools smartboard — same aesthetic tokens as the generator.
   Cool gray ground, teal ink, lime accents. Present type stays large. */

:root {
  --cream: #f6f7f8;
  --cream-warm: #eef1f2;
  --cream-dark: #dce2e4;
  --ink: #173437;
  --ink-soft: #16272b;
  --ink-muted: #5b6a70;
  --muted: #657378;
  --border: #dce2e4;
  --terracotta: #173437;
  --terracotta-dark: #285055;
  --sage: #4e6652;
  --sage-dark: #344e42;
  --gold: #cfe394;
  --lime: #e0f6a0;
  --lime-border: #cfe394;
  --lime-hover: #d5ee88;
  --lime-ink: #233c32;
  --white: #fff;
  --up: #173437;
  --shadow: 0 8px 30px #1535380a;
  --font-h: Georgia, "Times New Roman", serif;
  --font-b: Arial, Helvetica, sans-serif;
  --header-h: 3.15rem;
  --dock-h: 6.75rem;
  --focus-ring: #497d86;
  --focus: 0 0 0 2px #fff, 0 0 0 4px #497d86;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html { height: 100%; }

body {
  font-family: var(--font-b);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.tool {
  height: 100%;
  overflow: hidden;
}

img, svg { display: block; }

a {
  color: var(--terracotta-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--terracotta); }

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

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 5px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--ink);
  color: var(--cream);
  padding: 0.4rem 0.7rem;
  z-index: 100;
  border-radius: 6px;
}
.skip:focus { top: 0.75rem; }

/* ========== Landing ========== */
.banner {
  background: var(--ink);
  color: #e8e2d8;
  text-align: center;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
}
.banner strong { color: #fff; font-weight: 600; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(247, 243, 238, 0.94);
}

.site-nav {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.95rem 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-h);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span {
  color: var(--muted);
  font-weight: 400;
}

.wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 0.7rem;
}

.hero h1 {
  font-family: var(--font-h);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.85rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 36rem;
  margin: 0;
}

.tool-grid {
  display: grid;
  gap: 1.1rem;
  margin: 2.25rem 0 2.5rem;
  list-style: none;
  padding: 0;
}
@media (min-width: 760px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem 1.3rem 1.2rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover {
  border-color: #cbd8db;
  transform: translateY(-1px);
  color: inherit;
}
.tool-card .num {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 0.55rem;
}
.tool-card h2 {
  font-family: var(--font-h);
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 0.55rem;
  color: var(--ink);
}
.tool-card p {
  color: var(--ink-muted);
  font-size: 0.98rem;
  margin: 0 0 1.1rem;
  flex: 1;
}
.tool-card .go {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--terracotta-dark);
}

.note, .keys-box {
  background: var(--cream-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.keys-box { margin-top: 1rem; }
.keys-box h2 {
  font-family: var(--font-h);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.45rem;
}
kbd {
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  color: var(--ink-soft);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.35rem 1.25rem 2.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ========== Tool chrome ========== */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.tool-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem 0.85rem;
  min-height: var(--header-h);
  padding: 0.4rem 0.75rem 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 243, 238, 0.96);
}

.tool-bar .brand {
  font-family: var(--font-h);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.tool-bar .brand:hover { color: var(--terracotta-dark); }
.tool-bar .brand span { color: var(--muted); font-weight: 400; }

.tool-title {
  font-family: var(--font-h);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.tool-bar .spacer { flex: 1; }

.icon-btn, .text-btn, .primary-btn, .ghost-btn, .preset-btn {
  font-family: var(--font-b);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-soft);
  padding: 0.48rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
}
.icon-btn {
  width: 2.25rem;
  padding: 0;
}
.icon-btn svg, .text-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.text-btn:hover, .icon-btn:hover, .ghost-btn:hover, .preset-btn:hover {
  border-color: #cbd8db;
  background: var(--cream-warm);
}
.primary-btn {
  background: var(--lime);
  border-color: var(--lime-border);
  color: var(--lime-ink);
}
.primary-btn:hover {
  background: var(--lime-hover);
  border-color: var(--lime-border);
}
.primary-btn[disabled], .text-btn[disabled], .ghost-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.ghost-btn {
  background: transparent;
}
.text-btn.is-on, .icon-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.danger-btn {
  color: var(--terracotta-dark);
}

/* Step / phase rail */
.rail {
  flex: 0 0 auto;
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream-warm);
  overflow-x: auto;
}

.rail button {
  font-family: var(--font-b);
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.rail button .n {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.rail button[aria-current="step"] {
  background: var(--ink);
  color: var(--cream);
}
.rail button[aria-current="step"] .n { color: #e8c4b8; }
.rail button:hover:not([aria-current="step"]) {
  background: var(--cream-dark);
  color: var(--ink);
}

/* Stage */
.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 1.15rem 1.35rem 0.5rem;
}

.stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.step-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0;
}

.cue {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}

.prompt,
.display-text {
  font-family: var(--font-h);
  font-weight: 400;
  letter-spacing: -1.2px;
  font-size: clamp(2rem, 5.4vw, 4.1rem);
  line-height: 1.14;
  color: var(--ink);
  margin: 0 0 0.6rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.display-text.stem,
.stem-line {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.85rem, 4.6vw, 3.4rem);
  color: var(--ink-soft);
}

.display-text.is-editable,
.prompt.is-editable,
.item-text.is-editable {
  outline: 2px dashed var(--border);
  outline-offset: 6px;
  border-radius: 4px;
  cursor: text;
}
.display-text.is-editable:focus,
.prompt.is-editable:focus,
.item-text.is-editable:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 5px;
}

.sub-prompt {
  font-family: var(--font-h);
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  color: var(--ink-muted);
  margin: 0 0 1rem;
  line-height: 1.35;
}

/* Lists of partner prompts / stems */
.prompt-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
@media (min-width: 900px) {
  .prompt-list.cols { grid-template-columns: 1fr 1fr; }
}

.prompt-list li,
.stem-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.item-text {
  font-family: var(--font-h);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  flex: 1;
  white-space: pre-wrap;
}

.remove-item {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
}
.remove-item:hover { color: var(--terracotta-dark); background: var(--cream-warm); }

body.present .remove-item,
body.present .edit-only,
body.present .add-row { display: none !important; }

.add-row {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Rotate cue */
.rotate-screen, .final-screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
  padding: 0.5rem 0 1rem;
}
.rotate-screen .display-text {
  font-size: clamp(3rem, 8vw, 6.2rem);
  color: var(--ink);
}
.rotate-mark {
  width: 3.5rem;
  height: 0.35rem;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 1.1rem;
}

/* Edit panel (sets, durations, toggles) */
.edit-panel {
  margin-top: auto;
  padding: 0.75rem 0 0.4rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 8rem;
}
.field label, .check label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  font-family: var(--font-b);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  min-height: 2.2rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chip {
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}
.chip:hover, .chip.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}
.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.2rem;
}
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--terracotta); }

/* Dock: timer + nav */
.dock {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.55rem 0.85rem 0.7rem;
  border-top: 1px solid var(--border);
  background: var(--cream-warm);
  min-height: var(--dock-h);
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.timer-face {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 8.5rem;
}
.timer-readout {
  font-family: var(--font-h);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.95;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.timer.is-running .timer-readout { color: var(--sage-dark); }
.timer.is-up .timer-readout { color: var(--terracotta); }
.timer-status {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}
.timer.is-up .timer-status { color: var(--terracotta); }

.timer-bar {
  width: 7.5rem;
  height: 0.42rem;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.timer-bar > span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--sage);
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(var(--progress, 1));
  transition: transform 0.2s linear, background-color 0.2s ease;
}
.timer.is-up .timer-bar > span { background: var(--terracotta); transform: scaleX(0); }

.timer-controls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.timer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.preset-btn {
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
}
.preset-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.custom-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.custom-time input {
  width: 3.4rem;
  font-family: var(--font-b);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.28rem 0.35rem;
  background: var(--white);
  color: var(--ink);
  text-align: center;
}
.custom-time span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.nav-btns {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
}
.nav-btns .text-btn, .nav-btns .primary-btn {
  min-width: 6.5rem;
  min-height: 2.6rem;
  font-size: 0.95rem;
}

/* Time-up flash */
.timeup-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
  padding: 0.55rem 1rem;
}
body.time-up .timeup-banner { display: block; }
body.time-up .app { box-shadow: inset 0 0 0 6px var(--terracotta); }

@media (prefers-reduced-motion: reduce) {
  .timer-bar > span { transition: none; }
  .tool-card { transition: none; }
}

/* Present mode: quieter chrome */
body.present .tool-bar .brand span { display: none; }
body.present .tool-bar { background: #fff; border-bottom: 1px solid var(--border); }

/* Phone / tight */
@media (max-width: 720px) {
  .dock {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    min-height: 0;
  }
  .nav-btns { justify-content: stretch; }
  .nav-btns .text-btn, .nav-btns .primary-btn { flex: 1; }
  .tool-title { display: none; }
  .prompt, .display-text {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }
  .display-text.stem { font-size: clamp(1.4rem, 7vw, 2rem); }
  .timer-readout { font-size: 3rem; }
  .stage { padding: 0.9rem 1rem 0.4rem; }
  .tool-bar { flex-wrap: wrap; }
}

@media (max-height: 800px) and (min-width: 721px) {
  :root { --dock-h: 6.1rem; --header-h: 2.9rem; }
  .prompt, .display-text {
    font-size: clamp(1.85rem, 4.6vw, 3.4rem);
  }
  .display-text.stem { font-size: clamp(1.7rem, 4vw, 2.9rem); }
  .stage { padding-top: 0.85rem; }
}

/* Hidden state panels */
.panel[hidden], [hidden] { display: none !important; }

.round-meta {
  font-family: var(--font-h);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.round-meta span { color: var(--terracotta); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* 1280x800 safety: keep dock on screen */
@media (min-width: 1280px) and (max-height: 800px) {
  .timer-readout { font-size: 3.4rem; }
}

a.text-btn { text-decoration: none; color: inherit; }
a.text-btn:hover { color: inherit; }
