/* generated 2026-05-01T06:15:02.346Z from pages/src/styles/base.css, cards.css, chat.css, map.css, personal.css */

/*
 * base.css — paper-toned palette, serif body, sans-serif chrome.
 * Mobile-first; desktop is a stretched variant.
 *
 * Single accent color reserved for interactive primaries.
 */

:root {
  --paper: #fafaf7;
  --ink: #1c1c1c;
  --ink-soft: #555;
  --ink-faint: #888;
  --rule: #e3e0d8;
  --raise: #fff;
  --user-bubble: #ecebe4;
  --accent: #6b3a1c;
  --accent-hover: #82482a;
  --accent-text: #fff;
  --warn: #b54b3c;
  --ok: #3f7a4e;

  --font-serif: 'Iowan Old Style', 'Charter', 'Source Serif Pro',
                'Palatino Linotype', Palatino, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
               sans-serif;

  --gap: 12px;
  --gap-lg: 24px;
  --radius: 8px;
  --tab-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  overscroll-behavior-y: contain;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  min-height: 44px;
  min-width: 44px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
.view.active {
  display: flex;
}

/* ---------- App shell ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.app-header {
  flex: 0 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.app-header-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- Tab bar ---------- */

.tab-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding-bottom: var(--safe-bottom);
}
.tab-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  height: var(--tab-height);
  text-transform: uppercase;
  transition: color 150ms ease-out;
}
.tab-btn.active {
  color: var(--ink);
}
.tab-btn.active::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent);
  margin-top: 6px;
}

/* ---------- PIN gate ---------- */

.pin-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: var(--gap-lg);
  flex: 1;
}
.pin-gate.active { display: flex; }
.app-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.pin-subtitle {
  color: var(--ink-soft);
  font-size: 16px;
  text-align: center;
  max-width: 320px;
}
.pin-form {
  display: flex;
  gap: var(--gap);
  width: 100%;
  max-width: 320px;
}
.pin-input {
  flex: 1;
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 22px;
}
.pin-submit {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  padding: 0 22px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 150ms ease-out;
}
.pin-submit:hover { background: var(--accent-hover); }
.pin-submit:disabled { opacity: 0.5; cursor: wait; }
.pin-error {
  color: var(--warn);
  min-height: 1.55em;
  font-size: 14px;
  text-align: center;
}

/* ---------- Desktop adjustments ---------- */

@media (min-width: 720px) {
  body { font-size: 18px; }
  .tab-bar {
    order: -1;
    border-top: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0;
  }
  .app-header { display: none; }
  .app-main { max-width: 760px; margin: 0 auto; width: 100%; }
}


/* cards.css — sortable list with tap-to-reveal and mastery controls. */

.cards-view {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.cards-view.active { display: flex; }

.cards-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
}
.sort-label {
  font-size: 13px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sort-select {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 8px 12px;
}

.cards-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--rule);
  -webkit-overflow-scrolling: touch;
}

.cards-empty {
  margin: auto;
  max-width: 380px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding: 24px;
  display: none;
}

.card-row {
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
}
.card-row.expanded .card-head { padding-bottom: 12px; }

.card-term {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
}
.card-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.card-body {
  display: none;
  padding: 0 20px 18px;
  gap: 12px;
  flex-direction: column;
}
.card-row.expanded .card-body { display: flex; }

.card-def {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.card-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-faint);
  text-transform: lowercase;
}

.mastery-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mastery-btn {
  flex: 1 1 auto;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--raise);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.mastery-btn:hover { border-color: var(--ink-faint); }
.mastery-btn:disabled { opacity: 0.5; cursor: wait; }
.mastery-error {
  flex: 1 1 100%;
  color: var(--warn);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 0;
}


/* chat.css — transcript + composer + audio controls. Tutor messages are the focus typography. */

.chat-view {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.chat-view.active { display: flex; }

.chat-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

/*
 * Stage 6.4: secondary label exposing the tap-to-replay affordance.
 * Italic serif keeps it consistent with the Stage 6.2 personal messages —
 * the small "human voice" thread of the UI. Non-interactive; hidden
 * entirely (display: none) when audio is disabled.
 */
.replay-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  line-height: 1.3;
  user-select: none;
  pointer-events: none;
}

