/**
 * theme.css — shared brand theme (index.html uses landing.css for marketing layout)
 * Use on app pages: dashboard, leaderboard, myplan, etc.
 */

:root {
  --app-tab-bar-height: 56px;
  --teal: #008080;
  --teal-dark: #006666;
  --teal-deep: #004d4d;
  --teal-light: #e0f7f7;
  --accent: #00c6c6;
  --accent-warm: #e07a5f;
  --accent-written: #3d8b8b;
  --text-dark: #002b2b;
  --text-mid: #1a4d4d;
  --text-light: #6b9999;
  --white: #ffffff;
  --bg: #f4fafa;
  --border: #cde8e8;
  --shadow-card: 0 2px 14px rgba(0, 128, 128, 0.08);
  --danger: #c62828;
  --success: #2e7d32;
}

html {
  scroll-behavior: smooth;
}

body.app-body {
  margin: 0;
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  overflow-x: hidden;
  min-height: 100vh;
}

body.app-body *,
body.app-body *::before,
body.app-body *::after {
  box-sizing: border-box;
}

body.app-body ::-webkit-scrollbar {
  width: 6px;
}
body.app-body ::-webkit-scrollbar-track {
  background: var(--teal-light);
}
body.app-body ::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 3px;
}

/* ── Header (matches index.html) ─────────────────────── */

body.app-body > header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(0, 128, 128, 0.97);
  backdrop-filter: blur(12px);
  padding: 0 clamp(20px, 4vw, 48px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 24px rgba(0, 64, 64, 0.18);
}

body.app-body .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
body.app-body .logo img {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}
body.app-body .logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05em;
  color: white;
  line-height: 1.2;
}
body.app-body .logo-text span {
  display: block;
  font-size: 0.58em;
  font-family: 'Sora', sans-serif;
  font-weight: 300;
  opacity: 0.78;
}

body.app-body > header nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
body.app-body > header nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.78em;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
body.app-body > header nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}
body.app-body > header nav a.nav-active {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}
body.app-body > header nav a i {
  font-size: 16px;
  opacity: 0.85;
}
body.app-body .hamburger {
  display: none;
  cursor: pointer;
}
body.app-body .hamburger i {
  color: white;
  font-size: 26px;
}
body.app-body > header nav .close-btn {
  display: none;
}
body.app-body > header nav.active .close-btn {
  display: block;
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
}
body.app-body .close-btn i {
  color: white;
  font-size: 26px;
}

@media (max-width: 1100px) {
  body.app-body > header nav a {
    font-size: 0.72em;
    padding: 6px 8px;
  }
}

@media (max-width: 768px) {
  body.app-body .hamburger {
    display: block;
  }
  body.app-body > header nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--teal-deep);
    z-index: 1000;
  }
  body.app-body > header nav.active {
    display: block;
  }
  body.app-body > header nav ul {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 8px;
  }
  body.app-body > header nav a {
    font-size: 1.05em;
    padding: 12px 20px;
  }
}

/* ── Layout ──────────────────────────────────────────── */

.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem clamp(20px, 4vw, 48px) 3.5rem;
}

.app-section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  font-size: 0.77em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.app-section-label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
}

.app-page-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 8px;
}
.app-page-title em {
  font-style: italic;
  color: var(--teal);
}

.app-page-sub {
  font-size: 0.95em;
  color: var(--text-mid);
  font-weight: 300;
  line-height: 1.65;
  max-width: 640px;
}

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.88em;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.22s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn i {
  font-size: 17px;
}
.btn-primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 4px 18px rgba(0, 128, 128, 0.35);
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border: 1.5px solid var(--teal);
}
.btn-outline:hover {
  background: var(--teal-light);
  transform: translateY(-2px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Small button variant */
.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* ── Cards ───────────────────────────────────────────── */

.app-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-card);
}
.app-card h2,
.app-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.app-card h2 a,
.app-card h3 a {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
}
.app-card h2 a:hover,
.app-card h3 a:hover {
  color: var(--teal);
}

