/* ═══════════════════════════════════════════
   Circuits Practice — Main Stylesheet
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0612;
  --bg2: #110d1f;
  --bg3: #1a1430;
  --bg4: #221b3d;
  --bg5: #2c2350;
  --border: #3d2f6b;
  --border2: #5a4490;
  --border3: #7c5fc0;
  --text: #ede8ff;
  --text2: #b8a8e8;
  --text3: #7a6aaa;
  --text4: #4a3d77;
  --accent: #9d7de8;
  --accent2: #c4a8ff;
  --accent3: #6b3fa0;
  --green: #4ade80;
  --green-bg: #052010;
  --green-border: #134d2a;
  --red: #f87171;
  --red-bg: #200505;
  --red-border: #4d1313;
  --warn: #fbbf24;
  --gold: #e8c96b;
  --teal: #2dd4bf;
  --font: 'Raleway', sans-serif;
  --font-display: 'Cinzel', serif;
  --mono: 'IBM Plex Mono', monospace;
  --r: 6px;
  --r2: 10px;
  --r3: 16px;
  --glow: 0 0 20px rgba(157, 125, 232, 0.15);
  --glow2: 0 0 40px rgba(157, 125, 232, 0.25);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(107,63,160,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(60,30,100,0.10) 0%, transparent 60%);
}

/* ── Utilities ── */
.hidden { display: none !important; }
.mono   { font-family: var(--mono); }
.muted  { color: var(--text2); }

