/* ===== DESIGN TOKENS ===== */
:root {
  /* Backgrounds — subtly cooler grouped surfaces */
  --bg:  #ffffff;
  --bg2: #F4F5FA;
  --bg3: #E5E7EF;

  /* Text */
  --text:  #0B1020;
  --text2: #3A3D49;
  --text3: #8A8E9B;

  /* Borders */
  --bd:  rgba(60,64,80,0.12);
  --bd2: rgba(60,64,80,0.22);

  /* Radii — slightly larger for softer modern feel */
  --r:  14px;
  --rl: 20px;
  --rxl: 26px;

  /* Brand — iOS-friendly blue plus a violet for gradient pairing */
  --accent:      #D97706;
  --info:        #0A84FF;
  --info-bg:     rgba(10,132,255,0.10);
  --info-bd:     rgba(10,132,255,0.28);
  --brand:       #0A84FF;
  --brand2:      #7C5CFF;
  --brand3:      #00C2FF;
  --brand-grad:       linear-gradient(135deg, #00C2FF 0%, #0A84FF 45%, #7C5CFF 100%);
  --brand-grad-soft:  linear-gradient(135deg, rgba(0,194,255,0.16) 0%, rgba(10,132,255,0.14) 50%, rgba(124,92,255,0.16) 100%);
  --brand-glow:       0 8px 28px rgba(10,132,255,0.32), 0 2px 6px rgba(124,92,255,0.18);
  --ring:             0 0 0 4px rgba(10,132,255,0.20);

  --success:     #2BC665;
  --success-bg:  rgba(43,198,101,0.10);
  --success-bd:  rgba(43,198,101,0.26);
  --warn:        #FF9500;
  --warn-bg:     rgba(255,149,0,0.10);
  --warn-bd:     rgba(255,149,0,0.28);
  --danger:      #FF3B30;
  --danger-bg:   rgba(255,59,48,0.08);
  --danger-bd:   rgba(255,59,48,0.22);

  /* Elevation — softer, more layered */
  --shadow-card:    0 1px 2px rgba(11,16,32,0.04), 0 8px 24px -12px rgba(11,16,32,0.10), 0 0 0 0.5px rgba(11,16,32,0.04);
  --shadow-card-hi: 0 4px 14px -4px rgba(11,16,32,0.10), 0 18px 40px -18px rgba(11,16,32,0.18), 0 0 0 0.5px rgba(11,16,32,0.05);
  --shadow-fab:     0 6px 22px rgba(10,132,255,0.42), 0 2px 6px rgba(124,92,255,0.24);

  /* Safe areas */
  --safe-top:   env(safe-area-inset-top,    0px);
  --safe-bot:   env(safe-area-inset-bottom, 0px);
  --safe-left:  env(safe-area-inset-left,   0px);
  --safe-right: env(safe-area-inset-right,  0px);

  --nav-h: 56px;
  --tab-h: 62px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
ul { list-style: none; }

/* ===== APP SHELL ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh;
  height: -webkit-fill-available;
}

/* ===== OFFLINE BANNER ===== */
#offline-banner {
  background: var(--warn-bg);
  border-bottom: 0.5px solid var(--warn-bd);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  display: none;
  flex-shrink: 0;
}
#offline-banner.visible { display: block; }

/* ===== TOP NAV ===== */
#top-nav {
  height: calc(var(--nav-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 0.5px solid rgba(60,64,80,0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: calc(16px + var(--safe-left));
  padding-right: calc(16px + var(--safe-right));
  flex-shrink: 0;
  z-index: 10;
}
.nav-logo {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #0B1020 0%, #1F2A4D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nav-logo em {
  font-style: normal;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-upgrade {
  background: var(--brand-grad);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.1px;
  min-height: 30px;
  box-shadow: 0 3px 10px rgba(10,132,255,0.32);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-upgrade:active { transform: scale(0.96); opacity: 0.92; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: white;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(10,132,255,0.28), 0 4px 12px rgba(124,92,255,0.22);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== PAGE AREA ===== */
#page-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    radial-gradient(1200px 500px at 110% -10%, rgba(124,92,255,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(0,194,255,0.10), transparent 55%),
    var(--bg2);
  position: relative;
}

/* ===== BOTTOM TAB BAR ===== */
#bottom-tabs {
  height: calc(var(--tab-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 0.5px solid rgba(60,64,80,0.16);
  display: flex;
  flex-shrink: 0;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text3);
  transition: color 0.18s ease, transform 0.18s ease;
  position: relative;
}
.tab-btn.active {
  color: var(--info);
}
.tab-btn.active .tab-icon {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(10,132,255,0.35));
}
.tab-btn:active { transform: scale(0.96); }
.tab-icon {
  font-size: 22px; line-height: 1;
  transition: transform 0.18s ease;
}
.tab-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
.tab-pro-badge {
  position: absolute;
  top: 7px;
  right: calc(50% - 19px);
  background: var(--warn);
  color: white;
  font-size: 7px; font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.3px; line-height: 1.4;
}

/* ===== VIEWS ===== */
.view { display: none; min-height: 100%; padding-bottom: 20px; }
.view.active { display: block; }

/* ===== DETAIL OVERLAY ===== */
.detail-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  z-index: 20;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: none;
  padding-bottom: calc(24px + var(--safe-bot));
}
.detail-view.active { display: block; }

.detail-toolbar {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 0.5px solid rgba(60,64,80,0.14);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  height: 52px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 5;
}
.detail-toolbar-title {
  flex: 1;
  font-size: 16px; font-weight: 600;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 8px;
}
.btn-back {
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center;
  font-size: 22px; color: var(--info);
  padding: 0 6px;
}
.btn-del {
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: flex-end;
  font-size: 13px; font-weight: 600;
  color: var(--danger);
  padding: 0 6px;
}

/* ===== AUTH SCREEN ===== */
#auth-screen {
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 700px at 110% -10%, rgba(124,92,255,0.18), transparent 55%),
    radial-gradient(900px 600px at -10% 110%, rgba(0,194,255,0.18), transparent 55%),
    var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 36px calc(24px + var(--safe-bot));
  z-index: 100;
  text-align: center;
}
#auth-screen.hidden { display: none; }
.auth-logo {
  font-size: 48px; font-weight: 800;
  letter-spacing: -1.8px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #0B1020 0%, #1F2A4D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo em {
  font-style: normal;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-tagline {
  font-size: 16px; color: var(--text2);
  line-height: 1.6; max-width: 300px;
  margin-bottom: 52px;
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg);
  border: 1px solid var(--bd2);
  border-radius: var(--rl);
  padding: 15px 24px;
  font-size: 16px; font-weight: 600; color: var(--text);
  width: 100%; max-width: 300px; min-height: 54px;
  box-shadow: var(--shadow-card);
}
.btn-google:active { background: var(--bg3); }
.google-logo { width: 20px; height: 20px; flex-shrink: 0; }
/* Apple requires Sign in with Apple to be presented at least as prominently as
   other sign-in options (HIG). Same footprint as the Google button, black fill. */
.btn-apple {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #000; color: #fff;
  border: 1px solid #000;
  border-radius: var(--rl);
  padding: 15px 24px;
  font-size: 16px; font-weight: 600;
  width: 100%; max-width: 300px; min-height: 54px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.btn-apple:active { background: #1c1c1e; }
.apple-logo { width: 20px; height: 20px; flex-shrink: 0; margin-top: -2px; }
.auth-links { margin-top: 32px; font-size: 12px; color: var(--text3); }
.auth-links a { color: var(--text3); }
.auth-error { margin-top: 16px; max-width: 300px; }
.auth-disclaimer {
  margin-top: 20px; max-width: 320px;
  font-size: 11px; line-height: 1.5; color: var(--text3); text-align: center;
}

/* ===== ONBOARDING ===== */
#onboarding {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 90;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(56px + var(--safe-top)) 24px calc(40px + var(--safe-bot));
}
#onboarding.hidden { display: none; }
.onboarding-slides {
  flex: 1; width: 100%; max-width: 360px;
  position: relative; overflow: hidden;
}
.onboarding-slide {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; height: 100%; gap: 20px;
}
.onboarding-slide.active { display: flex; }
.onboarding-emoji { font-size: 64px; }
.onboarding-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.onboarding-desc { font-size: 16px; color: var(--text2); line-height: 1.6; max-width: 280px; }
.onboarding-footer { width: 100%; max-width: 360px; }
.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; }
.onboarding-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg3);
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.onboarding-dot.active { background: var(--brand-grad); width: 26px; border-radius: 4px; }
.onboarding-actions { display: flex; justify-content: space-between; align-items: center; }
.btn-skip { color: var(--text3); font-size: 16px; font-weight: 500; min-height: 44px; padding: 0 8px; }
.btn-next {
  background: var(--brand-grad); color: white;
  padding: 14px 36px; border-radius: var(--rl);
  font-size: 16px; font-weight: 600; min-height: 50px;
  box-shadow: var(--brand-glow);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 0.5px solid rgba(60,64,80,0.14);
  padding: 12px 16px 14px;
  display: flex; align-items: flex-end; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
  gap: 12px;
}
.section-header-text {}
.section-title {
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.85px; line-height: 1.05;
}
.section-subtitle {
  font-size: 13px; color: var(--text3);
  margin-top: 4px; font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--brand-grad); color: white;
  border-radius: var(--rl); padding: 14px 20px;
  font-size: 16px; font-weight: 600;
  width: 100%; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  letter-spacing: -0.1px;
  box-shadow: var(--brand-glow);
  position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.btn-primary:active { transform: translateY(1px) scale(0.995); opacity: 0.92; box-shadow: 0 4px 14px rgba(10,132,255,0.28); }
