/* 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 {
  color: var(--text);
  transition: color var(--transition-fast);
}

.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 {
  max-width: 980px;
  margin-inline: auto;
}

.round-intention-strip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0 2px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.35;
}

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

.round-intention-strip strong {
  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: 0 10px 0 6px;
  margin: 0 -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;
  }
}

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

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