.audio-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease-out, background 150ms ease-out;
}
.audio-toggle:hover { background: var(--user-bubble); }
.audio-toggle[data-on="true"] { color: var(--accent); }
.audio-toggle[data-on="false"] { color: var(--ink-faint); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.msg-tutor { align-self: flex-start; }
.msg-user  { align-self: flex-end;   }

/*
 * Stage 6.3: tutor bubbles are tappable for audio replay only when audio
 * is enabled. The interactivity hint (cursor + tap-flash) is gated on
 * `.chat-view[data-audio-enabled="true"]` so flipping the toggle off
 * removes the visual affordance without re-rendering bubbles.
 */
.msg-tutor {
  border-radius: var(--radius);
  margin: -4px -8px;
  padding: 4px 8px;
  transition: background-color 100ms ease-out;
  outline: none;
}
.msg-tutor:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-view[data-audio-enabled="true"] .msg-tutor { cursor: pointer; }
.chat-view[data-audio-enabled="true"] .msg-tutor:active { background-color: rgba(0,0,0,0.05); }

.msg-content {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-tutor .msg-content {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

.msg-user .msg-content {
  font-family: var(--font-serif);
  background: var(--user-bubble);
  padding: 10px 14px;
  border-radius: 12px 12px 4px 12px;
  font-size: 16px;
  line-height: 1.5;
}

.chat-empty {
  margin: auto;
  max-width: 380px;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}

.chat-thinking {
  align-self: flex-start;
  font-style: italic;
  color: var(--ink-faint);
  padding: 6px 0;
}

.chat-error {
  align-self: stretch;
  background: #fff2ee;
  border: 1px solid #f1c5b8;
  color: var(--warn);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
}

.chat-composer {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.chat-input {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 144px;
  padding: 11px 14px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
}
.chat-send {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  padding: 0 18px;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.04em;
  align-self: flex-end;
  height: 44px;
  transition: background 150ms ease-out;
}
.chat-send:hover { background: var(--accent-hover); }
.chat-send:disabled { opacity: 0.5; cursor: wait; }


/* map.css — competence cells + diagnostic notes + weak areas. */

.map-view {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.map-view.active { display: flex; }

.map-loading {
  margin: auto;
  color: var(--ink-faint);
  font-style: italic;
}

.map-section {
  padding: 20px;
  border-bottom: 1px solid var(--rule);
}
.map-section:last-of-type { border-bottom: none; }

.map-section-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 720px) {
  .map-eras .map-grid { grid-template-columns: repeat(9, 1fr); }
  .map-themes .map-grid { grid-template-columns: repeat(6, 1fr); }
}

.map-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--raise);
  font-family: var(--font-sans);
  min-height: 64px;
}
.map-cell-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.map-cell-value {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.map-cell-untested  { background: var(--raise); }
.map-cell-shaky     { background: #fff0e8; border-color: #f3c8b3; }
.map-cell-shaky .map-cell-value { color: #b46b3f; }
.map-cell-familiar  { background: #f1ecdc; border-color: #d8c89a; }
.map-cell-familiar .map-cell-value { color: #8b6e1c; }
.map-cell-solid     { background: #ddead8; border-color: #99c08e; }
.map-cell-solid .map-cell-value { color: var(--ok); }

.map-notes .map-note {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 12px;
}
.map-notes .map-note:last-child { margin-bottom: 0; }

.map-empty {
  font-style: italic;
  color: var(--ink-faint);
}

.map-weak-list {
  list-style: disc inside;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.55;
}
.map-weak-list li { margin-bottom: 4px; }

.map-footer {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-faint);
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
}


/*
 * personal.css — Stage 6.2.
 *
 * Visual treatment for the personal messages threaded into the app
 * (welcome on the PIN gate, rotating thinking indicator in chat). Italic
 * serif. Generous line height. Slightly relaxed letter-spacing. The point
 * is that these don't read like UI affordances.
 *
 * Build script concatenates CSS files alphabetically; this file lands
 * last so its rules override the per-surface chrome where they overlap.
 */

.personal-message {
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--ink);
}

/* PIN gate: prominent, centered, replaces the utilitarian subtitle. */
.welcome-message {
  font-size: 1.5rem;
  text-align: center;
  max-width: 28ch;
  margin: 0 auto;
  color: var(--ink);
}
@media (min-width: 720px) {
  .welcome-message { font-size: 1.625rem; max-width: 34ch; }
}

/* Chat: appears in the message stream while the tutor is composing. */
.thinking-message {
  align-self: flex-start;
  max-width: 92%;
  font-size: 1rem;
  color: var(--ink-soft);
  padding: 4px 0;
  /* Stage 6.2: 300ms ease-out fade between rotated messages. */
  transition: opacity 300ms ease-out;
}