.btn-primary:disabled { opacity: 0.36; pointer-events: none; box-shadow: none; }

.btn-ghost {
  background: rgba(10,132,255,0.04); color: var(--info);
  border: 1px solid var(--bd2); border-radius: var(--rl);
  padding: 13px 20px; font-size: 15px; font-weight: 600;
  width: 100%; min-height: 50px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s ease, transform .15s ease;
}
.btn-ghost:active { background: var(--bg2); transform: scale(0.995); }

.btn-success {
  background: linear-gradient(135deg, #34D67A 0%, #2BC665 100%); color: white;
  border-radius: var(--rl); padding: 13px 20px;
  font-size: 15px; font-weight: 600; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 6px 18px rgba(43,198,101,0.32);
}

.btn-sm {
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  border-radius: 10px; min-height: 34px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-sm.primary { background: var(--info); color: white; }
.btn-sm.ghost { border: 1px solid var(--bd2); color: var(--text2); }
.btn-sm.success { background: var(--success); color: white; }
.btn-sm.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-bd); }

.btn-add {
  background: var(--brand-grad); color: white;
  font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: 20px;
  min-height: 34px; display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(10,132,255,0.32);
  transition: transform .15s ease, opacity .15s ease;
}
.btn-add:active { transform: scale(0.96); opacity: 0.92; }

.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger-bd); border-radius: var(--rl);
  padding: 13px 20px; font-size: 15px; font-weight: 600;
  width: 100%; min-height: 50px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-bot) + 20px);
  right: calc(20px + var(--safe-right));
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand-grad); color: white;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 15;
  will-change: transform;
  transition: transform 0.12s ease;
}
.fab:active { transform: scale(0.91); }

/* ===== CARDS ===== */
.card {
  background: var(--bg);
  border-radius: var(--rl);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.stat-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0)) ,
    var(--bg);
  border-radius: var(--rl);
  padding: 18px 12px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(10,132,255,0.20), rgba(124,92,255,0.10) 50%, rgba(10,132,255,0) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
}
.stat-card:active { transform: scale(0.985); }
.stat-num {
  font-size: 34px; font-weight: 800;
  line-height: 1; letter-spacing: -0.9px;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 10px; color: var(--text3); font-weight: 700;
  margin-top: 6px; text-transform: uppercase; letter-spacing: 0.7px;
}

