:root {
  --paper: #faf6f0;
  --paper-2: #f3ece2;
  --card: #fffdf9;
  --ink: #2a2420;
  --ink-2: #4a413a;
  --muted: #7a6f65;
  --line: #e7ddd0;
  --line-2: #d8cbbb;
  --rust: #a4512b;
  --rust-dark: #823e1f;
  --rust-soft: #f5e4d9;
  --sage: #6f8a69;
  --sage-dark: #48603f;
  --sage-soft: #e5ece1;
  --amber: #b9821e;
  --amber-soft: #f8ecd2;
  --red: #b1382c;
  --red-soft: #f8dfda;
  --blue-soft: #e3eaf1;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --shadow-lg: 0 10px 40px rgba(60, 40, 20, .18);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 2rem; font-variation-settings: "opsz" 72; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .88rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(164, 81, 43, .35); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(250, 246, 240, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rust); display: inline-block; transform: translateY(-2px); }
.brand em { font-style: italic; font-weight: 400; color: var(--rust); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--paper-2); text-decoration: none; }
.nav a.on { background: var(--ink); color: #fff; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.iconbtn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; }
.iconbtn:hover { border-color: var(--line-2); }
.iconbtn .badge-dot { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rust); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark); display: grid; place-items: center; font-weight: 700; cursor: pointer; border: 1px solid var(--line); }
.menu { position: absolute; right: 0; top: 46px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 240px; padding: 6px; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--paper-2); text-decoration: none; }
.menu .menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rel { position: relative; }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px; }
.narrow { max-width: 820px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack > * + * { margin-top: 14px; }
.spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.flat { box-shadow: none; }
.card.soft { background: var(--paper-2); box-shadow: none; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title h2, .section-title h3 { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--muted); }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn.primary:hover { background: var(--rust-dark); border-color: var(--rust-dark); }
.btn.sage { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 6px 12px; font-size: .9rem; }
.btn.lg { padding: 13px 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--rust); cursor: pointer; padding: 0; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; color: var(--ink-2); }
label.f > span .hint { font-weight: 400; color: var(--muted); }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(164, 81, 43, .15); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.auto-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); margin-left: 6px; vertical-align: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 500; font-size: .93rem; user-select: none; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .x { cursor: pointer; opacity: .6; }
.taginput { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.taginput input { border: 0; flex: 1; min-width: 140px; padding: 4px; box-shadow: none !important; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); font-size: .9rem; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 0 0 2px; font-size: 1rem; line-height: 1; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--sage-dark); }
.switch input:checked + .track::after { left: 20px; }
input[type=range] { width: 100%; accent-color: var(--rust); }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.q1 { background: #2f4a2a; color: #fff; }
.pill.q2 { background: var(--sage-dark); color: #fff; }
.pill.q3 { background: var(--sage-soft); color: var(--sage-dark); }
.pill.q4 { background: var(--paper-2); color: var(--muted); }
.pill.rust { background: var(--rust-soft); color: var(--rust-dark); }
.pill.sage { background: var(--sage-soft); color: var(--sage-dark); }
.pill.amber { background: var(--amber-soft); color: #7a5410; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.ink { background: var(--ink); color: #fff; }
.pill.outline { background: transparent; border: 1px solid var(--line-2); font-weight: 600; }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--blue-soft); color: #2b3c4e; font-size: .95rem; }
.notice.amber { background: var(--amber-soft); color: #6d4a0c; }
.notice.red { background: var(--red-soft); color: #7e2219; }
.notice.sage { background: var(--sage-soft); color: var(--sage-dark); }
.notice .ic { font-size: 1.1rem; line-height: 1.3; }
.notice p:last-child { margin: 0; }

/* ---------- Home / projects ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.hero p { color: var(--muted); max-width: 620px; margin: 0; font-size: 1.05rem; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); color: var(--ink); transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.pcard h3 { margin: 6px 0 6px; }
.pcard .mstitle { color: var(--ink-2); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .meta { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.newcard { display: grid; place-items: center; border: 2px dashed var(--line-2); border-radius: var(--radius); min-height: 150px; color: var(--muted); cursor: pointer; background: transparent; font-weight: 600; }
.newcard:hover { border-color: var(--rust); color: var(--rust); }
.empty { text-align: center; padding: 50px 20px; }
.empty .glyph { font-family: var(--serif); font-size: 3.2rem; color: var(--rust); line-height: 1; margin-bottom: 10px; }

/* ---------- Stepper ---------- */
.phead { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.phead h1 { margin: 2px 0 2px; font-size: 1.75rem; }
.stepper { display: flex; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px; margin-bottom: 26px; overflow-x: auto; box-shadow: var(--shadow); }
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; border: 0; background: none; font-size: .95rem; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; font-size: .8rem; }
.step.done { color: var(--sage-dark); }
.step.done .n { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.step.on { background: var(--ink); color: #fff; }
.step.on .n { border-color: #fff; }
.step.locked { opacity: .45; cursor: not-allowed; }

/* ---------- Choice cards (input mode) ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.choice { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 26px; cursor: pointer; transition: all .15s; }
.choice:hover { border-color: var(--rust); transform: translateY(-2px); }
.choice.on { border-color: var(--rust); box-shadow: 0 0 0 4px var(--rust-soft); }
.choice .big { font-family: var(--serif); font-size: 2.2rem; color: var(--rust); line-height: 1; }
.choice h3 { margin: 12px 0 6px; }
.dropzone { display: block; border: 2px dashed var(--line-2); border-radius: 16px; padding: 38px 20px; text-align: center; background: #fff; cursor: pointer; transition: all .15s; }
.dropzone.drag, .dropzone:hover { border-color: var(--rust); background: var(--rust-soft); }
.dropzone .big { font-family: var(--serif); font-size: 1.3rem; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--sage-dark)); border-radius: 4px; transition: width .4s; }
.progress.indet > i { width: 35% !important; animation: indet 1.3s infinite ease-in-out; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line-2); border-top-color: var(--rust); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: flex; gap: 16px; align-items: center; padding: 26px; }

/* ---------- Shortlist ---------- */
.sl-layout { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.filters { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.filters .fgroup { margin-bottom: 18px; }
.ftoggle { display: none; }
.filters .fgroup > .lab { font-weight: 700; font-size: .85rem; margin-bottom: 7px; color: var(--ink-2); display: flex; justify-content: space-between; }
.jcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; transition: border .15s; }
.jcard.sel { border-color: var(--rust); box-shadow: 0 0 0 3px var(--rust-soft), var(--shadow); }
.jcard.disc { border-left: 5px solid var(--red); }
.jtop { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.rank { font-family: var(--serif); font-size: 1.6rem; color: var(--line-2); font-weight: 600; width: 34px; text-align: center; line-height: 1.2; }
.jtitle { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.jtitle:hover { color: var(--rust); }
.jmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: .9rem; color: var(--muted); }
.total { text-align: center; min-width: 74px; }
.ring { --v: 50; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--rust) calc(var(--v) * 1%), var(--paper-2) 0); display: grid; place-items: center; margin: 0 auto; }
.ring b { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-family: var(--serif); font-size: 1.15rem; }
.total small { display: block; color: var(--muted); font-size: .72rem; margin-top: 3px; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin: 14px 0 4px 50px; }
.bar { display: grid; grid-template-columns: 62px 1fr 38px; align-items: center; gap: 8px; font-size: .88rem; }
.bar .lab { color: var(--muted); font-weight: 600; }
.bar .track { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 4px; background: var(--sage); }
.bar.topic .track i { background: var(--rust); }
.bar .val { font-weight: 700; text-align: right; }
.similar { margin: 12px 0 0 50px; padding: 12px 14px; background: var(--paper); border-radius: 10px; border: 1px solid var(--line); }
.similar .eyebrow { margin-bottom: 4px; }
.similar ol { margin: 0; padding-left: 20px; }
.similar li { font-size: .93rem; margin: 3px 0; color: var(--ink-2); }
.jfoot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 0 50px; }
.selbox { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); cursor: pointer; font-weight: 600; font-size: .92rem; user-select: none; background: #fff; }
.selbox input { accent-color: var(--rust); width: 17px; height: 17px; }
.selbox.on { border-color: var(--rust); background: var(--rust-soft); color: var(--rust-dark); }
.why { margin: 10px 0 0 50px; font-size: .9rem; color: var(--muted); }
.actionbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 12px 10px 24px; display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow-lg); z-index: 25; max-width: calc(100vw - 32px); }
.actionbar .muted { color: #c8bdb2; }

/* ---------- Journal page ---------- */
.jhead { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.jhead h1 { font-size: 2rem; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 22px; overflow-x: auto; }
.tab { padding: 10px 16px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--rust); border-bottom-color: var(--rust); }
.notes { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.paper { background: var(--card); border: 1px solid var(--line); border-radius: 6px 18px 18px 6px; padding: 34px 38px; box-shadow: var(--shadow); position: relative; }
.paper::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: rgba(164, 81, 43, .18); }
.paper .synth p { font-size: 1.06rem; line-height: 1.7; }
.paper h3 { margin-top: 26px; }
.statline { padding: 10px 0; border-bottom: 1px dashed var(--line); line-height: 1.65; }
.statline:last-child { border-bottom: 0; }
.num { display: inline-block; font-weight: 700; color: var(--rust-dark); background: var(--rust-soft); padding: 0 6px; border-radius: 6px; cursor: pointer; border: 0; font: inherit; font-weight: 700; }
.num:hover { background: var(--rust); color: #fff; }
.distrib { margin: 6px 0 4px; }
.drow { display: grid; grid-template-columns: 180px 1fr 70px; gap: 10px; align-items: center; padding: 4px 0; font-size: .93rem; cursor: pointer; border-radius: 6px; }
.drow:hover { background: var(--paper); }
.drow .track { height: 10px; background: var(--paper-2); border-radius: 5px; overflow: hidden; }
.drow .track i { display: block; height: 100%; background: var(--sage); border-radius: 5px; }
.drow.me .track i { background: var(--rust); }
.drow .v { text-align: right; font-weight: 700; color: var(--ink-2); }
.side .card { margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.gap-item { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line-2); border-radius: 12px; padding: 18px 22px; margin-bottom: 14px; }
.gap-item.tinggi { border-left-color: var(--red); }
.gap-item.sedang { border-left-color: var(--amber); }
.gap-item.rendah { border-left-color: var(--sage); }
.gap-item.info { border-left-color: #a9b8c9; background: var(--paper); }
.gap-item h3 { margin: 6px 0 8px; font-size: 1.12rem; }
.gap-item p { font-size: 1.02rem; line-height: 1.7; margin-bottom: 8px; }
.prose h3 { margin-top: 22px; }
.prose p { font-size: 1.04rem; line-height: 1.72; }
.refs li { margin-bottom: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.t th { text-align: left; font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* ---------- Plan ---------- */
.plan { counter-reset: tier; }
.prow { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.prow.t1 { border: 2px solid var(--rust); }
.tier { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; }
.tier small { display: block; font-family: var(--sans); font-weight: 500; color: var(--muted); font-size: .8rem; }
.prow .jt { font-weight: 600; }
.arrows { display: flex; gap: 4px; }
.arrows button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.arrows button:hover { border-color: var(--ink); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }

/* ---------- Drawer / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(42, 36, 32, .35); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--paper); z-index: 51; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer header { padding: 20px 24px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer header h2 { font-size: 1.25rem; margin: 0; }
.drawer .body { padding: 18px 24px 40px; overflow: auto; flex: 1; }
.art { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.art .t { font-weight: 600; line-height: 1.35; }
.art .facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border-radius: 18px; z-index: 51; box-shadow: var(--shadow-lg); padding: 26px; animation: fade .15s; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: slide .2s; display: flex; gap: 12px; align-items: flex-start; }
.toast.ok { background: var(--sage-dark); }
.toast.err { background: var(--red); }
.toast a { color: #fff; text-decoration: underline; font-weight: 700; }
.jobs-menu { width: 380px; max-height: 460px; overflow: auto; }
.jobitem { padding: 10px 12px; border-radius: 8px; }
.jobitem + .jobitem { border-top: 1px solid var(--line); }
.jobitem .progress { margin-top: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art-side { background: var(--ink); color: #f4ece2; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art-side h1 { color: #fff; font-size: 2.8rem; line-height: 1.08; font-weight: 500; }
.login .art-side h1 em { color: #e59a73; }
.login .art-side .lines { position: absolute; right: -60px; bottom: -40px; opacity: .14; font-family: var(--serif); font-size: 15rem; line-height: .8; color: #e59a73; }
.login .form-side { display: grid; place-items: center; padding: 40px 24px; }
.login form { width: min(380px, 100%); }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }
.sidenav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { padding: 9px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.sidenav a:hover { background: var(--paper-2); text-decoration: none; }
.sidenav a.on { background: var(--card); box-shadow: var(--shadow); color: var(--rust); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .88rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); font-weight: 700; color: var(--muted); font-size: .85rem; }
.checklist .ck.ok { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }

.meter { height: 10px; background: var(--paper-2); border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sage); }
.meter.warn i { background: var(--amber); }
.meter.over i { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sl-layout, .notes, .admin-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .ftoggle { display: inline-flex; }
  .filters.collapsed > :not(.fhead) { display: none; }
  .filters.collapsed .fhead { margin-bottom: 0 !important; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; }
  .login { grid-template-columns: 1fr; }
  .login .art-side { padding: 36px 24px; min-height: 260px; }
  .login .art-side h1 { font-size: 2rem; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 20px 16px 120px; }
  .topbar-in { padding: 10px 16px; gap: 10px; }
  .brand em, .nav { display: none; }
  .choices, .grid2, .grid3 { grid-template-columns: 1fr; }
  .scores, .similar, .jfoot, .why { margin-left: 0; }
  .scores { grid-template-columns: 1fr; }
  .jtop { grid-template-columns: 1fr auto; }
  .rank { display: none; }
  .paper { padding: 24px 20px 24px 30px; }
  .paper::before { left: 14px; }
  .drow { grid-template-columns: 110px 1fr 54px; }
  .prow { grid-template-columns: 1fr; }
  .step .t { display: none; }
  .actionbar { border-radius: 16px; flex-wrap: wrap; justify-content: center; padding: 12px 16px; bottom: 12px; }
  .jobs-menu { width: calc(100vw - 32px); position: fixed; left: 16px; right: 16px; top: 60px; }
  h1 { font-size: 1.6rem; }
}

input[type=file] { font-size: .9rem; max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; padding: 7px 14px; margin-right: 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink-2); }