/* ── Form elements ── */
input, select, textarea {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border .2s, box-shadow .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(157,125,232,0.12);
}
textarea { resize: vertical; line-height: 1.6; }
label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .10em;
  display: block;
  margin-bottom: 5px;
}
.field { margin-bottom: 12px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 0.5px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--glow); }
.btn-accent { background: linear-gradient(135deg, var(--accent3), var(--accent)); color: #fff; border-color: transparent; font-weight: 600; }
.btn-accent:hover { opacity: .9; box-shadow: var(--glow2); color: #fff; }
.btn-gold   { background: linear-gradient(135deg, #7a5a10, #c9a83c); color: #fff; border-color: transparent; font-weight: 600; }
.btn-red    { border-color: var(--red); color: var(--red); }
.btn-red:hover { background: var(--red-bg); box-shadow: none; }
.btn-warn   { border-color: var(--warn); color: var(--warn); }
.btn-warn:hover { background: var(--warn-bg, #1a1200); color: #000; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .3; cursor: not-allowed; box-shadow: none; }

/* ── Pills ── */
.pill {
  display: inline-block;
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 99px;
  font-family: var(--mono);
  white-space: nowrap;
  font-weight: 500;
}
.pill-purple  { background: rgba(157,125,232,.15); color: var(--accent2); border: 0.5px solid rgba(157,125,232,.30); }
.pill-admin   { background: rgba(232,201,107,.12); color: var(--gold);    border: 0.5px solid rgba(232,201,107,.30); }
.pill-green   { background: rgba(74,222,128,.10);  color: var(--green);   border: 0.5px solid rgba(74,222,128,.25);  }
.pill-red     { background: rgba(248,113,113,.10); color: var(--red);     border: 0.5px solid rgba(248,113,113,.25); }
.pill-warn    { background: rgba(251,191,36,.10);  color: var(--warn);    border: 0.5px solid rgba(251,191,36,.25);  }
.pill-teal    { background: rgba(45,212,191,.10);  color: var(--teal);    border: 0.5px solid rgba(45,212,191,.25);  }
.pill-disabled{ background: rgba(74,61,119,.20);   color: var(--text4);   border: 0.5px solid var(--border); }

/* ── Section cards ── */
.section-card {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  padding: 14px;
  margin-bottom: 14px;
}
.section-card h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── Toggle switch ── */
.toggle-wrap  { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.toggle-track { width: 32px; height: 18px; border-radius: 99px; background: var(--bg4); border: 0.5px solid var(--border); position: relative; transition: all .2s; flex-shrink: 0; }
.toggle-track.on { background: var(--accent3); border-color: var(--accent); }
.toggle-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text3); position: absolute; top: 2px; left: 2px; transition: all .2s; }
.toggle-track.on .toggle-thumb { left: 16px; background: #fff; }
.toggle-lbl { font-size: 11px; font-family: var(--mono); color: var(--text3); }
.toggle-track.on + .toggle-lbl { color: var(--accent2); }

/* ── Feedback messages ── */
.err-msg { font-size: 12px; color: var(--red);   margin-top: 8px; font-family: var(--mono); display: flex; align-items: center; gap: 5px; }
.ok-msg  { font-size: 12px; color: var(--green); margin-top: 8px; font-family: var(--mono); }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 0.5px solid var(--border);
  background: rgba(10,6,18,0.95);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.topbar-wordmark {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .10em;
  color: var(--accent2);
  text-shadow: 0 0 20px rgba(196,168,255,.30);
  text-decoration: none;
}
.nav-tabs { display: flex; gap: 2px; margin-left: 20px; }
.nav-tab {
  padding: 5px 14px;
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text3);
  border: none;
  background: transparent;
  font-family: var(--font);
  transition: all .2s;
  letter-spacing: .04em;
  text-decoration: none;
  display: inline-block;
}
.nav-tab:hover { color: var(--text); background: var(--bg3); }
.nav-tab.active { color: var(--accent2); background: var(--bg3); border: 0.5px solid var(--border); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 0 10px rgba(157,125,232,.40);
}
.avatar.admin-av { background: linear-gradient(135deg, #7c3aed, #4f9cf9); }
.streak-badge { font-size: 11px; color: var(--warn); font-family: var(--mono); display: flex; align-items: center; gap: 3px; }

/* ── Auth screen ── */
#screen-auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem; gap: 2rem;
  background: radial-gradient(ellipse at 50% 30%, rgba(107,63,160,0.20) 0%, transparent 70%);
}
.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--accent2);
  text-shadow: 0 0 30px rgba(196,168,255,.40);
}
.auth-card {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r3);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--glow2);
}
.auth-tabs { display: flex; margin-bottom: 1.5rem; border: 0.5px solid var(--border); border-radius: var(--r); overflow: hidden; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--text3); background: transparent; border: none;
  font-family: var(--font); transition: all .2s;
}
.auth-tab.active { background: var(--bg3); color: var(--text); }

/* ── Practice layout ── */
.app-layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 49px); }
.sidebar {
  background: var(--bg2);
  border-right: 0.5px solid var(--border);
  padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.sidebar-label {
  font-size: 9px; font-weight: 700; color: var(--text4);
  text-transform: uppercase; letter-spacing: .14em;
  padding: 10px 8px 4px;
}
.sidebar-label:first-child { padding-top: 2px; }
.sb-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r);
  font-size: 12px; font-weight: 500; color: var(--text2);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; transition: all .2s;
}
.sb-btn:hover { background: var(--bg3); color: var(--text); }
.sb-btn.active { background: var(--bg3); color: var(--accent2); border: 0.5px solid var(--border); }
.sb-btn i { font-size: 14px; flex-shrink: 0; color: var(--text3); }
.sb-btn.active i { color: var(--accent); }
.sb-score { margin-left: auto; font-size: 10px; font-family: var(--mono); color: var(--text4); }
.sb-score.ok { color: var(--green); }
.sb-folder { display: flex; flex-direction: column; }
.sb-folder-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r);
  font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; transition: all .2s;
}
.sb-folder-head:hover { background: var(--bg3); color: var(--text); }
.sb-folder-children { display: flex; flex-direction: column; gap: 1px; padding-left: 14px; }
.sb-child-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: var(--r);
  font-size: 11px; color: var(--text3);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; transition: all .2s;
}
.sb-child-btn:hover { background: var(--bg3); color: var(--text2); }
.sb-child-btn.active { color: var(--accent); background: rgba(157,125,232,.08); }
.main-content { overflow-y: auto; display: flex; flex-direction: column; }