.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
@media (min-width: 500px) {
  .card-grid-2.card-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ===== ALERTS ===== */
.alert {
  border-radius: var(--r); padding: 12px 14px;
  font-size: 14px; line-height: 1.5; border: 1px solid;
}
.alert-info    { background: var(--info-bg);    border-color: var(--info-bd);    color: var(--info); }
.alert-success { background: var(--success-bg); border-color: var(--success-bd); color: var(--success); }
.alert-warn    { background: var(--warn-bg);    border-color: var(--warn-bd);    color: var(--warn); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-bd);  color: var(--danger); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  font-size: 13px; font-weight: 600; color: var(--text2);
  margin-bottom: 7px; display: block; letter-spacing: 0.1px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3.5px rgba(0,122,255,0.12);
}
.form-textarea { resize: none; line-height: 1.55; -webkit-overflow-scrolling: touch; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath stroke='%238E8E93' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }
.char-counter { font-size: 12px; color: var(--text3); text-align: right; margin-top: 4px; }
.char-over { color: var(--danger) !important; }

/* ===== TAG FILTERS ===== */
.tag-filters {
  display: flex; gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  background: var(--bg);
  border-bottom: 0.5px solid var(--bd);
}
.tag-filters::-webkit-scrollbar { display: none; }

.tag-btn {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--bd2);
  color: var(--text2);
  background: var(--bg);
  min-height: 32px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tag-btn.active-all         { background: var(--text);    color: white; border-color: transparent; }
