/* styles.css - Refactored with Golf Clash Game Feel */
/* New Design System: Clean, Modern, Crisp, Vibrant Green Accents */

/* Nunito font (font thread, Robert, Dec 4 2026): served from the app's own fonts folder, same on iPhone, Android and computer */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/nunito-latin-italic.woff2') format('woff2');
}

:root {
  /* === COLOR PALETTE === */
  /* Backgrounds */
  --bg: #f5f2ed;
  --surface: #fdfaf5;
  --surface-strong: #f9f5ed;
  --surface-soft: #f6f2eb;

  /* Text & Muted */
  --text: #1a1815;
  --text-secondary: #6b6559;
  --muted: #8b7f6f;

  /* Accent - BRIGHT Vibrant Green (Golf Clash inspired) */
  --accent: #1ac84f;
  --accent-bright: #2ae063;
  --accent-strong: #0d9632;
  --accent-soft: #d4f7e3;
  --accent-overlay: rgba(26, 200, 79, 0.15);

  /* Status Colors */
  --success: #22a944;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --neg-text: #8b3a2a;
  --info: #3b82f6;

  /* Borders & Lines */
  --line: #e5dfd2;
  --line-strong: #d9cfc0;
  --line-subtle: #ede7dd;

  /* Shadows - Bold depth for game feel */
  --shadow: 0 24px 64px rgba(26, 24, 21, 0.22);
  --shadow-soft: 0 12px 32px rgba(26, 24, 21, 0.14);
  --shadow-xs: 0 4px 12px rgba(26, 24, 21, 0.08);

  /* Radius - Consistent, modern */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Spacing System */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-main: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Transitions - Smooth, responsive */
  --transition-fast: 120ms ease;
  --transition-normal: 180ms ease;
  --transition-slow: 280ms ease;
}

/* Light look always, unless the user turns Dark mode on (Settings). The phone's own dark setting does not change the app. */
:root {
  color-scheme: light;
}

/* Dark mode: <html class="dark">, set from Settings > Dark mode */
html.dark {
  color-scheme: dark;
  --bg: #121513;
  --surface: #1b201c;
  --surface-strong: #232924;
  --surface-soft: #1f2520;
  --text: #eef1ec;
  --text-secondary: #b9c2b8;
  --muted: #8f9a8e;
  --accent-soft: rgba(42, 224, 99, 0.16);
  --accent-overlay: rgba(42, 224, 99, 0.18);
  --danger: #f05252;
  --danger-soft: rgba(240, 82, 82, 0.16);
  --neg-text: #f08a7a;
  --line: #2f3731;
  --line-strong: #3a443c;
  --line-subtle: #262d27;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-xs: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* === GLOBAL STYLES === */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  /* Lock pages left/right on the phone: no sideways slide while scrolling. */
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #f9f7f2 0%, #f5f2ed 50%, #f1ede7 100%);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
}

/* === LAYOUT === */
.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

/* === HEADER & NAVIGATION === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(253, 250, 245, 0.92);
  border-bottom: 1px solid var(--line-subtle);
}

html.dark .site-header {
  background: rgba(18, 21, 19, 0.92);
}

.site-header .container {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.site-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.site-title a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transition: color var(--transition-fast);
}

.site-logo {
  width: 36px;
  height: 36px;
  border-radius: 22%;
  flex-shrink: 0;
}

.site-title a:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.site-nav a:hover {
  color: var(--accent);
}

/* === MAIN CONTENT === */
.site-main {
  padding: 34px 0 72px;
}

.auth-section {
  padding: 48px 0 32px;
}

.auth-wrap {
  display: flex;
  justify-content: center;
}

.auth-card-login {
  width: min(420px, 100%);
}