/* ── Practice problem cards ── */
.practice-pane { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.topic-title   { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--accent2); letter-spacing: .06em; margin-bottom: 4px; }
.topic-sub     { font-size: 12px; color: var(--text3); }
.prob-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.prog-track    { flex: 1; height: 3px; background: var(--bg4); border-radius: 99px; overflow: hidden; }
.prog-fill     { height: 100%; background: linear-gradient(90deg, var(--accent3), var(--accent)); border-radius: 99px; transition: width .4s; }
.prog-label    { font-size: 11px; font-family: var(--mono); color: var(--text3); white-space: nowrap; }
.nav-arrows    { display: flex; gap: 6px; }
.prob-card     { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r3); overflow: hidden; box-shadow: var(--glow); }
.prob-head     { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 0.5px solid var(--border); background: linear-gradient(135deg, var(--bg3), var(--bg2)); }
.prob-title-el { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .06em; flex: 1; color: var(--accent2); }
.prob-body     { padding: 18px; }
.circuit-wrap  { background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 14px; display: flex; align-items: center; justify-content: center; min-height: 90px; padding: 12px; overflow: hidden; }
.circuit-wrap img { max-width: 100%; max-height: 180px; object-fit: contain; border-radius: 4px; }
.question-text { font-size: 13px; color: var(--text); margin-bottom: 14px; line-height: 1.8; }
.answer-row    { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.answer-row input  { width: 120px; }
.answer-row select { width: 78px; }
.action-row    { display: flex; gap: 6px; flex-wrap: wrap; }
.feedback      { font-size: 12px; padding: 10px 14px; border-radius: var(--r); margin-top: 10px; display: none; font-family: var(--mono); line-height: 1.5; }
.feedback.correct { background: var(--green-bg); color: var(--green); border: 0.5px solid var(--green-border); }
.feedback.wrong   { background: var(--red-bg);   color: var(--red);   border: 0.5px solid var(--red-border);   }
.hint-box { font-size: 12px; color: var(--text2); background: var(--bg3); border-left: 2px solid var(--warn); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; margin-top: 10px; display: none; line-height: 1.7; }
.shuffle-btn { border-color: var(--accent3); color: var(--accent); }
.shuffle-btn:hover { background: rgba(157,125,232,.10); }

/* ── Assignments (student) ── */
.assign-list { padding: 1.5rem; display: flex; flex-direction: column; gap: 12px; }
.assign-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); overflow: hidden; transition: border-color .2s; }
.assign-card:hover { border-color: var(--border2); }
.assign-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
.assign-name { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .05em; color: var(--accent2); flex: 1; }
.assign-body { padding: 0 16px 14px; display: none; }
.assign-body.open { display: block; }

/* ── Blog (reader) ── */
.blog-outer   { overflow-y: auto; min-height: calc(100vh - 49px); }
.blog-reader  { padding: 2rem; max-width: 760px; margin: 0 auto; width: 100%; }
.blog-hero    { margin-bottom: 2.5rem; text-align: center; padding-bottom: 2rem; border-bottom: 0.5px solid var(--border); }
.blog-hero-title { font-family: var(--font-display); font-size: 26px; font-weight: 500; letter-spacing: .10em; color: var(--accent2); text-shadow: 0 0 30px rgba(196,168,255,.30); margin-bottom: 8px; }
.blog-hero-sub   { font-size: 13px; color: var(--text3); letter-spacing: .04em; }
.blog-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.filter-chip {
  font-size: 11px; padding: 4px 12px; border-radius: 99px;
  border: 0.5px solid var(--border); background: transparent;
  color: var(--text3); cursor: pointer; font-family: var(--font);
  transition: all .2s; font-weight: 500;
}
.filter-chip:hover  { border-color: var(--accent); color: var(--accent2); }
.filter-chip.active { background: rgba(157,125,232,.15); border-color: var(--accent); color: var(--accent2); }
.blog-grid  { display: flex; flex-direction: column; gap: 14px; }
.blog-card  { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); overflow: hidden; cursor: pointer; transition: all .2s; box-shadow: var(--glow); }
.blog-card:hover { border-color: var(--border2); box-shadow: var(--glow2); transform: translateY(-1px); }
.blog-card-inner   { padding: 20px 22px; }
.blog-card-meta    { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.blog-card-date    { font-size: 11px; color: var(--text4); font-family: var(--mono); }
.blog-card-title   { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: .06em; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.blog-card-excerpt { font-size: 13px; color: var(--text3); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-footer  { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--border); }
.blog-card-author  { font-size: 11px; color: var(--text3); }
.blog-read-more    { margin-left: auto; font-size: 11px; color: var(--accent); font-weight: 500; }
.blog-empty { text-align: center; padding: 4rem; color: var(--text4); }
.blog-empty i { font-size: 40px; display: block; margin-bottom: 12px; }

/* ── Blog (single post) ── */
.post-view   { padding: 2rem; max-width: 720px; margin: 0 auto; width: 100%; }
.post-back   { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); cursor: pointer; margin-bottom: 1.5rem; transition: color .2s; border: none; background: none; font-family: var(--font); }
.post-back:hover { color: var(--accent2); }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 0.5px solid var(--border); }
.post-title  { font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: .08em; color: var(--accent2); line-height: 1.3; margin-bottom: 12px; text-shadow: 0 0 20px rgba(196,168,255,.20); }
.post-meta   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-date   { font-size: 11px; color: var(--text4); font-family: var(--mono); }
.post-content { font-size: 14px; line-height: 1.9; color: var(--text2); }
.post-content h1 { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--accent2); letter-spacing: .06em; margin: 2rem 0 1rem; padding-bottom: 8px; border-bottom: 0.5px solid var(--border); }
.post-content h2 { font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--accent2); letter-spacing: .05em; margin: 1.75rem 0 .75rem; }
.post-content h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 1.5rem 0 .5rem; text-transform: uppercase; letter-spacing: .06em; }
.post-content p  { margin-bottom: 1rem; }
.post-content strong { color: var(--text); font-weight: 700; }
.post-content em     { color: var(--text2); font-style: italic; }
.post-content ul, .post-content ol { margin: 0 0 1rem 1.5rem; }
.post-content li { margin-bottom: .35rem; color: var(--text2); }
.post-content li::marker { color: var(--accent3); }
.post-content blockquote { border-left: 2px solid var(--accent3); padding: .75rem 1.25rem; margin: 1.25rem 0; background: var(--bg3); border-radius: 0 var(--r) var(--r) 0; color: var(--text2); font-style: italic; }
.post-content code { font-family: var(--mono); font-size: 12px; background: var(--bg3); border: 0.5px solid var(--border); padding: 2px 6px; border-radius: 4px; color: var(--accent2); }
.post-content hr { border: none; border-top: 0.5px solid var(--border); margin: 2rem 0; }