.tag-btn.active-clinical    { background: #2563EB;         color: white; border-color: transparent; }
.tag-btn.active-volunteering{ background: #059669;         color: white; border-color: transparent; }
.tag-btn.active-research    { background: #7C3AED;         color: white; border-color: transparent; }
.tag-btn.active-leadership  { background: #B45309;         color: white; border-color: transparent; }
.tag-btn.active-shadowing   { background: #0891B2;         color: white; border-color: transparent; }

.tag-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag-pill-clinical     { background: rgba(37,99,235,0.10);  color: #2563EB; }
.tag-pill-volunteering { background: rgba(5,150,105,0.10);  color: #059669; }
.tag-pill-research     { background: rgba(124,58,237,0.10); color: #7C3AED; }
.tag-pill-leadership   { background: rgba(180,83,9,0.10);   color: #B45309; }
.tag-pill-shadowing    { background: rgba(8,145,178,0.10);  color: #0891B2; }

.entry-tag-btn {
  padding: 7px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--bd2);
  color: var(--text2); background: var(--bg);
  min-height: 36px; transition: all 0.15s;
}
.entry-tag-btn.sel-clinical     { background: rgba(37,99,235,0.10);  color: #2563EB; border-color: rgba(37,99,235,0.35); }
.entry-tag-btn.sel-volunteering { background: rgba(5,150,105,0.10);  color: #059669; border-color: rgba(5,150,105,0.35); }
.entry-tag-btn.sel-research     { background: rgba(124,58,237,0.10); color: #7C3AED; border-color: rgba(124,58,237,0.35); }
.entry-tag-btn.sel-leadership   { background: rgba(180,83,9,0.10);   color: #B45309; border-color: rgba(180,83,9,0.35); }
.entry-tag-btn.sel-shadowing    { background: rgba(8,145,178,0.10);  color: #0891B2; border-color: rgba(8,145,178,0.35); }
.entry-tag-btn.locked { opacity: 0.42; pointer-events: none; }

/* ===== JOURNAL ===== */
.entry-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

.entry-card {
  background: var(--bg);
  border-radius: var(--rl);
  padding: 14px 14px 12px 18px;
  border-left: 4px solid transparent;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .2s ease, opacity .12s ease;
}
.entry-card:active { opacity: 0.86; transform: scale(0.992); box-shadow: var(--shadow-card-hi); }
.entry-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 5px;
}
.entry-card-title {
  font-size: 15px; font-weight: 700;
  flex: 1; margin-right: 8px; line-height: 1.3; letter-spacing: -0.1px;
}
.entry-card-date {
  font-size: 12px; color: var(--text3);
  white-space: nowrap; flex-shrink: 0;
  padding-top: 1px; font-weight: 500;
}
.entry-card-preview {
  font-size: 13px; color: var(--text2);
  line-height: 1.45; margin-bottom: 9px;
}
.entry-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.comp-score-pill {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
  background: var(--bg3); color: var(--text2);
}

/* ===== ACTIVITIES ===== */
.activity-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 12px 16px 16px;
}
@media (max-width: 340px) { .activity-grid { grid-template-columns: 1fr; } }

.activity-card {
  background: var(--bg);
  border-radius: var(--rl);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .2s ease, opacity .12s ease;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.activity-card::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--brand-grad-soft);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.activity-card:active { opacity: 0.92; transform: scale(0.99); box-shadow: var(--shadow-card-hi); }
.activity-card:active::before { opacity: 0.7; }
.activity-card-name {
  font-size: 14px; font-weight: 700;
  margin-bottom: 2px; margin-top: 8px;
  letter-spacing: -0.1px; line-height: 1.25;
}
.activity-card-org { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.activity-card-dates { font-size: 12px; color: var(--text3); margin-bottom: 12px; font-weight: 500; }
.activity-card-hrs {
  font-size: 34px; font-weight: 800;
  line-height: 1; letter-spacing: -1.5px;
  margin-top: auto;
}
.activity-hrs-label {
  font-size: 10px; color: var(--text3); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}

/* ===== PROGRESS BARS ===== */
.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-label { font-size: 13px; font-weight: 700; width: 120px; flex-shrink: 0; letter-spacing: -0.1px; }
.progress-track {
  flex: 1; height: 8px; background: var(--bg3);
  border-radius: 4px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(11,16,32,0.04);
}
.progress-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.progress-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0) 70%);
  border-radius: inherit;
}
.progress-val { font-size: 13px; font-weight: 800; width: 44px; text-align: right; flex-shrink: 0; color: var(--text2); font-variant-numeric: tabular-nums; }

/* ===== COMPETENCY HIGHLIGHT ===== */
.hl-span { display: inline; border-radius: 3px; padding: 1px 2px; }

/* ===== COMPETENCY RANKS ===== */
.comp-rank-list { display: flex; flex-direction: column; gap: 14px; }
.comp-rank-name { font-size: 14px; font-weight: 700; }
.comp-rank-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.comp-rank-score { font-size: 13px; font-weight: 700; }
.comp-rank-reason { font-size: 12px; color: var(--text2); line-height: 1.45; margin-bottom: 5px; }
.comp-rank-bar { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.comp-rank-fill { height: 100%; border-radius: 3px; }

/* ===== COMPETENCY LEGEND ===== */
.comp-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.comp-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }
.comp-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ===== COMPETENCY GRID ===== */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; }
.comp-tile {
  position: relative;
  background: var(--bg);
  border-radius: var(--r);
  padding: 12px 30px 12px 13px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
  overflow: hidden;
  border: 1px solid transparent;
}
.comp-tile::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--tile-color, var(--info));
  opacity: 0.85;
  border-radius: 0 4px 4px 0;
}
.comp-tile:active { transform: scale(0.985); box-shadow: var(--shadow-card-hi); }
.comp-tile-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.comp-tile-name {
  font-size: 12px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); letter-spacing: -0.1px;
  flex: 1;
}
.comp-tile-score {
  font-size: 11px; font-weight: 800;
  color: var(--tile-color, var(--text2));
  background: var(--tile-bg, rgba(10,132,255,0.10));
  padding: 2px 7px; border-radius: 8px;
  min-width: 24px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.comp-tile-bar {
  height: 5px; background: var(--bg3);
  border-radius: 3px; overflow: hidden;
  position: relative;
}
.comp-tile-fill {
  height: 100%; border-radius: 3px;
  background: var(--tile-color, var(--info));
  position: relative;
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.comp-tile-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0) 70%);
  border-radius: inherit;
}
.comp-tile-arrow {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  font-size: 16px; font-weight: 300;
  color: var(--text3);
  line-height: 1;
}
.comp-tile.zero .comp-tile-name { color: var(--text2); }
.comp-tile.zero .comp-tile-score { opacity: 0.55; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,12,28,0.50);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .25s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 0 20px calc(28px + var(--safe-bot));
  width: 100%; max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.36s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -20px 60px -10px rgba(11,16,32,0.30);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
  width: 40px; height: 5px;
  background: var(--bg3); border-radius: 3px;
  margin: 12px auto 18px;
  opacity: 0.85;
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.modal-desc { font-size: 14px; color: var(--text2); line-height: 1.55; margin-bottom: 18px; }

/* ===== PAYWALL ===== */
.paywall-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: var(--warn-bg); border: 1px solid var(--warn-bd);
  color: var(--warn);
  border-radius: 20px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.3px; margin-bottom: 12px;
}
.paywall-bullets { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.paywall-bullets li { font-size: 14px; color: var(--text2); display: flex; gap: 8px; line-height: 1.4; }
.paywall-bullets li::before { content: "→"; color: var(--info); font-weight: 700; flex-shrink: 0; }
.paywall-actions { display: flex; flex-direction: column; gap: 10px; }

/* ===== PRICING ===== */
.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.pricing-card { border: 1.5px solid var(--bd2); border-radius: var(--rl); padding: 18px 14px; text-align: center; }
.pricing-card.featured { border-color: var(--info); }
.pricing-best {
  font-size: 10px; font-weight: 700;
  background: var(--info); color: white;
  padding: 3px 10px; border-radius: 20px;
  display: inline-block; margin-bottom: 10px; letter-spacing: 0.3px;
}
.pricing-price { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.pricing-period { font-size: 12px; color: var(--text3); margin-top: 3px; }
.pricing-note { font-size: 11px; color: var(--text2); margin-top: 6px; }
.pricing-btn {
  margin-top: 14px; padding: 11px 14px;
  border-radius: var(--rl); background: var(--info);
  color: white; font-size: 14px; font-weight: 700;
  width: 100%; min-height: 44px;
}

/* ===== LOADING ===== */
.loading-state { text-align: center; padding: 60px 20px; }
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--bg3);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { font-size: 14px; color: var(--text3); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 72px 24px; }
.empty-emoji { font-size: 52px; margin-bottom: 18px; }
.empty-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.2px; }
.empty-desc {
  font-size: 15px; color: var(--text2);
  line-height: 1.55; margin-bottom: 28px;
  max-width: 280px; margin-left: auto; margin-right: auto;
}

/* ===== PROMPTS ===== */
.prompt-list { padding: 0 16px 6px; display: flex; flex-direction: column; gap: 6px; }
.prompt-btn {
  text-align: left; padding: 11px 14px;
  border-radius: var(--r); border: 1px solid var(--bd);
  background: var(--bg); font-size: 14px; color: var(--text);
  min-height: 44px; line-height: 1.4; cursor: pointer;
}
.prompt-btn:active { background: var(--bg2); }
.prompt-btn.pro { opacity: 0.48; }
.prompt-btn.pro:active { background: var(--bg); }

.prompt-pro-preview {}
.prompt-pro-blurred { position: relative; overflow: hidden; padding-right: 60px; }
.prompt-blur-text { display: block; filter: blur(4px); user-select: none; pointer-events: none; }
.prompt-pro-blurred .pro-pill {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); margin-left: 0;
}

.pro-pill {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  background: var(--warn-bg); border: 1px solid var(--warn-bd);
  color: var(--warn); border-radius: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
  margin-left: 6px; vertical-align: middle;
}

/* ===== METHOD TABS (iOS segmented control) ===== */
.method-tabs {
  display: flex;
  background: rgba(120,120,128,0.12);
  border-radius: 10px; padding: 2px;
  margin: 12px 16px;
}
.method-tab {
  flex: 1; padding: 7px 8px; text-align: center;
  font-size: 14px; font-weight: 600; border-radius: 8px;
  min-height: 34px; color: var(--text3);
  transition: all 0.15s; cursor: pointer;
}
.method-tab.active {
  background: var(--bg); color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04);
}

/* ===== VOICE ===== */
.voice-zone { padding: 32px 24px; text-align: center; }
.record-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--danger); color: white; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 16px rgba(255,59,48,0.32);
}
.record-btn.recording { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,59,48,0.4); }
  50%      { box-shadow: 0 0 0 16px rgba(255,59,48,0); }
}
.voice-status { font-size: 13px; color: var(--text3); }