.guest-banner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}
.guest-banner h2 {
  font-size: 1.05rem;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.guest-banner p {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* ── Dashboard hub grid (wireframe) ──────────────────── */

.dash-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .dash-hub-grid {
    grid-template-columns: 1fr;
  }
}

.dash-hub-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.dash-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}
.dash-hub-card--written::before {
  background: linear-gradient(90deg, #4a90a4, var(--accent-written));
}
.dash-hub-card--oral::before {
  background: linear-gradient(90deg, var(--accent-warm), #f4a261);
}

.dash-hub-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--teal-light);
  color: var(--teal-dark);
  margin-bottom: 10px;
}
.dash-hub-card--oral .dash-hub-badge {
  background: #fde8e0;
  color: #c45c3e;
}

.dash-hub-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.dash-hub-desc {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: 14px;
}

.dash-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.dash-link-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.dash-link-tile:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(0, 128, 128, 0.1);
  transform: translateY(-2px);
}
.dash-link-tile span {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-light);
}

.dash-part-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.dash-part-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--teal-light);
  color: var(--teal-dark);
}
.dash-part-tag.b {
  background: #fff3e0;
  color: #bf360c;
}
.dash-part-tag.c {
  background: #fce4ec;
  color: #880e4f;
}

/* Progress */
.d-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--teal-light);
  overflow: hidden;
}
.d-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  transition: width 0.4s ease;
}
.d-progress-row {
  margin-bottom: 10px;
}
.d-progress-row:last-child {
  margin-bottom: 0;
}
.d-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.d-progress-label span:last-child {
  color: var(--text-light);
}

.d-progress--written > span {
  background: linear-gradient(90deg, #4a90a4, var(--accent));
}
.d-progress--otc > span {
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
}
.d-progress--legal > span {
  background: linear-gradient(90deg, #8b7ec8, #6366f1);
}
.d-progress--cases > span {
  background: linear-gradient(90deg, #e879a9, #f472b6);
}

/* Quad row */
.dash-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .dash-quad {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .dash-quad {
    grid-template-columns: 1fr;
  }
}

.dash-quad-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-card);
}
.dash-quad-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 8px;
}
.dash-quad-card p {
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: 10px;
}
.dash-quad-card .btn-sm {
  width: 100%;
}

.dash-streak-num {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--teal);
  line-height: 1;
}
.dash-streak-sub {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Mock exams stripe */
.dash-mock {
  background: linear-gradient(135deg, #e8f8f5 0%, var(--white) 50%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.dash-mock h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.dash-mock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* Recent activity */
.d-scroll-h {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.d-chip {
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-weight: 500;
}
.d-chip--score {
  margin-left: auto;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-weight: 700;
}

/* How prep is built */
.dash-prep {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.dash-prep h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}
.dash-prep-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .dash-prep-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .dash-prep-grid {
    grid-template-columns: 1fr;
  }
}
.dash-prep-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 10px;
}
.dash-prep-col ul {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.dash-prep-col li::before {
  content: '·';
  color: var(--teal);
  font-weight: bold;
  margin-right: 6px;
}

/* Continue strip */
.continue-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--teal);
  border-radius: 18px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 128, 128, 0.1);
}
.continue-strip.hidden {
  display: none;
}
.cont-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}
.cont-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
}
.cont-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Tools row */
.dash-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

/* Mini leaderboard */
.mini-lb {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mini-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.mini-row.me {
  border-color: var(--teal);
  background: var(--teal-light);
}
.mini-rank {
  font-weight: 800;
  color: var(--teal-dark);
  text-align: center;
}
.mini-name {
  font-weight: 600;
}
.mini-pts {
  font-size: 0.78rem;
  color: var(--text-light);
}
.rank-pill {
  font-size: 0.8rem;
  color: var(--text-mid);
  margin-top: 10px;
}
.rank-pill strong {
  color: var(--teal-dark);
}

.plan-preview {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.55;
  max-height: 160px;
  overflow: hidden;
  position: relative;
}
.plan-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--white));
}
.plan-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-muted {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ── Leaderboard page ────────────────────────────────── */

.lb-page-header {
  text-align: center;
  margin-bottom: 2rem;
}
.lb-page-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--text-dark);
  margin-bottom: 8px;
}
.lb-page-header p {
  color: var(--text-mid);
  font-size: 0.92rem;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.podium-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  text-align: center;
  min-width: 150px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s;
}
.podium-card:hover {
  transform: translateY(-4px);
}
.podium-card.first {
  border-color: #daa520;
  box-shadow: 0 6px 24px rgba(218, 165, 32, 0.2);
  padding-top: 1.6rem;
}
.podium-card.second {
  border-color: #b0b0b0;
}
.podium-card.third {
  border-color: #cd7f32;
}
.podium-rank {
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}
.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.podium-rotation {
  font-size: 0.75rem;
  color: var(--text-light);
}
.podium-points {
  font-weight: 700;
  color: var(--teal-dark);
  margin-top: 8px;
  font-size: 0.95rem;
}