/* ── Comments ── */
#post-comments { margin-top: 2.5rem; padding-top: 2rem; border-top: 0.5px solid var(--border); }
.comment-section-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; display: flex; align-items: center; gap: 6px; }
.comment-form-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin: 1.5rem 0 .6rem; display: flex; align-items: center; gap: 6px; }
.comment-row { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 10px; }
.comment-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.comment-author { font-size: 12px; font-weight: 600; color: var(--text); }
.comment-date { font-size: 11px; color: var(--text4); font-family: var(--mono); }
.comment-actions { margin-left: auto; display: flex; gap: 4px; }
.comment-body { font-size: 13px; color: var(--text2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.comment-textarea { width: 100%; min-height: 90px; background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); color: var(--text); font-family: var(--font); font-size: 13px; padding: 10px 12px; resize: vertical; box-sizing: border-box; }
.comment-textarea:focus { outline: none; border-color: var(--accent3); }

/* ── Rich text editor ── */
.rte-toolbar { display: flex; gap: 3px; flex-wrap: wrap; padding: 8px 10px; background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r) var(--r) 0 0; border-bottom: none; }
.rte-btn {
  background: none; border: 0.5px solid transparent; border-radius: 4px;
  padding: 4px 7px; color: var(--text3); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; transition: all .15s; font-family: var(--font);
}
.rte-btn:hover { background: var(--bg4); color: var(--text); border-color: var(--border); }
.rte-sep { width: 0.5px; background: var(--border); margin: 2px 4px; align-self: stretch; }
.rte-select {
  background: var(--bg4); border: 0.5px solid var(--border); border-radius: 4px;
  padding: 3px 6px; color: var(--text2); font-size: 12px; font-family: var(--font);
  cursor: pointer; outline: none; width: auto;
}
#rte-body {
  min-height: 280px;
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: 0 0 var(--r) var(--r);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.9;
  outline: none;
  overflow-y: auto;
}
#rte-body:focus { border-color: var(--accent); }
#rte-body h1 { font-family: var(--font-display); font-size: 20px; color: var(--accent2); margin: .75rem 0 .5rem; }
#rte-body h2 { font-family: var(--font-display); font-size: 16px; color: var(--accent2); margin: .6rem 0 .4rem; }
#rte-body h3 { font-size: 14px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .05em; margin: .5rem 0 .3rem; }
#rte-body p  { margin-bottom: .5rem; }
#rte-body ul, #rte-body ol { margin: .5rem 0 .5rem 1.5rem; }
#rte-body li { margin-bottom: .25rem; }
#rte-body blockquote { border-left: 2px solid var(--accent3); padding: .5rem 1rem; margin: .5rem 0; background: var(--bg4); border-radius: 0 var(--r) var(--r) 0; font-style: italic; color: var(--text2); }
#rte-body code { font-family: var(--mono); font-size: 12px; background: var(--bg4); border: 0.5px solid var(--border); padding: 1px 5px; border-radius: 3px; color: var(--accent2); }
#rte-body[data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--text4); pointer-events: none; }