/* ===== PHOTO ZONE ===== */
.photo-zone {
  margin: 0 16px; border: 2px dashed var(--bd2);
  border-radius: var(--rl); padding: 36px 20px;
  text-align: center; color: var(--text3);
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; min-height: 120px;
  background: var(--bg);
}
.photo-zone:active { background: var(--bg2); }
.photo-zone-icon { font-size: 36px; }
.photo-zone-label { font-size: 14px; font-weight: 600; }

/* ===== HOURS LOG ===== */
.hours-log-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.hours-log-item {
  background: var(--bg);
  border-radius: var(--r); padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-card);
}
.log-date { font-size: 13px; color: var(--text2); width: 80px; flex-shrink: 0; font-weight: 500; }
.log-hours-val { font-size: 16px; font-weight: 700; width: 52px; flex-shrink: 0; }
.log-notes { font-size: 12px; color: var(--text3); flex: 1; }
.log-del-btn {
  color: var(--text3); font-size: 18px;
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.log-form-mini {
  background: var(--bg); border-radius: var(--rl);
  padding: 14px 16px; margin: 0 16px 12px;
  box-shadow: var(--shadow-card);
}
.log-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-bottom: 10px; }
.log-form-actions { display: flex; gap: 8px; }

/* ===== SETTINGS ===== */
.settings-group-header {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text3);
  padding: 22px 20px 7px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--bg);
  border-bottom: 0.5px solid var(--bd);
  min-height: 52px; cursor: pointer;
}
.settings-row:active { background: var(--bg2); }
.settings-row-label { font-size: 16px; }
.settings-row-chevron { color: var(--text3); font-size: 16px; font-weight: 300; }
.settings-row.danger .settings-row-label { color: var(--danger); }

.user-card-large {
  background: var(--bg); border-bottom: 0.5px solid var(--bd);
  padding: 22px 20px; display: flex; align-items: center; gap: 16px;
}
.user-avatar-large {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--info); color: white;
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px rgba(0,122,255,0.22);
}
.user-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.user-name-large { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.user-email-small { font-size: 13px; color: var(--text3); margin-top: 3px; }

/* ===== PS BUILDER ===== */
.entry-sel-list { padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.entry-sel-item {
  background: var(--bg); border-radius: var(--r); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.15s;
  box-shadow: var(--shadow-card);
}
.entry-sel-item.selected {
  box-shadow: 0 0 0 2px var(--info) inset;
  background: var(--info-bg);
}
.entry-sel-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--bd2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white; font-size: 12px; font-weight: 700;
}
.entry-sel-item.selected .entry-sel-check { background: var(--info); border-color: var(--info); }
.entry-sel-title { font-size: 14px; font-weight: 600; flex: 1; }
.entry-sel-date { font-size: 12px; color: var(--text3); }

.tone-selector { display: flex; gap: 8px; padding: 0 16px; }
.tone-btn {
  flex: 1; border: 1.5px solid var(--bd2);
  border-radius: var(--rl); padding: 12px 8px;
  text-align: center; cursor: pointer; transition: all 0.15s;
  min-height: 64px; background: var(--bg);
  box-shadow: var(--shadow-card);
}
.tone-btn.active { border-color: var(--info); background: var(--info-bg); }
.tone-btn-label { font-size: 13px; font-weight: 700; color: var(--text); }
.tone-btn.active .tone-btn-label { color: var(--info); }
.tone-btn-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

.out-box {
  background: var(--bg); border-radius: var(--rl);
  padding: 16px; margin: 0 16px;
  font-size: 14px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap; box-shadow: var(--shadow-card);
}
.out-actions { display: flex; gap: 10px; padding: 10px 16px 0; align-items: center; }
.out-actions .btn-sm { flex: 1; }

/* Editable personal-statement draft. Matches .out-box typography so switching
   from the old read-only box to an editor is visually continuous. */
.ps-editor {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 16px;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  box-shadow: var(--shadow-card);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  resize: vertical;
  min-height: 280px;
}
.ps-editor:focus { outline: none; border-color: var(--info); }
/* Pushes the action buttons right; reserves space so the row does not reflow as
   the label changes between "Saving…" and "Saved". */
.ps-save-state {
  flex: 0 0 auto;
  min-width: 96px;
  font-size: 12px;
  color: var(--text3);
}

/* ===== EXPORT ===== */
.format-selector { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.format-btn {
  border: 1.5px solid var(--bd); border-radius: var(--rl);
  padding: 14px 16px; text-align: left; cursor: pointer;
  background: var(--bg); transition: all 0.15s; box-shadow: var(--shadow-card);
}
.format-btn.active { border-color: var(--info); background: var(--info-bg); }
.format-btn-name { font-size: 15px; font-weight: 700; }
.format-btn.active .format-btn-name { color: var(--info); }
.format-btn-desc { font-size: 12px; color: var(--text3); margin-top: 3px; }

.export-char-counter { font-size: 13px; font-weight: 600; margin: 8px 16px 0; }
.export-char-ok   { color: var(--success); }
.export-char-over { color: var(--danger); }

/* ===== ENTRY DETAIL SPECIFICS ===== */
.linked-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; background: var(--bg);
  border: 1px solid var(--bd2); border-radius: 20px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; box-shadow: var(--shadow-card);
}
.linked-chip:active { background: var(--bg3); }

.ai-blockquote {
  border-left: 3px solid var(--info); padding-left: 12px;
  margin-top: 10px; font-style: italic;
  font-size: 13px; color: var(--text2); line-height: 1.55;
}

.gaps-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.gap-pill {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border: 1px dashed var(--bd2);
  border-radius: 20px; font-size: 12px; color: var(--text3);
}

/* ===== DASHBOARD ===== */
.app-suggest { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Dashboard section rhythm — replaces the heavy .sec-sep blocks with
   subtle hairline dividers and consistent vertical space. */
.dash-sec { background: var(--bg); padding: 18px 16px 16px; }
.dash-sec + .dash-sec { border-top: 0.5px solid var(--bd); }
.dash-sec + #dash-suggestions,
#dash-suggestions + .dash-sec { border-top: 0.5px solid var(--bd); }

/* Stat-card colored top accents — visually map each metric to its color
   without redesigning the card. The ::before rule keeps the brand outline
   from the base .stat-card. */
.stat-card { isolation: isolate; }
.stat-card::after {
  content: "";
  position: absolute; left: 14px; right: 14px; top: 0;
  height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--stat-accent, var(--brand));
  opacity: 0.85;
}
.stat-card--brand   { --stat-accent: var(--brand); }
.stat-card--info    { --stat-accent: var(--info); }
.stat-card--success { --stat-accent: var(--success); }
.stat-card--warn    { --stat-accent: var(--warn); }

/* Suggestion tips — softer than alert-warn, reads as guidance not error. */
.dash-tips { padding: 14px 16px 4px; display: flex; flex-direction: column; gap: 8px; }
.dash-tips:empty { display: none; }
.dash-tip {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--info-bg);
  border: 0.5px solid var(--info-bd);
  border-radius: var(--rl);
  padding: 12px 14px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--text);
}
.dash-tip-icon {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--info);
  margin-top: 1px;
}
.dash-tip-text { flex: 1; color: var(--text2); }

