/* Executive-playful visual system: deep navy, restrained violet and cool blue. */
:root {
  --primary: #5B46C4;
  --soft: #8B7BE0;
  --light: #EEEBFF;
  --navy: #17213A;
  --slate: #46536E;
  --grayblue: #7B87A2;
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --text: #18213A;
  --muted: #64708A;
  --border: #DDE3EF;
  --success: #167D6A;
  --success-bg: #E4F5F1;
  --danger: #C9445C;
  --danger-bg: #FCECEF;
  --c1: #5B46C4;
  --c2: #3F6FB6;
  --c3: #258A98;
  --c4: #9A6C28;
  --c5: #7356A8;
  --c6: #3768A5;
  --c7: #287866;
  --c8: #6652B7;
  --radius: 15px;
  --radius-sm: 10px;
  --shadow-sm: 0 7px 20px rgba(23, 33, 58, 0.07);
  --shadow-md: 0 16px 38px rgba(23, 33, 58, 0.11);
}

[data-theme="dark"] {
  --bg: #101628;
  --surface: #18223A;
  --text: #F1F3FA;
  --muted: #A8B2CA;
  --border: #2B3856;
  --navy: #0B1120;
  --light: #29254D;
  --slate: #C4CBE0;
  --grayblue: #98A4BF;
  --success-bg: #153A35;
  --danger-bg: #40232D;
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.28);
}

body {
  background:
    radial-gradient(circle at 12% -10%, rgba(91, 70, 196, 0.09), transparent 30%),
    radial-gradient(circle at 95% 8%, rgba(63, 111, 182, 0.08), transparent 28%),
    var(--bg);
}

#topbar {
  background: linear-gradient(120deg, #131D35, #202C4A 62%, #2D3162);
  box-shadow: 0 6px 18px rgba(16, 25, 48, 0.2);
}

[data-theme="dark"] #topbar {
  background: linear-gradient(120deg, #090F1E, #17213A 65%, #27264D);
}

#topbar-title {
  font-weight: 700;
  letter-spacing: 0.015em;
}

#app { padding-top: 1.25rem; }

#home-greeting {
  margin-bottom: 1.1rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(91, 70, 196, 0.13);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(239,242,252,0.88));
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] #home-greeting {
  background: linear-gradient(135deg, rgba(31,43,70,0.96), rgba(25,34,58,0.94));
}

.eyebrow { color: #5B46C4; letter-spacing: 0.1em; }

.mini-stat,
.nav-card,
.qcard,
.passage,
.dataset,
.chart-block,
.dash-card,
.coach-box,
.flashcard,
.elog-row,
.panel {
  box-shadow: var(--shadow-sm);
}

.nav-grid { gap: 12px; }

.nav-card {
  min-height: 82px;
  border-left-width: 4px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.primary-card {
  min-height: 94px;
  background: linear-gradient(120deg, #4937A5, #5B46C4 48%, #356CA8);
  box-shadow: 0 14px 30px rgba(72, 58, 164, 0.25);
}

.primary-card .nc-title { font-size: 18px; }

.btn-primary {
  background: linear-gradient(105deg, #513DB3, #5B46C4 58%, #4269AC);
  box-shadow: 0 8px 18px rgba(74, 59, 171, 0.2);
}

.btn-primary:hover { filter: brightness(1.04); }

.btn-secondary {
  background: color-mix(in srgb, var(--surface) 94%, var(--primary));
}

.qtype-label,
.fb-tag,
.freq-pill {
  letter-spacing: 0.07em;
}

.qprompt { line-height: 1.62; }

.choice {
  line-height: 1.45;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--soft);
  transform: translateX(2px);
}

.field-note {
  margin: -5px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.practice-count {
  padding: 12px 12px 2px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, var(--primary));
}

.sync-panel {
  margin: 1.35rem 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--primary)), var(--surface));
  box-shadow: var(--shadow-sm);
}

.sync-panel label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.sync-heading,
.sync-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sync-heading h3 { margin: 1px 0 0; color: var(--text); font-size: 16px; }

.sync-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sync-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #258A98;
  box-shadow: 0 0 0 5px rgba(37, 138, 152, 0.12);
}

.sync-actions > button { flex: 1; }

.sync-link {
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sync-status {
  min-height: 19px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.sync-status.success { color: var(--success); }
.sync-status.error { color: var(--danger); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--soft) 75%, white);
  outline-offset: 3px;
}

button, select, input, textarea { touch-action: manipulation; }

#practice-loading::before,
#import-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 9px;
  vertical-align: -3px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: gmat-spin 0.8s linear infinite;
}

.choice:focus-visible,
.nav-card:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

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

@media (max-width: 430px) {
  .sync-actions { flex-direction: column; }
  .sync-actions > button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