/* ── Editor shell ── */
.editor-shell { display: flex; flex-direction: column; min-height: calc(100vh - 49px); }
.editor-top-tabs { display: flex; gap: 2px; padding: 10px 20px 0; border-bottom: 0.5px solid var(--border); background: var(--bg2); }
.editor-top-tab {
  padding: 7px 18px; border-radius: var(--r) var(--r) 0 0;
  font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text3);
  border: 0.5px solid transparent; background: transparent;
  font-family: var(--font); transition: all .2s; margin-bottom: -0.5px;
}
.editor-top-tab:hover { color: var(--text); }
.editor-top-tab.active { color: var(--accent2); background: var(--bg); border-color: var(--border); border-bottom-color: var(--bg); }
.editor-view { display: none; flex: 1; overflow: hidden; }
.editor-view.active { display: flex; }
.editor-two { display: grid; grid-template-columns: 1fr 290px; flex: 1; overflow: hidden; }
.editor-main { padding: 1.25rem; overflow-y: auto; border-right: 0.5px solid var(--border); }
.editor-side { padding: 1.25rem; overflow-y: auto; background: var(--bg2); }
.var-row { display: grid; grid-template-columns: 80px 56px 62px 62px 24px; gap: 6px; align-items: end; margin-bottom: 6px; }
.var-row input, .var-row select { padding: 6px 8px; font-size: 12px; }
.add-var-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); cursor: pointer; padding: 4px 0; border: none; background: none; font-family: var(--font); font-weight: 500; }
.remove-var { background: none; border: none; color: var(--text4); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.remove-var:hover { color: var(--red); }
.formula-preview { font-family: var(--mono); font-size: 12px; background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r); padding: 8px 10px; margin-top: 6px; color: var(--accent2); min-height: 32px; }
.img-drop { border: 1.5px dashed var(--border); border-radius: var(--r2); padding: 16px; text-align: center; cursor: pointer; color: var(--text3); font-size: 12px; transition: all .2s; position: relative; }
.img-drop:hover { border-color: var(--accent); color: var(--accent); }
.img-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.img-thumb { max-width: 100%; max-height: 100px; border-radius: var(--r); margin-top: 8px; object-fit: contain; }
.syntax-tip { font-size: 11px; color: var(--text3); background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r); padding: 8px 10px; margin-top: 6px; line-height: 1.8; }
.syntax-tip code { font-family: var(--mono); color: var(--accent2); background: var(--bg4); padding: 1px 5px; border-radius: 3px; }
.var-chips-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.var-chip-btn { font-family: var(--mono); font-size: 11px; background: var(--bg4); border: 0.5px solid var(--border); border-radius: 99px; padding: 2px 9px; cursor: pointer; color: var(--accent2); transition: all .2s; }
.var-chip-btn:hover { background: var(--accent3); border-color: transparent; color: #fff; }

/* ── Problem manager list ── */
.pm-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 5px; cursor: pointer; transition: all .2s; user-select: none; }
.pm-row:hover { border-color: var(--border2); }
.pm-row.disabled-row { opacity: .45; }
.pm-row.dragging  { opacity: .40; }
.pm-row.drag-over { border-color: var(--accent); border-style: dashed; }
.pm-drag-handle   { color: var(--text4); cursor: grab; font-size: 15px; display: flex; align-items: center; }
.pm-row-body,
.pm-row-info      { flex: 1; min-width: 0; }
.pm-row-title     { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pm-row-meta      { font-size: 10px; color: var(--text3); font-family: var(--mono); margin-top: 1px; }
.pm-row-actions   { display: flex; gap: 3px; flex-shrink: 0; align-items: center; }
.pm-icon-btn { background: none; border: 0.5px solid var(--border); border-radius: var(--r); padding: 4px 7px; color: var(--text3); cursor: pointer; display: flex; align-items: center; font-size: 12px; transition: all .2s; }
.pm-icon-btn:hover     { border-color: var(--accent); color: var(--accent); }
.pm-icon-btn.del:hover { border-color: var(--red);    color: var(--red); }

/* ── Topic folders ── */
.topic-manager    { padding: 1.25rem; overflow-y: auto; flex: 1; }
.folder-card      { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 10px; overflow: hidden; }
.folder-head      { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg3); }
.folder-name      { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .06em; flex: 1; color: var(--accent2); }
.folder-prob-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg3); border: 0.5px solid var(--border); border-radius: 99px; padding: 3px 10px; font-size: 11px; color: var(--text2); }
.folder-prob-chip button { background: none; border: none; color: var(--text4); cursor: pointer; font-size: 12px; display: flex; align-items: center; padding: 0; }
.folder-prob-chip button:hover { color: var(--red); }
.add-to-folder-row { display: flex; gap: 6px; padding: 0 14px 10px; align-items: center; }
.add-to-folder-row select { flex: 1; font-size: 12px; padding: 5px 8px; }