/* Rank badges for Top Activities / Strongest Entries */
.dash-rank-list { display: flex; flex-direction: column; gap: 8px; }
.dash-rank-row {
  display: flex; align-items: center; gap: 10px;
}
.dash-rank-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg2);
  border: 0.5px solid var(--bd);
  color: var(--text2);
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}
.dash-rank-row:first-child .dash-rank-num {
  background: var(--brand-grad);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(10,132,255,0.30);
}
.dash-rank-row > .top-activity-card,
.dash-rank-row > .top-entry-card { flex: 1; min-width: 0; }

/* Streak card — modernized layout using inline SVG flame */
.dash-streak {
  margin: 12px 16px 4px;
  border-radius: var(--rl);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(255,149,0,0.10), rgba(255,59,48,0.06));
  border: 0.5px solid rgba(255,149,0,0.28);
  box-shadow: var(--shadow-card);
}
.dash-streak--idle {
  background: var(--bg);
  border-color: var(--bd);
}
.dash-streak-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF9500, #FF3B30);
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(255,149,0,0.32);
}
.dash-streak--idle .dash-streak-icon {
  background: var(--bg2);
  color: var(--text3);
  box-shadow: none;
  border: 0.5px solid var(--bd);
}
.dash-streak-icon svg { width: 20px; height: 20px; }
.dash-streak-body { flex: 1; min-width: 0; }
.dash-streak-title {
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -0.2px;
  line-height: 1.2;
}
.dash-streak-meta {
  font-size: 12px; color: var(--text3);
  margin-top: 2px; line-height: 1.4;
}
.dash-streak-action {
  flex-shrink: 0;
  background: var(--brand-grad);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(10,132,255,0.28);
}
.dash-streak-action:active { transform: scale(0.97); opacity: 0.92; }

.top-activity-card {
  background: var(--bg); border-radius: var(--rl);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; min-height: 56px; box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .2s ease;
}
.top-activity-card:active { transform: scale(0.99); box-shadow: var(--shadow-card-hi); }
.top-activity-left { display: flex; flex-direction: column; gap: 3px; }
.top-activity-name { font-size: 14px; font-weight: 700; }
.top-activity-hrs { font-size: 21px; font-weight: 800; letter-spacing: -0.5px; }

.top-entry-card {
  background: var(--bg); border-radius: var(--rl);
  padding: 14px 16px; cursor: pointer;
  min-height: 56px; box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .2s ease;
}
.top-entry-card:active { transform: scale(0.99); box-shadow: var(--shadow-card-hi); }
.top-entry-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.1px; }

/* ===== EXPORT SUMMARY ===== */
.export-summary {
  background: var(--bg2); border-radius: var(--r); padding: 14px;
  font-size: 13px; line-height: 1.65; white-space: pre-wrap; color: var(--text2);
}

/* ===== DRAFT BANNER ===== */
#draft-banner {
  background: var(--warn-bg); border: 1px solid var(--warn-bd);
  border-radius: var(--r); margin: 10px 16px 0;
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
#draft-banner.hidden { display: none !important; }
.draft-text { font-size: 14px; color: var(--warn); font-weight: 600; }