.auth-card h2 {
  margin: 0 0 24px;
  font-size: clamp(34px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .form-row {
  margin: 0;
  gap: 8px;
}

.auth-form .form-row input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-form .form-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.auth-form .form-actions {
  margin-top: 8px;
}

.auth-inline-link {
  margin-top: -4px;
}

.auth-inline-link a {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.auth-inline-link a:hover {
  color: var(--accent);
}

.auth-links {
  margin-top: 18px;
}

.auth-links p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.auth-links a {
  text-decoration: underline;
  color: var(--accent);
}

/* === DASHBOARD LAYOUT === */
.dashboard-shell {
  display: grid;
  gap: 28px;
}

.dashboard-hero,
.app-panel {
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero {
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  align-items: center;
  gap: var(--space-lg);
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-hero h2,
.app-panel h3 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  font-weight: 700;
}

.app-panel h3 {
  font-size: clamp(28px, 4vw, 38px);
}

.dashboard-hero h2.page-title-small {
  font-size: clamp(28px, 4vw, 38px);
}

.hero-copy {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.6;
}

.hero-meta {
  display: grid;
  gap: var(--space-md);
}

/* === CARDS === */
.meta-card,
.setup-card,
.capture-block {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.meta-card {
  padding: 20px;
}

.meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-panel {
  padding: 32px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-bottom: 24px;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--accent-overlay);
}

/* === FORMS & INPUTS === */
.session-form,
.journal-form {
  display: grid;
  gap: var(--space-lg);
}

.session-flow-screen {
  display: grid;
  gap: var(--space-lg);
}

.choice-grid {
  display: grid;
  gap: 16px;
}

.session-type-grid {
  grid-template-columns: repeat(2, max-content);
  align-items: center;
}

.choice-card,
.impact-card,
.item-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice-card input,
.impact-card input,
.item-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.session-type-button {
  min-width: 120px;
}

.choice-card {
  min-height: 148px;
  padding: 22px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-normal),
    transform var(--transition-normal),
    background var(--transition-normal),
    box-shadow var(--transition-normal);
}

.choice-card:hover {
  border-color: var(--accent-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.choice-title {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition-fast);
}

.choice-copy {
  display: block;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.choice-card input:checked + .choice-title,
.impact-card input:checked + .impact-symbol,
.impact-card input:checked ~ .impact-copy,
.item-option input:checked + span {
  font-weight: 700;
}

.choice-card:has(input:checked) {
  border-color: #ff8c00;
  background: #fff5e6;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
}

.item-option:has(input:checked) {
  border-color: var(--accent-strong) !important;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(26, 200, 79, 0.2);
}

.item-option:has(input:checked) span {
  color: white !important;
  text-shadow: 0 2px 4px rgba(13, 150, 50, 0.3);
}

.impact-card:has(input:checked) {
  border-color: var(--accent-strong) !important;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(26, 200, 79, 0.2);
}

.impact-card:has(input:checked) .impact-symbol,
.impact-card:has(input:checked) .impact-copy {
  color: white !important;
  text-shadow: 0 2px 4px rgba(13, 150, 50, 0.3);
}

.setup-card,
.capture-block {
  padding: 22px;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-lg);
  margin-bottom: 18px;
}

.panel-header h4,
.setup-header h4,
.capture-block h4 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
}

.setup-header p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.muted-inline {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.stack-fields {
  display: grid;
  gap: 18px;
}

.course-search-results {
  display: grid;
  gap: 10px;
}

.course-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.course-result-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.course-result-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.course-result-item strong {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}

.course-result-item span {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.3;
}

.course-selected {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}

.course-selected span:last-child {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.3;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.required-note {
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.form-row textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--accent);
}

.password-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.3;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform var(--transition-normal),
    background var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-solid {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: white;
  border-color: var(--accent-strong);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(13, 150, 50, 0.3);
}

.btn-solid:hover {
  background: linear-gradient(135deg, #2ae063 0%, #1ac84f 100%);
  border-color: var(--accent-strong);
  box-shadow: 0 0 20px rgba(26, 200, 79, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-overlay);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #fecaca;
  border-color: #ef4444;
}

.btn-compact {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.icon-button-danger {
  border-color: var(--danger);
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
}

.icon-button-danger:hover {
  border-color: var(--danger);
  color: #ffffff;
  background: var(--danger);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-form .btn {
  min-height: 48px;
  padding: 0 18px;
}

/* === CAPTURE LAYOUT === */
.capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr);
  gap: 20px;
}

.round-capture-panel {
  width: 100%;
  box-sizing: border-box;
  max-width: 980px;
  margin-inline: auto;
}

.round-intention-strip {
  display: block;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.round-intention-strip span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.round-intention-strip strong {
  display: block;
  white-space: pre-line;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.round-capture-stack {
  display: grid;
  gap: 18px;
}

.round-entry-block {
  padding: 0;
  background: transparent;
  border: 0;
}

.round-entry-block h4 {
  margin: 6px 0 16px;
  font-weight: 600;
  text-align: center;
}

.round-capture-actions {
  justify-content: flex-start;
  padding: 4px 0 0;
}

.round-event-log {
  padding-top: 12px;
  border-top: 1px solid var(--line-subtle);
}

.round-event-log-list {
  display: grid;
  gap: 8px;
}

.round-event-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  padding: 8px 0;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.round-event-line:hover {
  background: var(--surface-soft);
}

.round-event-line-number,
.round-event-line-impact {
  color: var(--accent);
  white-space: nowrap;
  font-weight: 600;
}

.round-event-line-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.capture-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.capture-sidebar {
  align-content: start;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-option {
  padding: 16px 18px;
  background: white;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-normal),
    background var(--transition-normal),
    transform var(--transition-normal),
    box-shadow var(--transition-normal),
    color var(--transition-normal);
}

.item-option:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.item-option span {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
  color: black;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* Reorder impact buttons: ++ + -- - (left to right) */
.impact-grid .impact-card:nth-child(1) { order: 3; }
.impact-grid .impact-card:nth-child(2) { order: 4; }
.impact-grid .impact-card:nth-child(3) { order: 2; }
.impact-grid .impact-card:nth-child(4) { order: 1; }

.impact-card {
  min-height: 140px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  transition:
    border-color var(--transition-normal),
    background var(--transition-normal),
    transform var(--transition-normal),
    box-shadow var(--transition-normal);
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

/* Color code impact cards BEFORE selection - Green for positive, Red for negative */
.impact-card:has(input[value="++"]),
.impact-card:has(input[value="+"]) {
  border-color: #00b84f;
  background: #e8f8f1;
}

.impact-card:has(input[value="-"]),
.impact-card:has(input[value="--"]) {
  border-color: #dc2626;
  background: #fef2f2;
}

.impact-symbol {
  display: block;
  margin-bottom: 8px;
  font-size: 36px;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.impact-card:hover .impact-symbol {
  transform: scale(1.1);
}

.impact-copy {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.capture-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* === SUMMARY & STATS === */
.summary-list {
  display: grid;
  gap: 14px;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-subtle);
}

.summary-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-row span {
  color: var(--text-secondary);
  font-size: 14px;
}

.summary-row strong {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.recent-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.recent-count {
  color: var(--muted);
  font-size: 13px;
}

.recent-events {
  display: grid;
  gap: 12px;
}

.recent-event {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.recent-event:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.recent-event-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.recent-event-item {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
}

.recent-event-impact {
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  color: var(--accent);
}

.recent-event-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.session-event-list {
  display: grid;
  gap: 12px;
}

.session-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.session-event-row:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
}

.session-event-cell {
  min-width: 0;
}

.session-event-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-event-value {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.session-event-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

/* === DASHBOARD STATS === */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-stat {
  padding: 12px 10px;
  text-align: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.dashboard-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.dashboard-stat .meta-label {
  margin-bottom: 4px;
  font-size: 10px;
}

.dashboard-stat strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(26, 200, 79, 0.2);
}

.dashboard-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* === CHARTS === */
.impact-chart,
.category-chart {
  display: grid;
  gap: 16px;
}

.impact-chart-row,
.category-chart-row {
  display: grid;
  grid-template-columns: 110px 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.category-axis--neg {
  color: #dc2626;
  text-align: right;
  font-weight: 700;
  font-size: 15px;
}

.category-axis--pos {
  color: var(--accent);
  text-align: left;
  font-weight: 700;
  font-size: 15px;
}

.category-axis--zero {
  justify-self: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.category-count--neg {
  color: #dc2626;
  text-align: right;
  font-weight: 700;
  font-size: 14px;
}

.category-count--pos {
  color: var(--accent);
  text-align: left;
  font-weight: 700;
  font-size: 14px;
}

.impact-chart-row span,
.category-chart-row span {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.3;
}

.impact-chart-row strong,
.category-chart-row strong {
  text-align: right;
  font-weight: 700;
}

.impact-chart-track {
  height: 20px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.impact-chart-half {
  width: 50%;
  height: 100%;
  display: flex;
}

.impact-chart-half--neg {
  justify-content: flex-end;
  border-right: 2px solid var(--line-strong);
}

.impact-chart-half--pos {
  justify-content: flex-start;
}

.impact-chart-bar {
  height: 100%;
  min-width: 0;
  transition: width var(--transition-slow);
}

.impact-chart-half--neg .impact-chart-bar {
  background: #dc2626;
}

.impact-chart-half--pos .impact-chart-bar {
  background: var(--accent);
}

.impact-symbol-label {
  font-family: monospace;
  font-size: 13px;
  margin-right: 4px;
}

/* Category list with totals and sorting (dashboard) */
.category-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.category-sort-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.category-sort-btn {
  font: inherit;
  font-size: 14px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.category-sort-btn:hover {
  border-color: var(--line-strong);
}

.category-sort-btn.is-active {
  border: 2px solid var(--accent);
  padding: 3px 11px;
  font-weight: 700;
}

.category-chart--totals .category-chart-row {
  grid-template-columns: 130px 90px 28px minmax(0, 1fr) 28px;
}

.category-chart-list {
  display: grid;
  gap: 16px;
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  padding: 4px 10px 4px 6px;
  margin: -4px -6px;
}

.category-chart--totals .category-chart-row span.category-total {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .category-chart--totals .category-chart-row {
    grid-template-columns: 90px 70px 22px minmax(0, 1fr) 22px;
    gap: 8px;
  }
}

/* Dashboard needle movers: name in bold with its description under it, like the round screen. */
.category-chart--totals .category-chart-row {
  grid-template-columns: 220px 90px 28px minmax(0, 1fr) 28px;
}

.category-chart-row .category-name strong {
  text-align: left;
  color: var(--text);
  font-size: 16px;
}

.category-chart-row .category-name small {
  font-size: 13px;
}

@media (max-width: 960px) {
  /* Phone: name and description get the full width, the count and bar sit on the line under them. */
  .category-chart--totals .category-chart-row {
    grid-template-columns: 70px 22px minmax(0, 1fr) 22px;
    row-gap: 4px;
  }

  .category-chart--totals .category-chart-row .category-name {
    grid-column: 1 / -1;
  }

  .category-chart--totals .category-chart-header > span:first-child {
    display: none;
  }
}

.category-chart-track {
  height: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.category-chart-bar {
  height: 100%;
  min-width: 0;
  background: var(--accent);
  transition: width var(--transition-slow);
}

/* === SESSIONS LIST === */
.recent-sessions-list {
  display: grid;
  gap: 0;
}

.recent-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-subtle);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

a.recent-session-row:hover {
  background: var(--accent-overlay);
  color: var(--accent);
}

.recent-session-row:last-child {
  border-bottom: none;
}

.recent-session-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-session-course {
  font-size: 13px;
  color: var(--text-secondary);
}

.recent-session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}

.session-type-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.session-type-pill--practice {
  background: #f3e8d8;
  color: #92652a;
}

.admin-stat-grid strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.admin-stat-grid-hero {
  align-self: center;
}

.admin-stat-grid-hero .meta-card {
  text-align: center;
}

/* === ADMIN & TABLES === */
.admin-table-wrap {
  overflow-x: auto;
}

.header-search {
  width: min(280px, 100%);
  margin-left: auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.header-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.header-search::placeholder {
  color: var(--muted);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-subtle);
  text-align: left;
  vertical-align: top;
}

.admin-table th:last-child,
.admin-table td:last-child {
  text-align: center;
}

.admin-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 15px;
  line-height: 1.4;
}

.admin-table tbody tr:hover {
  background: var(--surface-soft);
}

.inline-role-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 15px;
}

.table-sort-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color var(--transition-fast);
}

.table-sort-button:hover {
  color: var(--accent);
}

.muted-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* === IMPORT & ADMIN TOOLS === */
.bounds-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.state-import-row {
  max-width: 360px;
}

.state-import-row select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.state-import-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.import-result {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.import-tool-sections {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.import-tool-block {
  padding-top: 22px;
  border-top: 1px solid var(--line-subtle);
}

.import-tool-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.import-tool-header {
  margin-bottom: 14px;
}

.loading-message {
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.form-message-success {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.import-preview-wrap {
  margin-bottom: 22px;
}

.table-edit-input {
  width: 100%;
  min-width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.table-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-overlay);
}

.table-edit-input-small {
  min-width: 52px;
  max-width: 64px;
}

.state-column {
  width: 74px;
}

.permissions-message {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.job-elapsed {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.3;
}

.permissions-message-fade {
  animation: fade-permissions 2.6s ease forwards;
}

@keyframes fade-permissions {
  0% {
    opacity: 0;
  }

  12%,
  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* === JOURNAL === */
.journal-entry-list {
  display: grid;
  gap: 16px;
}

.journal-entry {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.journal-entry:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.journal-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.journal-entry time {
  color: var(--text-secondary);
  font-size: 13px;
}

.journal-entry p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.text-button:hover {
  color: #b91c1c;
}

.journal-entry-header .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
}

.is-hidden {
  display: none !important;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 980px) {
  .dashboard-hero,
  .capture-layout,
  .admin-stat-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .session-event-row {
    grid-template-columns: 1fr;
  }

  .impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-chart-row {
    grid-template-columns: 80px 22px minmax(0, 1fr) 22px;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .site-header .container,
  .panel-header,
  .setup-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header .container {
    min-height: auto;
    padding: 14px 0;
  }

  .site-main {
    padding: 24px 0 48px;
  }

  .auth-card {
    max-width: 100%;
  }

  .dashboard-hero,
  .app-panel {
    padding: 24px;
    border-radius: 20px;
  }

  .dashboard-hero h2,
  .app-panel h3 {
    font-size: 28px;
  }

  .choice-card,
  .impact-card {
    min-height: 0;
  }

  .session-type-grid,
  .course-search-row,
  .form-actions,
  .capture-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .btn,
  .icon-button {
    width: 100%;
  }

  .icon-button {
    min-width: 0;
    height: 44px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 16px, 1200px);
  }

  .dashboard-shell {
    gap: 20px;
  }

  .impact-grid {
    grid-template-columns: 1fr;
  }

  .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .summary-row strong {
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* styles.css */

/* === APP CONFIRM BOX (replaces the browser's confirm()) === */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(26, 24, 21, 0.45);
}

.app-dialog {
  width: 100%;
  max-width: 400px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-dialog-title {
  margin: 0 0 var(--space-sm);
  font-size: 20px;
  font-weight: 700;
}

.app-dialog-message {
  margin: 0 0 var(--space-lg);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* === ITEM STORY PAGE (item.php) and tappable Dashboard rows === */
a.category-chart-row {
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-xs);
  margin: -4px -6px;
  padding: 4px 6px;
  transition: background var(--transition-fast);
}

a.category-chart-row:hover,
a.category-chart-row:focus-visible {
  background: var(--accent-overlay);
}

a.category-chart-row span:first-child {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.item-net--pos { color: var(--accent-strong); }
.item-net--neg { color: var(--danger); }
.item-net--zero { color: var(--text-secondary); }

span.item-net {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.item-chart-note {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Note beside a card heading: no bottom margin, so it lines up with the heading's middle. */
.setup-header .item-chart-note {
  margin: 0;
}

.item-chart {
  display: block;
  width: 100%;
  height: auto;
}

.item-chart-zero {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.item-chart-round {
  stroke: var(--line-subtle);
  stroke-width: 1;
}

.item-chart-axis {
  fill: var(--muted);
  font-size: 12px;
}

.item-chart-line {
  stroke-width: 3;
  stroke-linecap: round;
}

.item-chart-line--pos { stroke: var(--accent); fill: var(--accent); }
.item-chart-line--neg { stroke: var(--danger); fill: var(--danger); }
.item-chart-line--zero { stroke: var(--line-strong); fill: var(--line-strong); }

.item-impacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.item-impact {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  min-width: 26px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
}

.item-impact--pos { background: var(--accent-soft); color: var(--accent-strong); }
.item-impact--neg { background: var(--danger-soft); color: var(--danger); }
.item-impact--zero { background: var(--surface-soft); color: var(--text-secondary); }

.dashboard-stat strong.item-net--pos { color: var(--accent-strong); }
.dashboard-stat strong.item-net--neg { color: var(--danger); }
.dashboard-stat strong.item-net--zero { color: var(--text-secondary); }

.item-chart--narrow { display: none; }

@media (max-width: 600px) {
  .item-chart--wide { display: none; }
  .item-chart--narrow { display: block; }
}

/* === PHONE FIT: keep every page inside the screen width === */
.dashboard-shell > *,
.dashboard-hero > *,
.setup-card {
  min-width: 0;
}

@media (max-width: 600px) {
  .admin-table {
    min-width: 0;
    table-layout: auto;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 6px;
    font-size: 13px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .admin-table th {
    font-size: 11px;
    letter-spacing: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  .admin-table td:last-child {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* === SETTINGS PAGE === */
.settings-form {
  display: grid;
  gap: var(--space-md);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: 18px 20px;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.setting-text {
  display: grid;
  gap: 4px;
}

.setting-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.setting-help {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 34px;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background var(--transition-normal);
  pointer-events: none;
}

.switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-normal);
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(26px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--accent-overlay);
  outline-offset: 2px;
}

/* === DARK MODE: spots that use fixed light colors === */
html.dark body {
  background: linear-gradient(135deg, #151915 0%, #121513 50%, #0f120f 100%);
}

html.dark .choice-card:has(input:checked) {
  border-color: #ff9d2e;
  background: rgba(255, 140, 0, 0.14);
}

html.dark .btn-danger:hover {
  background: rgba(240, 82, 82, 0.26);
  border-color: #f87171;
}

html.dark .item-option {
  background: var(--surface-strong);
}

html.dark .item-option span {
  color: var(--text);
}

html.dark .impact-card:has(input[value="++"]),
html.dark .impact-card:has(input[value="+"]) {
  border-color: #1fae54;
  background: rgba(42, 224, 99, 0.1);
}

html.dark .impact-card:has(input[value="-"]),
html.dark .impact-card:has(input[value="--"]) {
  border-color: #d94545;
  background: rgba(240, 82, 82, 0.1);
}

html.dark .category-axis--neg,
html.dark .category-count--neg {
  color: #f05252;
}

html.dark .impact-chart-half--neg .impact-chart-bar {
  background: #e04848;
}

html.dark .session-type-pill {
  color: var(--accent-bright);
}

html.dark .session-type-pill--practice {
  background: rgba(214, 158, 80, 0.16);
  color: #e0b27a;
}

html.dark .text-button:hover {
  color: #f87171;
}

/* Recent sessions on a phone: course on top, then type, date and events on one line under it. */
@media (max-width: 768px) {
  .recent-session-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .recent-session-main {
    min-width: 0;
  }

  .recent-session-meta {
    flex-wrap: wrap;
    flex-shrink: 1;
  }
}

/* Log In: "Keep me logged in" checkbox */
.auth-keep {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.auth-keep input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* === SETTINGS: NEEDLE MOVERS === */
.nm-intro {
  margin: 0 0 var(--space-md);
}

.nm-list {
  display: grid;
  gap: 10px;
}

.nm-row {
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
}

.nm-row.is-off .nm-text {
  opacity: 0.55;
}

.nm-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nm-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nm-text .setting-name {
  font-size: 16px;
}

.nm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.nm-actions form {
  margin: 0;
}

.nm-added {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 6px;
}

.nm-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.nm-add-form {
  display: grid;
  gap: 10px;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}

.nm-add-form h5 {
  margin: 0;
  font-size: 16px;
}

#starter-list .form-row {
  margin-bottom: var(--space-md);
}

.nm-row .form-row {
  margin-bottom: 0;
}

.nm-row.is-hidden,
.nm-list .is-hidden,
.nm-edit-form.is-hidden {
  display: none;
}

@media (max-width: 560px) {
  .nm-row {
    padding: 12px;
  }
  .nm-main {
    align-items: flex-start;
  }
}

.nm-actions .icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
}

.nm-actions .btn {
  width: auto;
}

.nm-actions .switch {
  display: block;
}

/* Starter list on a phone (Robert, Dec 5 2026): the pencil, red X and Add buttons go on their own line under the name, so Add is never cut off */
@media (max-width: 560px) {
  #starter-list .nm-main {
    flex-wrap: wrap;
    gap: 10px;
  }
  #starter-list .nm-text {
    flex: 1 1 100%;
  }
  #starter-list .nm-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}

#starter-list [data-nm-search-list] {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.app-dialog-actions--stack {
  flex-wrap: wrap;
}

/* === TEXT MESSAGE LOGIN === */
.auth-card .form-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.auth-card .form-message-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.auth-card .form-message-success {
  background: var(--accent-overlay);
}

.auth-help {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent);
}

.phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
}

.phone-row input {
  flex: 1 1 200px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

.phone-row .setting-help {
  flex-basis: 100%;
}

.setting-error {
  color: var(--danger);
}

.auth-small-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}

.auth-form [hidden] {
  display: none !important;
}

/* Settings > Account: email and whether it is confirmed */
.account-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 18px 20px;
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
}

.account-email .setting-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-email form {
  margin: 0;
}

/* === ROUND SCREEN: one-tap impact pop-up === */
.nm-pick {
  display: grid;
  gap: 2px;
}

.nm-pick strong {
  font-size: 17px;
}

.nm-pick small {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.impact-pop {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(26, 24, 21, 0.4);
}

.impact-pop.is-hidden {
  display: none;
}

.impact-pop-card {
  width: 100%;
  max-width: 340px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.impact-pop-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-bottom: 14px;
}

.impact-pop-head strong {
  font-size: 18px;
  text-align: center;
}

.impact-pop-head .impact-pop-close {
  position: absolute;
  right: 0;
  top: 0;
}

.impact-pop-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.impact-pop-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.impact-sq {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  border: 2px solid;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.impact-sq--pos2,
.impact-sq--pos1 {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.impact-sq--neg1,
.impact-sq--neg2 {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.impact-sq:active {
  transform: scale(0.95);
}

.item-option .nm-pick strong,
.item-option .nm-pick small {
  display: block;
}

.item-option:has(input:checked) .nm-pick small {
  color: rgba(255, 255, 255, 0.85);
}

/* Starter list: the signs that guide interview suggestions (master admin only). */
.nm-signs {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === INTERVIEW (first login, or Settings > Retake) === */
.iv-main { padding: 18px 0 40px; }
.iv { max-width: 560px; margin: 0 auto; padding: 8px 16px; }
.iv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 26px 22px; }
.iv-count { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.iv-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 24px; }
.iv-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.iv-title { font-size: 28px; margin: 0 0 14px; text-align: center; }
.iv-q { font-size: 23px; line-height: 1.3; font-weight: 700; margin: 0 0 16px; text-align: center; }
.iv-note, .iv-why p { font-size: 17px; line-height: 1.55; margin: 0 0 14px; }
.iv-why ul { font-size: 17px; line-height: 1.5; margin: 0 0 14px; padding-left: 22px; }
.iv-why li { margin-bottom: 4px; }
.iv-list { font-size: 18px; line-height: 1.5; margin: 0 0 14px; padding-left: 24px; font-weight: 600; }
.iv-list li { margin-bottom: 4px; }
.iv-sub { font-size: 16px; color: var(--text-secondary); text-align: center; margin: 0 0 16px; line-height: 1.45; }
.iv-sub-left { text-align: left; }
.iv-answer { display: block; box-sizing: border-box; width: 100%; min-height: 220px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); font: inherit; font-size: 17px; line-height: 1.5; resize: vertical; color: inherit; }
.iv-answer:focus { outline: none; border-color: var(--accent); }
.iv-nav { display: flex; gap: 12px; margin-top: 22px; }
.iv-nav .btn { flex: 1; }
.iv-nav .btn-ghost { flex: 0 0 32%; }
.iv-wait { text-align: center; padding: 26px 0 8px; color: var(--text-secondary); font-size: 16px; line-height: 1.5; }
.iv-spinner { width: 42px; height: 42px; margin: 0 auto 16px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: iv-spin 0.9s linear infinite; }
@keyframes iv-spin { to { transform: rotate(360deg); } }
.iv-error p { font-size: 16px; line-height: 1.5; margin: 0; }
.iv-group { font-size: 19px; margin: 18px 0 4px; }
.iv-group--pos { color: var(--accent); }
.iv-group--neg { color: #c0392b; }
.iv-group-sub { font-size: 14px; color: var(--text-secondary); margin: 0 0 10px; }
.iv-sg-list { display: grid; gap: 10px; }
.iv-sg { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface-soft); border: 2px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.iv-sg.is-on { border-color: var(--accent); }
.iv-sg input[type=checkbox] { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.iv-sg-text { flex: 1; min-width: 0; display: block; }
.iv-sg-text strong, .iv-sg-text small, .iv-sg-text em { display: block; }
.iv-sg-text strong { font-size: 17px; }
.iv-sg-text small { font-size: 14px; color: var(--text-secondary); }
.iv-sg-text em { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.iv-sg-text input[type=text] { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 2px solid var(--accent); border-radius: var(--radius-xs); font: inherit; font-size: 16px; margin-bottom: 6px; background: var(--surface); color: inherit; }
.iv-sg .icon-button { width: 40px; min-width: 40px; height: 40px; flex: 0 0 auto; }
.iv .is-hidden, .iv.is-hidden { display: none; }
.nm-retake { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.nm-retake .setting-help { margin: 0; flex: 1 1 200px; }
.iv-quote-group { display: grid; gap: 8px; margin-bottom: 16px; }
.iv-quote { margin: 4px 0 0; font-size: 16px; line-height: 1.45; font-style: italic; color: var(--text-primary, inherit); padding-left: 12px; border-left: 3px solid var(--line); }
.iv-own { margin: 6px 0 18px; }
.iv-own .iv-sg-list:not(:empty) { margin-bottom: 12px; }
.iv-own .form-row { margin-bottom: 10px; }
.iv-own .form-row input { width: 100%; box-sizing: border-box; }

/* === ADMIN > USERS: add, edit, delete === */
.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;
}
.admin-table td.user-actions { white-space: nowrap; }
.user-actions form { display: inline-block; margin: 0 0 0 6px; }
.user-dialog { max-width: 440px; }
.user-dialog .form-row { margin-bottom: var(--space-sm); }
.user-dialog .setting-help { margin: var(--space-xs) 0 var(--space-md); }
.user-admin-check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; margin-top: var(--space-xs); }
.users-flash { margin: 0 0 var(--space-md); color: var(--accent); font-weight: 600; }
.users-error { margin: 0 0 var(--space-md); color: var(--danger); font-weight: 600; }

/* Phone: each user is a small card (name, email, cell, created on the left; Admin box, pencil and red X on the right). */
@media (max-width: 600px) {
  #admin-users-table thead { display: none; }
  #admin-users-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto auto;
    column-gap: 10px;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line-subtle);
  }
  #admin-users-table td { border: 0; padding: 1px 0; grid-column: 1; text-align: left; overflow-wrap: anywhere; }
  #admin-users-table td.u-name { font-weight: 700; font-size: 15px; }
  #admin-users-table td.u-cell:empty { display: none; }
  #admin-users-table td.u-admin { grid-column: 2; grid-row: 1 / span 4; }
  #admin-users-table td.u-admin::before { content: 'Admin'; display: block; font-size: 11px; color: var(--muted); text-align: center; }
  #admin-users-table td.user-actions { grid-column: 3; grid-row: 1 / span 4; display: flex; flex-direction: column; gap: 6px; }
  .user-actions form { margin: 0; }
  #admin-users-table .user-actions .icon-button { width: 38px; min-width: 38px; height: 38px; flex: 0 0 auto; }
  #admin-users-table td.user-actions { min-width: 38px; padding-right: 2px; }
}

/* Dashboard needle movers: "Tracked" heading over the counts, and a line between rows. */
.category-chart--totals .category-chart-header span.category-total-head {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.category-chart--totals .category-chart-row span.category-total {
  text-align: center;
}

.category-chart--totals .category-chart-list {
  gap: 0;
}

.category-chart--totals .category-chart-list > .category-chart-row {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  border-radius: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text-secondary) 45%, transparent);
}

.category-chart--totals .category-chart-list > .category-chart-row:last-child {
  border-bottom: 0;
}

/* Per-row "Tracked" word and − 0 + line: phone only. */
.category-chart-row .category-total-word,
.category-chart-row .category-row-axis {
  display: none;
}

@media (max-width: 960px) {
  /* Phone: name with "Tracked N" to its right, description under it, then − 0 + over each bar. */
  .category-chart--totals .category-chart-header {
    display: none;
  }

  .category-chart--totals .category-chart-row {
    position: relative;
    grid-template-columns: 22px minmax(0, 1fr) 22px;
    grid-template-areas:
      "name name name"
      ". axis ."
      "neg bar pos";
    row-gap: 4px;
  }

  .category-chart--totals .category-chart-row .category-name {
    grid-area: name;
  }

  .category-chart--totals .category-chart-row .category-name strong {
    padding-right: 96px;
  }

  /* Each needle mover is its own card. */
  .category-chart--totals .category-chart-list {
    gap: 12px;
  }

  .category-chart--totals .category-chart-list > .category-chart-row,
  .category-chart--totals .category-chart-list > .category-chart-row:last-child {
    margin: 0;
    padding: 14px 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  .category-chart--totals .category-chart-row span.category-total {
    position: absolute;
    top: 14px;
    right: 14px;
    text-align: right;
  }

  .category-chart--totals .category-chart-row .category-total-word {
    display: inline;
    font-style: normal;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .category-chart--totals .category-chart-row .category-row-axis {
    grid-area: axis;
    margin-top: 4px;
  }

  .category-chart--totals .category-chart-row .category-row-axis i {
    font-style: normal;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
  }

  .category-chart--totals .category-chart-row .category-row-axis i:first-child { color: #dc2626; }
  .category-chart--totals .category-chart-row .category-row-axis i:last-child { color: #16a34a; }

  .category-chart--totals .category-chart-row .category-count--neg { grid-area: neg; }
  .category-chart--totals .category-chart-row .impact-chart-track { grid-area: bar; }
  .category-chart--totals .category-chart-row .category-count--pos { grid-area: pos; }
}

/* Round pop-up: optional note above ++ + - -- (saved on the moment and as a key). */
.impact-pop-note-label {
  display: block;
  margin: 0 0 4px 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.impact-pop-note::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.impact-pop-note {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  margin: 0 0 12px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
}

.impact-pop-note:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.round-event-line-note {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
}

/* Keys for the round: tap the box for the full list of keys, type to narrow it. */
.key-picker {
  position: relative;
}

.key-picker-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.key-picker-list.is-hidden {
  display: none;
}

.key-picker-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-subtle);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.key-picker-option:last-child {
  border-bottom: 0;
}

.key-picker-option:hover,
.key-picker-option.is-active {
  background: var(--accent-soft);
}

.key-picker-option small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.key-picker-option mark {
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
}

.key-picker-empty {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
}

/* Round Event Entry: search box right under the Keys for the round card. */
.round-nm-search {
  position: relative;
  margin-bottom: 18px;
}

.round-nm-search input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 48px 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}

.round-nm-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-overlay);
}

.round-nm-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.round-nm-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.round-nm-search-clear.is-hidden,
.item-option.is-hidden {
  display: none;
}

/* Round Event Entry: needle movers under section names (Mental, Mechanics, Emotional, Strategic). */
.nm-section-head {
  margin: 18px 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nm-section-head:first-of-type {
  margin-top: 4px;
}

.nm-section-head.is-hidden,
.round-entry-block .item-list.is-hidden,
.nm-sections.is-hidden {
  display: none;
}

.nm-sections {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Round screen cards: compact top to bottom on a phone, name and description on one line. */
.round-entry-block .item-list {
  gap: 6px;
}

.round-entry-block .item-option {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.round-entry-block .item-option .nm-pick {
  display: block;
  line-height: 1.3;
}

.round-entry-block .item-option .nm-pick strong {
  display: inline;
  font-size: 15px;
}

.round-entry-block .item-option .nm-pick small {
  display: inline;
  margin-left: 6px;
  font-size: 13px;
}

.round-entry-block .item-option .nm-sections {
  font-size: 12px;
}

.round-entry-block .item-option:has(input:checked) {
  transform: none;
}

/* Session page: thin and small (Robert, Dec 4 2026). Header is plain text, no box; round screen tight top to bottom. */
.site-main:has(.session-shell) {
  padding-top: 12px;
}

.dashboard-shell.session-shell {
  gap: 10px;
}

.dashboard-hero.session-head {
  display: block;
  padding: 0 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-hero.session-head .eyebrow {
  margin: 0;
  font-size: 10px;
}

.dashboard-hero.session-head h2.page-title-small {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.app-panel.round-capture-panel {
  padding: 12px;
  border-radius: var(--radius-lg);
}

.round-capture-panel .round-intention-strip {
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.round-capture-panel .round-intention-strip span {
  margin-bottom: 2px;
  font-size: 10px;
}

.round-capture-panel .round-intention-strip strong {
  font-size: 14px;
  line-height: 1.3;
}

.round-capture-panel .round-nm-search {
  margin-bottom: 4px;
}

.round-capture-panel .round-nm-search input {
  min-height: 0;
  height: 38px;
  padding: 6px 40px 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.round-capture-panel .round-nm-search-clear {
  width: 32px;
  height: 32px;
}

.round-capture-panel .round-capture-stack {
  gap: 10px;
}

.round-capture-panel .nm-section-head {
  margin: 10px 0 4px;
  font-size: 11px;
}

.round-capture-panel .round-entry-block .nm-section-head:first-child {
  margin-top: 2px;
}

.round-capture-panel .item-option {
  padding: 6px 12px;
}

/* Round screen: frozen down to the bottom of the search bar; only the needle mover cards scroll. */
.session-shell:has(.round-capture-panel:not(.is-hidden)) .session-head {
  position: sticky;
  top: var(--session-head-top, 0px);
  z-index: 15;
  margin: -12px -16px 0;
  padding: 8px 20px 10px;
  background: var(--bg, var(--surface-soft));
}

.round-frozen {
  position: sticky;
  top: var(--round-frozen-top, 0px);
  z-index: 10;
  margin: -12px -12px 0;
  padding: 12px 12px 8px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line-subtle);
}

/* End Session: small, far right of the Round Event Entry line, only while a round is open. */
.dashboard-hero.session-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-head .session-head-end {
  display: none;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 5px 12px;
  font-size: 13px;
}

.session-shell:has(.round-capture-panel:not(.is-hidden)) .session-head .session-head-end {
  display: inline-flex;
}

/* Save Event is clicked by the pop-up, never shown; End Session moved to the header. */
.round-capture-panel .round-capture-actions {
  display: none;
}

/* Search/add needle mover: the short description box for a new one. */
.round-nm-add {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.round-nm-add.is-hidden {
  display: none;
}

.round-nm-add-title {
  margin: 0 0 6px;
  font-size: 14px;
}

.round-nm-add-label {
  display: block;
  margin: 0 0 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.round-nm-add-row {
  display: flex;
  gap: 8px;
}

.round-nm-add-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 16px;
}

.round-nm-add-row .btn {
  flex: 0 0 auto;
  width: auto;
}

/* Phone: less space between "Your Golf Patterns" and the links under it. */
@media (max-width: 768px) {
  .site-header .container {
    gap: 2px;
    padding: 8px 0;
  }
}

/* Dashboard needle movers: − at the bar's left edge, 0 centered on the middle line, + at its right edge.
   The heading row sits inside the scrolling list (stuck to the top) so it lines up with the bars. */
.category-header-axis {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

@media (max-width: 960px) {
  .category-chart--totals .category-chart-row .category-row-axis {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
}

.category-header-axis i,
.category-row-axis i {
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.category-header-axis i { font-size: 15px; }
.category-header-axis i:nth-child(1),
.category-row-axis i:nth-child(1) { justify-self: start; color: #dc2626; }
.category-header-axis i:nth-child(2),
.category-row-axis i:nth-child(2) { justify-self: center; color: var(--text); }
.category-header-axis i:nth-child(3),
.category-row-axis i:nth-child(3) { justify-self: end; color: #16a34a; }

.category-chart--totals .category-chart-list > .category-chart-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  margin: 0 -6px;
  padding: 0 6px 10px;
}

@media (max-width: 960px) {
  .category-chart--totals .category-chart-list > .category-chart-header {
    display: none;
  }
}

/* Needle mover cards: one tap opens the pop-up on iPhone (no double-tap zoom delay, no grey flash). */
[data-round-nm-row] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Round entry is for the course: the site header (title, links, Log out) hides while a round is open.
   End Session is the only way out (Robert, Dec 4 2026). */
body:has(.round-capture-panel:not(.is-hidden)) .site-header,
body:has(.round-capture-panel:not(.is-hidden)) .site-footer {
  display: none;
}

/* Round entry: no gap between "Round Event Entry" and the box below it (Robert, Dec 4 2026). */
.site-main:has(.round-capture-panel:not(.is-hidden)) {
  padding-top: 0;
}
.session-shell:has(.round-capture-panel:not(.is-hidden)) {
  row-gap: 0;
}
.session-shell:has(.round-capture-panel:not(.is-hidden)) .session-head {
  margin-top: 0;
  padding: 6px 20px 4px;
}
.round-capture-panel:not(.is-hidden) {
  padding-top: 8px;
}

/* === PHONE HAMBURGER MENU ===
   Phone: one slim row at the very top, "Your Golf Patterns" on the left, the menu icon on the right.
   Tapping the icon opens the menu in that same upper-right corner, only as wide as its widest item,
   with the icon drawn thin across the top of the menu. Tapping the icon again closes it.
   Computer layout is unchanged. */
.nav-toggle {
  display: none;
}

@media (max-width: 768px) {
  .site-header .container {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 6px 0;
    gap: var(--space-md, 12px);
  }

  .site-title {
    font-size: 20px;
  }

  .site-logo {
    width: 28px;
    height: 28px;
  }

  .site-title a {
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 9px 8px;
    margin-right: -8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-toggle span {
    display: block;
    height: 2.5px;
    width: 100%;
    border-radius: 2px;
    background: currentColor;
  }

  .site-nav {
    display: none;
  }

  .site-header.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    position: absolute;
    top: 4px;
    right: 0;
    width: max-content;
    padding: 4px 0 6px;
    background: var(--surface);
    border: 1px solid var(--line-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
  }

  /* The icon inside the open menu: thin lines across the top. */
  .site-nav .nav-toggle {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 10px 14px;
    gap: 5px;
  }

  .site-nav .nav-toggle span {
    height: 1.5px;
  }

  .site-header.nav-open .site-nav a {
    padding: 10px 14px;
    font-size: 17px;
    white-space: nowrap;
    color: var(--text);
  }

  .site-header.nav-open .site-nav a.is-current {
    color: var(--accent);
    font-weight: 700;
  }
}

/* === PULL DOWN TO REFRESH (phone) === */
/* The phone's own pull-to-refresh is switched off; the app's needs a pull of half the screen. */
html,
body {
  overscroll-behavior-y: none;
}

.ptr {
  position: fixed;
  top: -48px;
  left: 50%;
  z-index: 1100;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 0);
  pointer-events: none;
}

.ptr-arrow {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.ptr.is-ready {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ptr.is-returning {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.ptr.is-loading {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transition: transform 0.2s ease;
}

.ptr.is-loading .ptr-arrow {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  font-size: 0;
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* Date boxes: on iPhone a date box ignored its card's width and stuck out past the right edge (Robert, Dec 4 2026). */
input[type="date"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

/* Round closing: needle movers suggested from the three closing notes (round closing thread, Dec 4 2026). */
.close-suggest { margin-top: 18px; }
.close-dialog { max-width: 520px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.close-dialog-body { overflow-y: auto; min-height: 0; margin: 0 calc(-1 * var(--space-lg)); padding: 0 var(--space-lg); }
.close-dialog-body .app-dialog-message { margin-bottom: var(--space-sm); }
.close-dialog-body .iv-sg-list, .close-dialog-body .iv-quote-group { margin-bottom: var(--space-md); }
.close-dialog-body .iv-sg-list + .app-dialog-title, .close-dialog-body .iv-quote-group + .app-dialog-title { margin-top: var(--space-md); }
.close-dialog .app-dialog-actions { padding-top: var(--space-md); }

/* Practice screen (practice logic thread, Dec 5 2026): where you practice, then plans for your worst needle movers. */
.practice-motto { margin: 0 0 var(--space-md); font-size: 1.15rem; font-weight: 800; color: var(--accent-strong); }
.practice-where { border: 0; margin: 0; padding: 0; }
.practice-where legend { font-weight: 700; margin-bottom: var(--space-sm); padding: 0; }
.practice-where-options { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.practice-where-option { display: inline-flex; align-items: center; gap: var(--space-sm); padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 700; }
.practice-where-option input { accent-color: var(--accent-strong); width: 18px; height: 18px; margin: 0; }
.practice-where-option:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-soft); color: var(--text); }
.practice-body .capture-block + .capture-block { margin-top: var(--space-md); }
.practice-sub { margin: 0 0 var(--space-md); color: var(--text-secondary); font-size: 0.92rem; }
.practice-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); padding: var(--space-md); margin-top: var(--space-md); }
.practice-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-sm); }
.practice-card-name { display: block; font-size: 1.05rem; }
.practice-card-desc { color: var(--text-secondary); font-size: 0.9rem; }
.practice-card-head .practice-card-desc { display: block; }
.practice-net { flex: none; font-weight: 800; color: var(--neg-text); background: var(--danger-soft); border-radius: 999px; padding: 2px 10px; font-size: 0.9rem; }
.practice-why, .practice-progress { margin: var(--space-sm) 0; font-size: 0.95rem; }
.practice-plan-head { margin: var(--space-md) 0 var(--space-xs); }
.practice-own { display: inline-block; margin-left: var(--space-xs); padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.78rem; font-weight: 800; }
.practice-steps { margin: 0; padding-left: 1.4em; }
.practice-steps li { margin: 6px 0; line-height: 1.45; }
.practice-steps a, .practice-steps a:visited { color: var(--info); text-decoration: underline; }
.practice-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); }
.practice-card-tools { margin-left: auto; display: inline-flex; gap: var(--space-xs); }
.practice-add-link { display: inline-block; margin-top: var(--space-sm); padding: 0; border: 0; background: none; color: var(--accent-strong); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.practice-editor { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--line); }
.practice-editor h5 { margin: 0 0 var(--space-sm); font-size: 1rem; }
.practice-working { border: 2px solid var(--accent-strong); }
.practice-working h4 { margin: 0 0 var(--space-sm); }
.practice-working-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.practice-search-results { display: flex; flex-direction: column; margin-top: var(--space-xs); }
.practice-search-option { text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-subtle); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.practice-search-option:hover { background: var(--accent-overlay); }
.practice-key-list { display: flex; flex-direction: column; }
.practice-key-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 8px 0; border-bottom: 1px solid var(--line-subtle); }
.practice-key-row:last-child { border-bottom: 0; }
.practice-coach-line { font-weight: 700; margin: 0 0 var(--space-sm); }
.practice-coach-list { margin: 0 0 var(--space-md); padding-left: 1.4em; }
.practice-coach-list li { margin: 8px 0; }
.practice-session-table-wrap { overflow-x: auto; }
.practice-card-actions .btn, .practice-working-actions .btn, .practice-key-row .btn { width: auto; flex: 0 0 auto; min-height: 44px; padding: 0 18px; }
.practice-card-tools .icon-button { width: 40px; min-width: 40px; height: 40px; flex: 0 0 40px; }