/* ── Assignments editor ── */
.assign-editor     { padding: 1.25rem; overflow-y: auto; flex: 1; }
.assign-editor-two { display: grid; grid-template-columns: 1fr 280px; gap: 14px; }
.assign-prob-picker { background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r2); padding: 10px; max-height: 260px; overflow-y: auto; }
.assign-prob-picker-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 0.5px solid var(--border); font-size: 12px; }
.assign-prob-picker-row:last-child { border-bottom: none; }
.assign-prob-picker-row label { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text2); cursor: pointer; display: flex; align-items: center; gap: 8px; flex: 1; margin: 0; }
.assign-prob-picker-row input[type=checkbox] { width: auto; cursor: pointer; }
.assign-pts-input { width: 55px; padding: 3px 6px; font-size: 11px; text-align: center; }

/* ── Blog editor ── */
.blog-editor      { padding: 1.25rem; overflow-y: auto; flex: 1; }
.blog-editor-two  { display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start; }
.blog-post-row    { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 6px; cursor: pointer; transition: all .2s; }
.blog-post-row:hover    { border-color: var(--border2); }
.blog-post-row.selected { border-color: var(--accent); background: var(--bg3); }
.blog-post-row-body     { flex: 1; min-width: 0; }
.blog-post-row-title    { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.blog-post-row-meta     { font-size: 10px; color: var(--text3); font-family: var(--mono); margin-top: 1px; }
.blog-post-row-actions  { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Admin panel ── */
.admin-area  { padding: 1.5rem; overflow-y: auto; flex: 1; min-height: calc(100vh - 49px); }
.dash-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.metric-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); padding: 14px; box-shadow: var(--glow); }
.metric-label{ font-size: 9px; font-weight: 700; color: var(--text4); text-transform: uppercase; letter-spacing: .10em; margin-bottom: 4px; }
.metric-value{ font-size: 22px; font-family: var(--mono); font-weight: 500; color: var(--accent2); }
.metric-sub  { font-size: 10px; color: var(--text3); margin-top: 2px; }
.dash-section { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--r2); margin-bottom: 14px; overflow: hidden; }
.dash-head    { padding: 10px 14px; border-bottom: 0.5px solid var(--border); font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.dash-table   { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th { padding: 8px 14px; text-align: left; color: var(--text4); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 0.5px solid var(--border); }
.dash-table td { padding: 8px 14px; border-bottom: 0.5px solid var(--border); color: var(--text2); }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table td:first-child { color: var(--text); font-family: var(--mono); }
.acc-bar-outer { width: 55px; height: 3px; background: var(--bg3); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 5px; }
.acc-bar-inner { height: 100%; border-radius: 99px; }
.admin-tabs { display: flex; gap: 2px; margin-bottom: 1.25rem; border-bottom: 0.5px solid var(--border); }
.admin-tab {
  padding: 7px 16px; border-radius: var(--r) var(--r) 0 0;
  font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text3);
  border: none; background: transparent; font-family: var(--font);
  transition: all .2s; margin-bottom: -0.5px;
}
.admin-tab.active { color: var(--accent2); background: var(--bg2); border: 0.5px solid var(--border); border-bottom-color: var(--bg2); }
.admin-subtab { display: none; }
.admin-subtab.active { display: block; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 0.5px solid var(--border); font-size: 12px; }
.user-row:last-child { border-bottom: none; }
.user-row .un { font-family: var(--mono); color: var(--text); flex: 1; }

/* ── Homepage ────────────────────────────────── */
.home-outer {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}
.home-hero {
  text-align: center;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 0.5px solid var(--border);
}
.home-hero-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .10em;
  color: var(--accent2);
  text-shadow: 0 0 30px rgba(196,168,255,.30);
  margin-bottom: 4px;
}
.home-hero-sub {
  font-size: 12px;
  color: var(--text3);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* Stats bar */
.home-stats-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.home-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-right: 0.5px solid var(--border);
}
.home-stat:last-child { border-right: none; }
.home-stat-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.home-stat-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Banner */
.home-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(157,125,232,.08);
  border: 0.5px solid var(--accent3);
  border-left: 3px solid var(--accent);
  border-radius: var(--r2);
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.7;
}
.home-banner-text { flex: 1; }