/* ===== CONTENT SECTIONS ===== */
.sec { padding: 14px 16px; }
.sec + .sec { border-top: 0.5px solid var(--bd); }
.sec-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 16px 10px;
}
.sec-sep { height: 10px; background: var(--bg2); }

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.pad-16 { padding: 16px; }
.bold { font-weight: 700; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-info   { color: var(--info); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8  { display: flex; gap: 8px; }
.flex-wrap   { flex-wrap: wrap; }
.w-full      { width: 100%; }

/* ===== DARK THEME ===== */
html[data-theme="dark"] {
  --bg:  #14161F;
  --bg2: #0A0C13;
  --bg3: #1F2230;
  --text:  #FFFFFF;
  --text2: #D7D9E5;
  --text3: #7E8398;
  --bd:  rgba(132,138,160,0.18);
  --bd2: rgba(132,138,160,0.30);

  --accent:      #FFB340;
  --info:        #4DA8FF;
  --info-bg:     rgba(77,168,255,0.14);
  --info-bd:     rgba(77,168,255,0.34);
  --brand:       #4DA8FF;
  --brand2:      #9C84FF;
  --brand3:      #34D6FF;
  --brand-grad:       linear-gradient(135deg, #34D6FF 0%, #4DA8FF 45%, #9C84FF 100%);
  --brand-grad-soft:  linear-gradient(135deg, rgba(52,214,255,0.18) 0%, rgba(77,168,255,0.16) 50%, rgba(156,132,255,0.18) 100%);
  --brand-glow:       0 8px 32px rgba(77,168,255,0.45), 0 2px 8px rgba(156,132,255,0.30);
  --ring:             0 0 0 4px rgba(77,168,255,0.28);

  --success:     #30D158;
  --success-bg:  rgba(48,209,88,0.14);
  --success-bd:  rgba(48,209,88,0.32);
  --warn:        #FF9F0A;
  --warn-bg:     rgba(255,159,10,0.14);
  --warn-bd:     rgba(255,159,10,0.32);
  --danger:      #FF453A;
  --danger-bg:   rgba(255,69,58,0.12);
  --danger-bd:   rgba(255,69,58,0.30);

  --shadow-card:    0 0 0 0.5px rgba(255,255,255,0.06), 0 6px 18px -8px rgba(0,0,0,0.55);
  --shadow-card-hi: 0 0 0 0.5px rgba(255,255,255,0.10), 0 14px 30px -10px rgba(0,0,0,0.65);
  --shadow-fab:     0 6px 22px rgba(77,168,255,0.45), 0 2px 8px rgba(156,132,255,0.30);
}

html[data-theme="dark"] #page-area,
html[data-theme="dark"] #auth-screen {
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(156,132,255,0.18), transparent 55%),
    radial-gradient(900px 500px at -10% 0%, rgba(52,214,255,0.14), transparent 55%),
    var(--bg2);
}

html[data-theme="dark"] #top-nav,
html[data-theme="dark"] #bottom-tabs,
html[data-theme="dark"] .detail-toolbar,
html[data-theme="dark"] .section-header {
  background: rgba(20,22,31,0.74);
  border-color: rgba(132,138,160,0.18);
}

html[data-theme="dark"] .nav-logo,
html[data-theme="dark"] .auth-logo {
  background: linear-gradient(135deg, #FFFFFF 0%, #C7CCE0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg:  #14161F;
    --bg2: #0A0C13;
    --bg3: #1F2230;
    --text:  #FFFFFF;
    --text2: #D7D9E5;
    --text3: #7E8398;
    --bd:  rgba(132,138,160,0.18);
    --bd2: rgba(132,138,160,0.30);

    --accent:      #FFB340;
    --info:        #4DA8FF;
    --info-bg:     rgba(77,168,255,0.14);
    --info-bd:     rgba(77,168,255,0.34);
    --brand:       #4DA8FF;
    --brand2:      #9C84FF;
    --brand3:      #34D6FF;
    --brand-grad:       linear-gradient(135deg, #34D6FF 0%, #4DA8FF 45%, #9C84FF 100%);
    --brand-grad-soft:  linear-gradient(135deg, rgba(52,214,255,0.18) 0%, rgba(77,168,255,0.16) 50%, rgba(156,132,255,0.18) 100%);
    --brand-glow:       0 8px 32px rgba(77,168,255,0.45), 0 2px 8px rgba(156,132,255,0.30);
    --ring:             0 0 0 4px rgba(77,168,255,0.28);

    --success:     #30D158;
    --success-bg:  rgba(48,209,88,0.14);
    --success-bd:  rgba(48,209,88,0.32);
    --warn:        #FF9F0A;
    --warn-bg:     rgba(255,159,10,0.14);
    --warn-bd:     rgba(255,159,10,0.32);
    --danger:      #FF453A;
    --danger-bg:   rgba(255,69,58,0.12);
    --danger-bd:   rgba(255,69,58,0.30);

    --shadow-card:    0 0 0 0.5px rgba(255,255,255,0.06), 0 6px 18px -8px rgba(0,0,0,0.55);
    --shadow-card-hi: 0 0 0 0.5px rgba(255,255,255,0.10), 0 14px 30px -10px rgba(0,0,0,0.65);
    --shadow-fab:     0 6px 22px rgba(77,168,255,0.45), 0 2px 8px rgba(156,132,255,0.30);
  }

  html[data-theme="system"] #page-area,
  html[data-theme="system"] #auth-screen {
    background:
      radial-gradient(1200px 600px at 110% -10%, rgba(156,132,255,0.18), transparent 55%),
      radial-gradient(900px 500px at -10% 0%, rgba(52,214,255,0.14), transparent 55%),
      var(--bg2);
  }

  html[data-theme="system"] #top-nav,
  html[data-theme="system"] #bottom-tabs,
  html[data-theme="system"] .detail-toolbar,
  html[data-theme="system"] .section-header {
    background: rgba(20,22,31,0.74);
    border-color: rgba(132,138,160,0.18);
  }

  html[data-theme="system"] .nav-logo,
  html[data-theme="system"] .auth-logo {
    background: linear-gradient(135deg, #FFFFFF 0%, #C7CCE0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Dropdown arrow for dark mode */
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath stroke='%23636366' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath stroke='%23636366' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  }
  html[data-theme="system"] .cd-locked-cta {
    background: rgba(20,22,31,0.90);
  }
}

/* ===== PHOTO CROP EDITOR ===== */
#photo-crop-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: #000;
  flex-direction: column; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 20px) 0 env(safe-area-inset-bottom, 20px);
}
.crop-toolbar {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 24px;
}
.crop-title { font-size: 17px; font-weight: 600; color: #fff; }
.crop-btn-cancel {
  font-size: 16px; color: rgba(255,255,255,0.60);
  background: none; border: none; padding: 6px 0; cursor: pointer;
}
.crop-btn-choose {
  font-size: 16px; font-weight: 600; color: #4da3ff;
  background: none; border: none; padding: 6px 0; cursor: pointer;
}
#crop-canvas {
  touch-action: none; cursor: grab; display: block;
  max-width: calc(100vw - 20px);
}
#crop-canvas:active { cursor: grabbing; }
.crop-zoom-row {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 24px 0; width: 100%; max-width: 360px;
}
.crop-zoom-icon {
  color: rgba(255,255,255,0.65); font-size: 22px;
  font-weight: 300; line-height: 1; user-select: none;
}
#crop-zoom-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.22); outline: none;
}
#crop-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
#crop-zoom-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; cursor: pointer; border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ===== COMPETENCY DETAIL MODAL ===== */
.cd-hero {
  position: relative;
  margin: 0 -20px 18px;
  padding: 22px 22px 18px;
  background: var(--cd-grad, var(--brand-grad));
  color: white;
  border-radius: 28px 28px 24px 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px -10px rgba(11,16,32,0.30);
}
.cd-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.30), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(0,0,0,0.18), transparent 55%);
  pointer-events: none;
}
.cd-hero-eyebrow {
  position: relative;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}