.register-section.app-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
}
.register-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 14px;
  align-items: end;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
}
.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--white);
  color: var(--text-dark);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.12);
}

.leaderboard-table {
  margin-top: 1.5rem;
}
.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.lb-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--text-dark);
}
.refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mid);
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.refresh-btn:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 72px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.lb-row.me {
  border-color: var(--teal);
  background: var(--teal-light);
}
.rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--bg);
  color: var(--teal-dark);
}
.rank-badge.r1 {
  background: linear-gradient(135deg, #ffd700, #f5e6a3);
  color: #5c4a00;
}
.rank-badge.r2 {
  background: linear-gradient(135deg, #e8e8e8, #c0c0c0);
  color: #333;
}
.rank-badge.r3 {
  background: linear-gradient(135deg, #e6c8a8, #cd7f32);
  color: #3d2800;
}
.intern-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.intern-info .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
}
.intern-name {
  font-weight: 600;
}
.you-tag {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 600;
}
.intern-rotation {
  font-size: 0.75rem;
  color: var(--text-light);
}
.badges-col {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.65rem;
  color: var(--teal-dark);
}
.points-col {
  text-align: right;
}
.points-col .pts {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.points-col .pts-label {
  font-size: 0.65rem;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
}
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  .lb-row {
    grid-template-columns: 40px 1fr auto;
  }
  .badges-col {
    display: none;
  }
}

/* ── My Plan page ─────────────────────────────────── */

.identity-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}
.identity-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.id-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: var(--teal);
}
.id-name {
  font-weight: 700;
}
.id-sub {
  font-size: 0.8rem;
  color: var(--text-light);
}
.id-sub a {
  color: var(--teal-dark);
  font-weight: 600;
}

.schedule-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.schedule-form > h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 1.1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  min-height: 90px;
  width: 100%;
  resize: vertical;
}
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  min-height: 44px;
  align-items: center;
}
.tags-input-wrapper input {
  border: none;
  flex: 1;
  min-width: 120px;
  font-family: inherit;
  font-size: 0.88rem;
  background: transparent;
  outline: none;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 8px;
}
.tag-chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--teal-dark);
  font-size: 1rem;
  line-height: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.plan-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.plan-header .title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--text-dark);
}
.plan-header .meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}
.plan-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-mid);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--teal-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.plan-content {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-dark);
}
.plan-content h1,
.plan-content h2,
.plan-content h3 {
  font-family: 'DM Serif Display', serif;
  color: var(--teal-dark);
  margin: 1.25rem 0 0.5rem;
}
.plan-content ul {
  margin-left: 1.25rem;
}

.history-section {
  margin-top: 1.5rem;
}
.history-section h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-weight: 700;
}
.history-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  background: var(--white);
}
.history-item:hover {
  border-color: var(--teal);
}
.hi-date {
  color: var(--text-light);
  font-size: 0.78rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text-dark);
  box-shadow: 0 8px 32px rgba(0, 80, 80, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  border-color: var(--danger);
}

/* App footer */
.app-footer {
  background: var(--text-dark);
  color: rgba(255, 255, 255, 0.55);
  padding: 28px clamp(20px, 4vw, 48px);
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.app-footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.82rem;
  margin-right: 14px;
}
.app-footer a:hover {
  color: white;
}
.app-footer-brand {
  font-family: 'DM Serif Display', serif;
  color: white;
  font-size: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