/* Sections */
.home-section {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.home-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Blog post cards on homepage */
.home-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
}
.home-post-card {
  padding: 14px 16px;
  cursor: pointer;
  border-right: 0.5px solid var(--border);
  transition: background .2s;
}
.home-post-card:last-child { border-right: none; }
.home-post-card:hover { background: var(--bg3); }
.home-post-meta  { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.home-post-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
.home-post-excerpt { font-size: 11px; color: var(--text3); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Assignment rows on homepage */
.home-assign-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background .2s;
}
.home-assign-row:last-child { border-bottom: none; }
.home-assign-row:hover { background: var(--bg3); }
.home-assign-info { flex: 1; min-width: 0; }
.home-assign-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-assign-due  { font-size: 11px; color: var(--text3); font-family: var(--mono); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.home-assign-prog { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.home-assign-bar-outer { width: 80px; height: 4px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.home-assign-bar-inner { height: 100%; background: linear-gradient(90deg, var(--accent3), var(--accent)); border-radius: 99px; transition: width .4s; }

/* ── Topic label manager ─────────────────────── */
.topic-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
}
.topic-label-chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent2);
  background: rgba(157,125,232,.10);
  border: 0.5px solid rgba(157,125,232,.25);
  border-radius: 99px;
  padding: 3px 12px;
  font-family: var(--mono);
}

/* ── Answer mode tabs (Boxes / Table / Both) ─── */
.answer-mode-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg4);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  padding: 3px;
}
.answer-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  background: transparent;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.answer-mode-tab:hover { background: var(--bg3); color: var(--text2); }
.answer-mode-tab.active {
  background: var(--accent);
  color: #fff;
}

/* ── Multi-answer boxes ──────────────────────── */
.answer-box {
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  padding: 12px;
  margin-bottom: 10px;
}
.answer-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.answer-box-label-input {
  background: var(--bg4) !important;
  border-color: var(--border2) !important;
  font-weight: 600;
  color: var(--accent2) !important;
}
/* In practice card */
.multi-ans-row {
  margin-bottom: 4px;
}
.multi-ans-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 4px;
}

/* ── Sidebar drag-over state ─────────────────── */
.sb-drag-over > .sb-folder-head {
  background: var(--bg4) !important;
  border: 0.5px dashed var(--accent) !important;
  border-radius: var(--r);
}

/* ── Folder problem rows (draggable) ─────────── */
.folder-prob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  transition: all .15s;
  user-select: none;
}
.folder-prob-row:hover { border-color: var(--border2); }
.folder-prob-drag-over {
  border-color: var(--accent) !important;
  border-style: dashed !important;
  background: var(--bg4) !important;
}

/* ── Grade view shell ────────────────────────── */
.grade-shell {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  margin-top: 1rem;
}
.grade-shell-head {
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--border);
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
}
.grade-view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg3);
  overflow-x: auto;
}
.grade-view-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text3);
  background: transparent;
  border: none;
  border-right: 0.5px solid var(--border);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.grade-view-tab:hover { color: var(--text); background: var(--bg4); }
.grade-view-tab.active {
  color: var(--accent2);
  background: var(--bg2);
  border-bottom-color: var(--accent);
}
#grade-view-content {
  padding: 16px 18px;
  min-height: 200px;
}

/* ── Chart containers ────────────────────────── */
.chart-wrap { display: flex; flex-direction: column; gap: 12px; }
.chart-stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: .05em;
  margin-top: 4px;
}
.chart-subtitle {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}

/* Spinner for loading state */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Gradebook (admin tab) ───────────────────── */
.gb-step-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent3);
  text-transform: uppercase;
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.gb-step-label::after { content:''; flex:1; height:0.5px; background:var(--border); }

.gb-drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--r2);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  color: var(--text3);
  font-size: 12px;
  transition: all .2s;
  position: relative;
}
.gb-drop-zone:hover, .gb-drop-zone.gb-drag-over {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(157,125,232,.04);
}

.gb-cat-row {
  display: grid;
  grid-template-columns: 1fr 54px 20px;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}
.gb-cat-row input { padding: 5px 7px; font-size: 11px; }

.gb-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  border: 0.5px solid var(--border);
  background: var(--bg4);
  color: var(--text3);
  transition: all .15s;
  user-select: none;
  line-height: 1.4;
}
.gb-chip:hover { border-color: var(--border2); color: var(--text2); }
.gb-chip.gb-assigned { border-color: var(--accent); background: rgba(157,125,232,.12); color: var(--accent2); }
.gb-chip.gb-skipped  { opacity: .3; text-decoration: line-through; }