.cd-hero-title {
  position: relative;
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.6px; line-height: 1.15;
  margin-bottom: 10px;
}
.cd-hero-stats {
  position: relative;
  display: flex; gap: 18px;
  margin-top: 14px;
}
.cd-hero-stat-num {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.5px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-hero-stat-label {
  font-size: 11px; font-weight: 600; opacity: 0.82;
  margin-top: 4px; letter-spacing: 0.3px;
}
.cd-hero-meter {
  position: relative;
  margin-top: 14px;
  height: 6px;
  background: rgba(255,255,255,0.22);
  border-radius: 4px;
  overflow: hidden;
}
.cd-hero-meter-fill {
  height: 100%;
  background: rgba(255,255,255,0.95);
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 14px rgba(255,255,255,0.55);
}
.cd-hero-meter-label {
  position: relative;
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 11px; font-weight: 600; opacity: 0.82;
}

.cd-section { margin-bottom: 18px; }
.cd-section-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text3);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.cd-section-label-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cd-color, var(--info));
}
.cd-definition {
  font-size: 14px; color: var(--text);
  line-height: 1.6;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--rl);
  padding: 14px 16px;
}

.cd-evidence-list {
  display: flex; flex-direction: column; gap: 8px;
}
.cd-evidence-item {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 11px 12px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cd-evidence-item:active { transform: scale(0.99); background: var(--bg3); }
.cd-evidence-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 4px;
}
.cd-evidence-title {
  font-size: 14px; font-weight: 700;
  color: var(--text); letter-spacing: -0.1px;
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-evidence-score {
  font-size: 11px; font-weight: 800;
  background: var(--cd-color-bg, rgba(10,132,255,0.10));
  color: var(--cd-color, var(--info));
  padding: 2px 8px; border-radius: 8px;
  flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.cd-evidence-reason {
  font-size: 12px; color: var(--text2);
  line-height: 1.5;
}
.cd-empty {
  background: var(--bg2);
  border: 1px dashed var(--bd2);
  border-radius: var(--rl);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}

.cd-suggest-list {
  display: flex; flex-direction: column; gap: 8px;
}
.cd-suggest-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 11px 13px;
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.cd-suggest-bullet {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cd-color-bg, rgba(10,132,255,0.10));
  color: var(--cd-color, var(--info));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cd-prompt-list {
  display: flex; flex-direction: column; gap: 8px;
}
.cd-prompt-item {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-left: 3px solid var(--cd-color, var(--info));
  border-radius: var(--r);
  padding: 11px 13px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.cd-prompt-item:active { background: var(--bg3); transform: scale(0.99); }

.cd-actions {
  display: flex; gap: 8px;
  margin-top: 12px;
}
.cd-actions .btn-primary,
.cd-actions .btn-ghost { flex: 1; }

/* ===== COMPETENCY LOCKED WALL ===== */
.cd-locked-wall {
  margin: 0 16px 16px;
  border-radius: var(--r);
  border: 1px dashed var(--bd2);
  background: var(--bg2);
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 24px;
  gap: 8px;
}
.cd-locked-icon { font-size: 32px; }
.cd-locked-title { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; }
.cd-locked-desc {
  font-size: 13px; color: var(--text2); line-height: 1.55;
  max-width: 272px; margin-bottom: 8px;
}
.cd-locked-wall .btn-primary { max-width: 260px; min-height: 48px; font-size: 15px; }
.cd-locked-wall .btn-ghost  { max-width: 260px; min-height: 44px; font-size: 14px; }
.cd-trial-note { font-size: 11px; color: var(--text3); max-width: 240px; line-height: 1.45; }

/* ===== ENTRY SEARCH ===== */
.entry-search-wrap { padding: 0 16px 10px; }
.entry-search-wrap.hidden { display: none; }
.entry-search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.entry-search-input::placeholder { color: var(--text3); }
.entry-search-input:focus {
  background: var(--bg);
  border-color: var(--info);
  box-shadow: 0 0 0 3.5px rgba(10,132,255,0.12);
}

/* ===== STAR / PIN ===== */
.entry-card-top-right {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1;
  color: var(--text3);
  min-width: 32px; min-height: 32px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; transition: transform 0.12s ease, color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.star-btn:active { transform: scale(1.25); }
.star-btn.starred { color: var(--warn); }
/* Detail-toolbar variant sits between title and Delete */
#entry-detail-star-btn { min-width: 44px; min-height: 44px; font-size: 22px; }
.sel-star { color: var(--warn); font-size: 13px; }

/* Attribution line under an AAMC competency definition. Required wherever AAMC
   definition text is displayed. */
.cd-attribution {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text3);
  font-style: italic;
}

/* Prompt shown on an entry whose competency tags predate the current AAMC list
   and could not be mapped automatically. */
.retag-note {
  margin: 0 16px 12px;
  padding: 12px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: var(--r);
}
.retag-note-title {
  font-size: 13px; font-weight: 700; color: var(--warn); margin-bottom: 4px;
}
.retag-note-body {
  font-size: 13px; line-height: 1.55; color: var(--text2); margin-bottom: 10px;
}
