:root {
  --bg: #08080a;
  --paper: #111114;
  --paper-2: #17171b;
  --ink: #ececef;
  --muted: #8b8b96;
  --line: #26262d;
  --accent: #c6ff3d;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(198, 255, 61, .09);
  --danger: #ff4d5e;
  --t-test: #ff4d5e;
  --t-lectie: #c6ff3d;
  --t-notite: #ffc94d;
  --t-rezolvare: #7aa2ff;
  --t-altele: #a0a0aa;
  --radius: 10px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 10px 30px rgba(0, 0, 0, .45);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink);
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(198, 255, 61, .07), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(122, 162, 255, .06), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--bg);
  background-attachment: fixed;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(8, 8, 10, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo { display: block; width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 18px rgba(198, 255, 61, .35); }
#nav { display: flex; gap: 8px; align-items: center; position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column;
}
.menu a, .menu button { all: unset; cursor: pointer; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--accent-soft); }
.menu-who { padding: 6px 10px 8px; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

main { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 44px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .92rem; }
.btn:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row > div { min-width: 0; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.err { color: var(--danger); font-size: .92rem; min-height: 1.4em; margin-top: 8px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.narrow { max-width: 440px; margin: 6vh auto 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; }
.tabs button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }

/* breadcrumbs */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); }

/* home */
.head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head p { color: var(--muted); margin: 0; }
.searchbar { display: flex; gap: 8px; margin: 0 0 20px; }
.searchbar input { flex: 1; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.tile:hover { border-color: var(--accent); }
.tile strong { display: block; font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .88rem; }
.section-title { margin: 28px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-title h2 { margin: 0; }

/* teachers */
.teachers { display: grid; gap: 8px; }
.teacher {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink);
}
.teacher:hover { border-color: var(--accent); }
.count { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1 1 160px; min-width: 0; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select { width: auto; min-width: 130px; flex: 1 1 130px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 36px; }
.chip[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* materials */
.mats { display: grid; gap: 10px; }
.mat {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: var(--ink);
}
.mat:hover { border-color: var(--accent); }
.thumb { width: 64px; height: 64px; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--accent); font-size: .8rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.mat h3 { font-size: 1rem; margin: 0 0 4px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.desc { font-size: .9rem; margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.badge.test { color: var(--t-test); }
.badge.lectie { color: var(--t-lectie); }
.badge.notite { color: var(--t-notite); }
.badge.rezolvare { color: var(--t-rezolvare); }
.badge.altele { color: var(--t-altele); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* detail */
.detail h1 { overflow-wrap: anywhere; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 16px 0; }
.gallery button { all: unset; cursor: zoom-in; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3/4; background: var(--accent-soft); }
.gallery button:focus-visible { outline: 2px solid var(--accent); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files { display: grid; gap: 8px; margin: 12px 0; }
.file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.file span { overflow-wrap: anywhere; }
.textbody { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: .98rem; }

/* upload */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--paper);
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.picked { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); margin-top: 10px; }
.picked div { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--accent-soft); display: grid; place-items: center; font-size: .75rem; text-align: center; padding: 4px; overflow-wrap: anywhere; }
.picked img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.picked button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
progress { width: 100%; height: 10px; margin-top: 12px; accent-color: var(--accent); }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; }
code.code { font-size: 1rem; font-weight: 700; letter-spacing: .05em; background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; }
.muted { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); }
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 40; display: grid; place-items: center; padding: 12px; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; line-height: 1; }
.loading { color: var(--muted); padding: 20px 0; }
[hidden] { display: none !important; }

/* anonimat */
.privacy { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-soft); font-size: .9rem; }
.privacy h2 { font-size: 1rem; margin-bottom: 6px; }
.privacy ul { margin: 0; padding-left: 18px; }
.privacy li { margin: 3px 0; }
.bigid { font-size: 2.6rem; font-weight: 800; letter-spacing: .18em; text-align: center; padding: 14px; margin: 10px 0 14px; border: 2px dashed var(--accent); border-radius: var(--radius); color: var(--accent); font-variant-numeric: tabular-nums; }
.warn { color: var(--danger); font-weight: 600; }
.footnote { margin-top: 36px; text-align: center; color: var(--muted); font-size: .85rem; }
.footnote a { color: var(--muted); }


/* ---------- tema dark: detalii ---------- */
h1 { letter-spacing: -.02em; }
h1, .section-title h2 { font-family: var(--mono); }
.btn.primary { box-shadow: 0 0 22px rgba(198, 255, 61, .18); }
.btn.primary:hover { filter: brightness(1.08); }
.tile { border-left-color: var(--line); background: linear-gradient(180deg, var(--paper-2), var(--paper)); transition: border-color .15s, transform .15s; }
.tile:hover { border-left-color: var(--accent); transform: translateY(-1px); }
.tile strong { font-family: var(--mono); font-size: .98rem; }
.badge { font-family: var(--mono); letter-spacing: .06em; border-radius: 4px; }
.chip { font-family: var(--mono); font-size: .82rem; border-radius: 6px; }
.thumb { color: var(--muted); font-family: var(--mono); }
.menu-who, code, .code, .bigid { font-family: var(--mono); }
code.code { color: var(--accent); background: var(--accent-soft); }
#toast { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }
input::placeholder, textarea::placeholder { color: #5d5d66; }
.empty { font-family: var(--mono); font-size: .9rem; }

/* pagina de anonimat */
.anon .kicker { font-family: var(--mono); color: var(--accent); margin: 0 0 6px; letter-spacing: .08em; }
.anon h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); max-width: 18ch; }
.anon .lead { color: var(--muted); max-width: 62ch; font-size: 1.05rem; }
.anon h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; font-family: var(--mono); }
.twocol { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
@media (max-width: 720px) { .twocol { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { padding-left: 24px; position: relative; overflow-wrap: anywhere; }
.checklist li::before { content: "›"; position: absolute; left: 6px; color: var(--muted); }
.checklist li.notstored::before { content: "✕"; left: 4px; color: var(--danger); font-weight: 700; }
.checklist li.notstored { color: var(--ink); }
.checklist li.stored::before { content: "✓"; left: 4px; color: var(--accent); font-weight: 700; }
.privacy { background: var(--paper); border-color: var(--line); border-left: 3px solid var(--accent); }
.privacy-more { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: .88rem; }
.danger-zone { border-color: rgba(255, 77, 94, .35); }
.warnbox { border-color: rgba(255, 201, 77, .35); }
.warnbox h2 { color: var(--t-notite); }
.datadump { margin-top: 12px; }
.datadump th { width: 40%; }

.linkcode { display: inline-block; margin: 4px 0; overflow-wrap: anywhere; font-size: .85rem; }

.reqs { display: grid; gap: 8px; margin-top: 10px; }
.reqrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.reqnote { margin-top: 4px; overflow-wrap: anywhere; }
.reqbtns { display: flex; gap: 8px; }