.gb-scale-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 20px;
  gap: 4px;
  align-items: center;
  margin-bottom: 3px;
}
.gb-scale-row input { padding: 4px 6px; font-size: 11px; }

.gb-grade-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}
.gb-gA { color: var(--green); background: rgba(74,222,128,.10); border: 0.5px solid rgba(74,222,128,.25); }
.gb-gB { color: var(--blue);  background: rgba(96,165,250,.10);  border: 0.5px solid rgba(96,165,250,.25); }
.gb-gC { color: var(--warn);  background: rgba(251,191,36,.10);  border: 0.5px solid rgba(251,191,36,.25); }
.gb-gD { color: #f97316;      background: rgba(249,115,22,.10);  border: 0.5px solid rgba(249,115,22,.25); }
.gb-gF { color: var(--red);   background: rgba(248,113,113,.10); border: 0.5px solid rgba(248,113,113,.25); }

.gb-dist-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 11px; }
.gb-dist-outer { flex: 1; height: 14px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.gb-dist-inner { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* ── Calendar ────────────────────────────────── */
#cal-modal { align-items: center; justify-content: center; }
#cal-modal[style*="flex"] { display: flex !important; }

/* ── Blog search + author filter (added) ─────── */
.blog-controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.blog-search {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 200px;
}
.blog-search > .ti-search {
  position: absolute; left: 11px; font-size: 15px; color: var(--text4); pointer-events: none;
}
.blog-search input {
  width: 100%; padding: 9px 32px 9px 32px; font-size: 13px;
  background: var(--bg3); border: 0.5px solid var(--border); border-radius: var(--r2);
  color: var(--text1);
}
.blog-search input:focus { outline: none; border-color: var(--accent); }
.blog-search-clear {
  position: absolute; right: 6px; background: none; border: 0; cursor: pointer;
  color: var(--text4); padding: 4px; display: flex; align-items: center;
}
.blog-search-clear:hover { color: var(--text2); }
#blog-author-filter {
  padding: 9px 10px; font-size: 12px; background: var(--bg3);
  border: 0.5px solid var(--border); border-radius: var(--r2); color: var(--text2);
  min-width: 150px;
}
.blog-no-results {
  text-align: center; padding: 2.5rem; color: var(--text4); font-size: 13px;
}

/* ── Problem analysis table (added) ──────────── */
.pa-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pa-table th, .pa-table td {
  padding: 8px 10px; text-align: left; border-bottom: 0.5px solid var(--border);
  white-space: nowrap;
}
.pa-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3);
  cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--bg2);
}
.pa-table th:hover { color: var(--accent2); }
.pa-table th .pa-arrow { font-size: 9px; color: var(--accent2); margin-left: 3px; }
.pa-table td.pa-title {
  white-space: normal; max-width: 260px; color: var(--text1); font-weight: 500;
}
.pa-table tr:hover td { background: rgba(255,255,255,.02); }
.pa-stars { color: var(--warn); letter-spacing: 1px; }
/* ── Audit log ─────────────────────── */
.al-row { display:flex; gap:12px; padding:10px 14px; border-bottom:0.5px solid var(--border); align-items:flex-start; }
.al-row:last-child { border-bottom:none; }
.al-row-icon { width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--bg3); flex-shrink:0; font-size:13px; margin-top:1px; }
.al-row-body { flex:1; min-width:0; }
.al-row-top { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.al-row-action { font-size:12px; font-weight:600; }
.al-row-admin, .al-row-time { font-size:11px; color:var(--text4); font-family:var(--mono); display:flex; align-items:center; gap:3px; }
.al-row-details { margin-top:3px; font-size:11px; color:var(--text3); font-family:var(--mono); display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.al-detail-key { color:var(--text4); }
.al-detail-sep { color:var(--text4); }
.al-detail-val { color:var(--text2); }
.al-detail-dot { color:var(--border); padding:0 2px; }
.al-pill { padding:3px 9px; border-radius:999px; font-size:11px; border:0.5px solid var(--border); background:var(--bg3); color:var(--text3); cursor:pointer; display:inline-flex; align-items:center; gap:4px; transition:border-color .15s,color .15s; }
.al-pill:hover { border-color:var(--text3); }
.al-pill-active { border-color:var(--al-pill-color, var(--accent2)); color:var(--al-pill-color, var(--accent2)); background:rgba(157,125,232,.08); }
