/* Versed Study — student tools (/tools/). Loaded after study.css. */
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.brand .logo { overflow: hidden; background: none; box-shadow: none; }
.brand .logo img { width: 30px; height: 30px; image-rendering: pixelated; display: block; }
.wrap { max-width: 640px; }
.wrap.wide { max-width: 900px; }

/* tool switcher under the hero */
.toolbar { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.toolbar a { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem .35rem .45rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 700; }
.toolbar a img { width: 20px; height: 20px; image-rendering: pixelated; }
.toolbar a:hover { border-color: var(--violet); color: var(--text); }
.toolbar a[aria-current] { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* index cards */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.tool { position: relative; display: flex; gap: .9rem; align-items: flex-start; text-decoration: none; color: var(--text); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; transition: transform .12s var(--ease), border-color .15s, box-shadow .15s; }
.tool:hover { transform: translate(-2px, -2px); border-color: var(--lime); box-shadow: 4px 4px 0 var(--pink); }
.tool img { width: 48px; height: 48px; image-rendering: pixelated; flex: none; }
.tool b { display: block; font-family: var(--display); font-size: .95rem; margin-bottom: .25rem; }
.tool span { color: var(--muted); font-size: .82rem; display: block; }
.tool .tag { position: absolute; top: .6rem; right: .7rem; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }

/* decoration sprites live in margins / empty states */
.deco { position: absolute; image-rendering: pixelated; pointer-events: none; user-select: none; }
.hero { position: relative; }
.hero .deco { right: 0; bottom: 0; }
@media (max-width: 480px) { .hero .deco { display: none; } }
@media (min-width: 481px) { .hero:has(.deco) p { padding-right: 90px; } }
.shelf { display: flex; justify-content: center; align-items: flex-end; gap: 1.2rem; padding: .5rem 0 0; opacity: .9; }
.shelf img { image-rendering: pixelated; }
.divider { height: 6px; margin: 1.4rem 0; background: repeating-linear-gradient(90deg, var(--lime) 0 6px, transparent 6px 12px); opacity: .6; }
.empty { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.2rem .5rem; }
.empty img { display: block; margin: 0 auto .5rem; image-rendering: pixelated; }

/* pixel-flavoured bits */
.hard { box-shadow: 4px 4px 0 var(--pink); }
.hard-lime { box-shadow: 4px 4px 0 var(--lime); }
h2.h { font-size: 1rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .5rem; }
h2.h svg { width: 18px; height: 18px; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; background: var(--card2); font-size: .72rem; font-weight: 700; color: var(--muted); }
.note { font-size: .78rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: .6rem .8rem; margin-top: .8rem; }
.note b { color: var(--text); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.input-sm { padding: .55rem .7rem; border-radius: 10px; font-size: .9rem; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
@media (max-width: 420px) { .three { grid-template-columns: 1fr 1fr; } }
.stat b { font-size: 2rem; }
.stat b.sm { font-size: 1.35rem; }
.stat .sub { display: block; color: var(--dim); font-size: .72rem; margin-top: .2rem; }
.btn-lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; display: inline-grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; }
.btn-icon:hover { color: var(--text); }
.btn-icon svg { width: 18px; height: 18px; }
.btn[aria-pressed="true"] { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.seg { display: inline-flex; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { padding: .4rem .8rem; border-radius: 9px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--ink); }

/* grade calculator */
.grid-rows .r { grid-template-columns: 1fr 78px 78px 32px; }
.grid-rows .r.c5 { grid-template-columns: 1fr 96px 78px 78px 32px; }
.grid-rows .r.c5s { grid-template-columns: 1fr 96px 96px 32px; }
.grid-rows .r .input { padding: .55rem .6rem; border-radius: 10px; font-size: .9rem; min-width: 0; }
.grid-rows .r select.input { padding-right: 1.4rem; background-position: calc(100% - 12px) 55%, calc(100% - 8px) 55%; }
@media (max-width: 420px) {
  .grid-rows .r { grid-template-columns: 1fr 64px 64px 28px; gap: .3rem; }
  .grid-rows .r.c5 { grid-template-columns: minmax(0, 1fr) 84px 64px 64px 28px; }
  .grid-rows .r.c5s { grid-template-columns: 1fr 80px 84px 28px; }
  .grid-rows .r .input { padding: .5rem .4rem; font-size: .85rem; }
  .grid-rows .h { font-size: .62rem; padding: 0 .1rem; }
}
.grid-rows .x { width: 28px; height: 28px; display: grid; place-items: center; color: var(--dim); border-radius: 8px; }
.grid-rows .x:hover { background: var(--card2); color: var(--red); }
.grid-rows .x svg { width: 14px; height: 14px; }
table.conv { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: .5rem; }
table.conv th, table.conv td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
table.conv th { color: var(--dim); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
table.conv td b { color: var(--lime); font-family: var(--display); font-size: .8rem; }
.tablewrap { overflow-x: auto; }
details.card summary { cursor: pointer; font-weight: 700; font-size: .9rem; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; font-family: var(--display); color: var(--lime); }
details.card[open] summary::after { content: '–'; }
.matrix td, .matrix th { text-align: center; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-top: 1rem; }
.band { display: inline-block; padding: .15rem .55rem; border-radius: 8px; background: var(--card2); font-weight: 700; font-size: .78rem; }

/* scientific calculator */
.calc { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: 6px 6px 0 var(--pink); }
.calc .screen { background: var(--bg2); border-radius: 14px; padding: .8rem .9rem; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-end; border: 2px solid var(--line); position: relative; }
.calc .screen .mode { position: absolute; top: .5rem; left: .8rem; display: flex; gap: .4rem; font-size: .62rem; font-weight: 800; letter-spacing: .1em; color: var(--dim); }
.calc .screen .mode span[data-on] { color: var(--lime); }
.calc .expr { font-family: var(--display); font-size: 1.15rem; word-break: break-all; text-align: right; min-height: 1.6em; color: var(--text); }
.calc .expr .cur { display: inline-block; width: 2px; height: 1.1em; background: var(--lime); vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.calc .res { font-family: var(--display); font-size: 2rem; text-align: right; color: var(--lime); min-height: 1.3em; line-height: 1.2; word-break: break-all; }
.calc .res.err { color: var(--red); font-size: 1rem; }
.calc .res.preview { color: var(--muted); font-size: 1.2rem; }
.hist { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 0 .2rem; scrollbar-width: none; }
.hist::-webkit-scrollbar { display: none; }
.hist button { flex: none; background: var(--card2); border-radius: 10px; padding: .35rem .6rem; font-size: .75rem; color: var(--muted); text-align: left; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist button b { color: var(--text); display: block; }
.hist button:hover { color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-top: .6rem; }
.keys button { height: 50px; border-radius: 12px; background: var(--card2); color: var(--text); font-weight: 700; font-size: 1.05rem; border: 2px solid transparent; transition: transform .08s, background .12s; -webkit-tap-highlight-color: transparent; user-select: none; }
.keys button:active { transform: translate(1px, 1px); background: var(--line); }
.keys button.fn { font-size: .85rem; font-family: var(--body); color: var(--muted); background: var(--bg2); }
.keys button.op { background: var(--line); color: var(--lime); }
.keys button.eq { background: var(--lime); color: var(--ink); box-shadow: 3px 3px 0 var(--pink); }
.keys button.eq:active { box-shadow: 1px 1px 0 var(--pink); }
.keys button.del { background: rgba(255,92,92,.15); color: var(--red); }
.keys button[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
.keys button sup { font-size: .6em; }
.keys button i { font-style: italic; }
@media (max-width: 400px) { .keys { gap: .3rem; } .keys button { height: 46px; font-size: 1rem; } .keys button.fn { font-size: .78rem; } }

/* exam countdown */
.exam { display: flex; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .5rem; border-left: 5px solid var(--c, var(--lime)); }
.exam.past { opacity: .55; }
.exam .grow { flex: 1; min-width: 0; }
.exam b { display: block; font-family: var(--display); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam .when { color: var(--muted); font-size: .78rem; }
.exam .left { text-align: right; flex: none; }
.exam .left b { font-size: 1.4rem; color: var(--c, var(--lime)); line-height: 1; }
.exam .left span { display: block; color: var(--dim); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.exam .left.soon b { color: var(--amber); }
.exam .left.now b { color: var(--red); }
.swatches { display: flex; gap: .4rem; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; }
.swatches button[aria-pressed="true"] { border-color: var(--text); }
.share-box { width: 100%; min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; resize: vertical; }
.next-up { text-align: center; padding: 1.2rem 1rem; border-radius: var(--radius); background: var(--card2); border: 2px solid var(--line); margin-bottom: 1rem; }
.next-up .big { font-family: var(--display); font-size: 2.6rem; color: var(--lime); line-height: 1; }
.next-up .big small { font-size: .9rem; color: var(--muted); margin-left: .2rem; }
.next-up .lbl { color: var(--muted); font-size: .82rem; margin-top: .4rem; }

/* task breaker */
.steps { display: grid; gap: .45rem; }
.step { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; }
.step.done { opacity: .5; }
.step.done input.t { text-decoration: line-through; }
.step .chk { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--bg2); display: grid; place-items: center; flex: none; color: var(--ink); }
.step.done .chk { background: var(--lime); border-color: var(--lime); }
.step .chk svg { width: 14px; height: 14px; }
.step input.t { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: .95rem; padding: .3rem .2rem; border-bottom: 1px solid transparent; }
.step input.t:focus { border-bottom-color: var(--lime); }
.step .mv { display: flex; flex-direction: column; gap: 0; }
.step .mv button, .step .rm { width: 26px; height: 20px; color: var(--dim); display: grid; place-items: center; border-radius: 6px; }
.step .rm { height: 26px; }
.step .mv button:hover, .step .rm:hover { color: var(--text); background: var(--card2); }
.step .mv svg, .step .rm svg { width: 12px; height: 12px; }
.progress { height: 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; margin: .8rem 0; }
.progress i { display: block; height: 100%; background: var(--lime); transition: width .3s var(--ease); }
.focus-card { text-align: center; padding: 1.6rem 1rem; background: var(--card2); border: 2px solid var(--line); border-radius: var(--radius); }
.focus-card .n { color: var(--dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.focus-card .txt { font-family: var(--display); font-size: 1.3rem; margin: .5rem 0 1rem; line-height: 1.3; }
.timer { font-family: var(--display); font-size: 3.2rem; color: var(--lime); line-height: 1; letter-spacing: .02em; }
.timer.running { color: var(--cyan); }
.timer.done { color: var(--pink); }
.ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; margin: 0 auto .6rem; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--p) * 1%), var(--bg2) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--card2); }
.ring > * { position: relative; }
.ring .timer { font-size: 2.1rem; }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.presets button { padding: .35rem .7rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.presets button:hover { border-color: var(--violet); color: var(--text); }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.4; }

/* reader */
.reader-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; }
@media (max-width: 480px) { .reader-controls { grid-template-columns: 1fr; } }
.ctl label { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.ctl label output { color: var(--lime); font-family: var(--display); text-transform: none; letter-spacing: 0; }
.tints { display: flex; gap: .4rem; flex-wrap: wrap; }
.tints button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); }
.tints button[aria-pressed="true"] { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(198,255,61,.25); }
.toggles { display: flex; flex-wrap: wrap; gap: .4rem; }
.paper { position: relative; margin-top: 1rem; border-radius: 14px; padding: 1.4rem 1.3rem; background: var(--paper, #FBF6E9); color: var(--ink-paper, #1a1a1f); min-height: 200px; overflow: hidden; border: 2px solid var(--line); cursor: default; }
.paper.dark { --paper: #15142a; --ink-paper: #ECEAF8; }
.paper .txt { position: relative; z-index: 1; max-width: var(--measure, 62ch); margin: 0 auto; font-size: var(--fs, 1.15rem); line-height: var(--lh, 1.8); letter-spacing: var(--ls, 0.05em); word-spacing: var(--ws, 0.16em); font-family: var(--rf, system-ui); text-align: left; -webkit-hyphens: none; hyphens: none; }
.paper .txt p { margin: 0 0 1em; }
.paper .txt b { font-weight: 800; }
.paper .tint { position: absolute; inset: 0; pointer-events: none; z-index: 2; mix-blend-mode: multiply; }
.paper.dark .tint { mix-blend-mode: screen; opacity: .18; }
.paper .ruler { position: absolute; left: 0; right: 0; height: var(--rh, 2.2em); z-index: 3; pointer-events: none; display: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.paper.ruler-on .ruler { display: block; }
.paper.ruler-on .txt { cursor: crosshair; }
.rt { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }

/* ask an AI */
.opt { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--dim); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
.modes button { text-align: left; padding: .55rem .7rem; border-radius: 12px; background: var(--bg2); border: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: .8rem; display: flex; gap: .45rem; align-items: center; min-width: 0; }
.modes button svg { width: 16px; height: 16px; flex: none; }
.modes button:hover { border-color: var(--violet); color: var(--text); }
.modes button[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.count { font-size: .72rem; color: var(--dim); text-align: right; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.prompt-box { margin: .6rem 0 0; background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: .9rem 1rem; max-height: 380px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); user-select: text; -webkit-user-select: text; }
.prompt-box:focus { outline: none; border-color: var(--lime); }
.prompt-box .k { color: var(--lime); font-weight: 700; }
.opens { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.opens .btn { padding: .7rem .8rem; font-size: .9rem; }
.opens .btn svg { width: 16px; height: 16px; }
.opens .btn.is-off { opacity: .45; cursor: not-allowed; box-shadow: none; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.pack { display: flex; gap: .7rem; align-items: center; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: .7rem .8rem; color: var(--text); transition: transform .12s var(--ease), border-color .15s, box-shadow .15s; min-width: 0; }
.pack:hover { transform: translate(-2px, -2px); border-color: var(--lime); box-shadow: 4px 4px 0 var(--pink); }
.pack svg { width: 20px; height: 20px; color: var(--lime); flex: none; }
.pack span { min-width: 0; }
.pack b { display: block; font-family: var(--display); font-size: .8rem; line-height: 1.3; }
.pack small { display: block; color: var(--muted); font-size: .72rem; margin-top: .15rem; }
@media (max-width: 560px) { .opens { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .modes { grid-template-columns: 1fr 1fr; } }
/* the chat itself */
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.left { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.left b { color: var(--lime); }
.msgs { display: flex; flex-direction: column; gap: .6rem; margin-top: .7rem; max-height: 62vh; min-height: 120px; overflow-y: auto; scroll-behavior: smooth; padding-right: 2px; }
.msg { max-width: 92%; min-width: 0; }
.msg.user { align-self: flex-end; }
.msg.ai { align-self: flex-start; max-width: 100%; }
.bubble { border-radius: 16px; padding: .7rem .9rem; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--lime); color: var(--ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.ai .bubble { background: var(--bg2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble h3, .bubble h4 { font-size: .92rem; margin: .6rem 0 .3rem; line-height: 1.3; }
.bubble h3:first-child, .bubble h4:first-child { margin-top: 0; }
.bubble h3 { color: var(--lime); }
.bubble p { margin: 0 0 .55rem; }
.bubble > :last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 .55rem 1.25rem; padding: 0; }
.bubble li { margin: .18rem 0; }
.bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: rgba(255,255,255,.08); padding: .05em .35em; border-radius: 5px; }
.bubble pre { background: var(--card2); border-radius: 10px; padding: .6rem .75rem; overflow-x: auto; margin: 0 0 .55rem; font-size: .8rem; line-height: 1.5; }
.bubble pre code { background: none; padding: 0; font-size: 1em; }
.msg.ai .bubble b { color: var(--text); }
.msg.ai.streaming .bubble::after { content: ''; display: inline-block; width: .45em; height: 1em; background: var(--lime); vertical-align: text-bottom; margin-left: 3px; animation: blink 1s steps(2) infinite; }
.msg.ai.streaming .bubble:empty { min-height: 1.5em; padding-left: 1rem; }
.msg-tools { display: flex; gap: .4rem; margin-top: .2rem; }
.msg-tools button { font-size: .7rem; font-weight: 700; color: var(--dim); display: inline-flex; gap: .25rem; align-items: center; padding: .15rem .45rem; border-radius: 6px; }
.msg-tools button:hover { color: var(--text); background: var(--card2); }
.msg-tools svg { width: 13px; height: 13px; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.quick[hidden], .cap[hidden], .msg-tools button[hidden] { display: none; }
.quick button { padding: .4rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.quick button svg { width: 14px; height: 14px; }
.quick button:hover { border-color: var(--violet); color: var(--text); }
.composer { display: flex; gap: .5rem; align-items: flex-end; margin-top: .7rem; }
.composer textarea.input { flex: 1; min-height: 46px; max-height: 160px; height: 46px; resize: none; padding: .7rem .9rem; border-radius: 14px; line-height: 1.4; font-size: .95rem; }
.composer .btn { width: 46px; height: 46px; padding: 0; border-radius: 14px; flex: none; }
.composer .btn svg { width: 20px; height: 20px; }
.tiny { font-size: .72rem; color: var(--dim); margin-top: .45rem; }
.cap { margin-top: .7rem; background: var(--card2); border: 2px solid var(--line); border-radius: 14px; padding: .9rem 1rem; text-align: center; }
.cap b { font-family: var(--display); display: block; font-size: 1rem; margin-bottom: .3rem; }
.cap p { color: var(--muted); font-size: .82rem; margin: 0 0 .7rem; }
.ts { margin-top: .5rem; }
.ts:empty { display: none; }
#setup .drawer .two { margin-top: 0; }
#setup .drawer > div, #setup .drawer > p { padding: 0 .1rem; }

/* citation maker */
.hero .why { font-size: .8rem; color: var(--lime); margin-top: .5rem; }
.lookup-row .input { flex: 1; min-width: 0; }
.lookup-row .btn { flex: none; }
.types { display: flex; flex-wrap: wrap; gap: .4rem; }
.types button { padding: .4rem .75rem; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: .78rem; font-weight: 700; color: var(--muted); }
.types button:hover { border-color: var(--violet); color: var(--text); }
.editor { margin-top: .8rem; border-color: var(--lime); box-shadow: 4px 4px 0 var(--lime); }
.fld label.field { margin-top: .7rem; }
.names { margin-top: .9rem; }
.au-row { display: grid; grid-template-columns: 112px 1fr 1fr 28px; gap: .4rem; align-items: center; margin-top: .4rem; }
.au-row:has(.lit) { grid-template-columns: 112px 1fr 28px; }
.au-row .input { min-width: 0; }
.au-row select.input { padding-right: 1.6rem; background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; }
.au-row .x { width: 28px; height: 28px; display: grid; place-items: center; color: var(--dim); border-radius: 8px; }
.au-row .x:hover { background: var(--card2); color: var(--red); }
.au-row .x svg { width: 14px; height: 14px; }
@media (max-width: 420px) { .au-row, .au-row:has(.lit) { grid-template-columns: 1fr 1fr; } .au-row .kind { grid-column: 1 / 2; } .au-row .x { grid-column: 2 / 3; justify-self: end; } .au-row .lit { grid-column: 1 / -1; } }
.case-btns { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; }
.case-btns .chip { cursor: pointer; border: 1px solid var(--line); }
.case-btns .chip:hover { color: var(--text); border-color: var(--violet); }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; color: var(--muted); margin-top: .9rem; }
.check input { margin-top: .2rem; accent-color: var(--lime); }
.warns { margin: .3rem 0 0 1rem; padding: 0; }
.ref-text { font-family: Georgia, 'Times New Roman', serif; font-size: .95rem; line-height: 1.55; color: var(--text); margin: 0; overflow-wrap: anywhere; }
.ref-text.hang { padding-left: 2em; text-indent: -2em; }
.ref-text.preview { background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: .8rem .9rem; margin-top: .2rem; padding-left: calc(.9rem + 2em); min-height: 2.6em; }
.bib-head { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.bib-head #project { max-width: 220px; }
.bib-head #style { max-width: 300px; }
@media (max-width: 560px) { .bib-head { flex-direction: column; } .bib-head #project, .bib-head #style { max-width: none; width: 100%; } .bib-head .row { width: 100%; } .bib-head .row #project { flex: 1; } }
.refs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ref { display: flex; gap: .6rem; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem; }
.ref.drag { cursor: grab; }
.ref.dragging { opacity: .4; }
.ref.over { border-color: var(--lime); box-shadow: 0 -3px 0 var(--lime); }
.ref .num { font-family: var(--display); color: var(--lime); font-size: .8rem; flex: none; padding-top: .15rem; }
.ref-main { flex: 1; min-width: 0; }
.ref-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.ref-meta .chip { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; color: var(--text); text-transform: none; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.ref-meta .chip.type { font-family: var(--body); color: var(--muted); font-weight: 700; }
.ref-meta .chip.warn { font-family: var(--body); color: var(--amber); font-weight: 700; }
.ref-meta .chip.note { display: block; width: 100%; border-radius: 10px; padding: .4rem .6rem; }
.ref-meta .chip.note svg { width: 14px; height: 14px; color: var(--lime); }
.ref-actions { display: flex; flex-direction: column; gap: .25rem; flex: none; }
.btn-icon.sm { width: 32px; height: 32px; border-radius: 9px; }
.btn-icon.sm svg { width: 15px; height: 15px; }
.btn-icon.danger:hover { color: var(--red); }
@media (max-width: 480px) { .ref { flex-wrap: wrap; } .ref-actions { flex-direction: row; width: 100%; justify-content: flex-end; } }
.empty { list-style: none; }
.pair { text-align: center; font-size: .82rem; color: var(--muted); margin-top: .8rem; line-height: 1.8; }
.pair a { color: var(--text); border-bottom: 1px solid var(--line); text-decoration: none; }
.pair a:hover { border-color: var(--lime); }

/* footer + ad strip (rule 2 / rule 3) */
.foot { padding: 1.6rem 0 .8rem; line-height: 1.7; }
.foot a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--text); }
.strip-slot { height: 44px; padding-bottom: env(safe-area-inset-bottom); }
.strip-slot .strip-label { top: 1px; left: 6px; font-size: 8px; }
.strip-house { gap: .55rem; font-size: .76rem; max-width: 640px; align-items: center; }
.strip-house img { width: 24px; height: 24px; border-radius: 6px; image-rendering: pixelated; object-fit: contain; }
.strip-house strong { display: inline; font-size: .76rem; }
.strip-house .strip-text { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.strip-house .strip-text span { display: inline; font-size: .72rem; color: var(--muted); }
.strip-house .strip-cta { padding: .2rem .65rem; font-size: .7rem; }
.has-strip { padding-bottom: 56px; }
.offline { display: none; font-size: .72rem; color: var(--amber); }
body.is-offline .offline { display: inline; }

/* native date/time pickers have an intrinsic min-width that overflows a 1fr grid on phones */
.two > *, .three > * { min-width: 0; }
input[type=date].input, input[type=time].input { min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }

/* free-tools index: one line per tool */
.free-line { font-family: var(--display); font-size: 1rem; line-height: 1.4; color: var(--text); margin: .2rem 0 .4rem; }
.free-line b { color: var(--lime); }
.stays { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: .6rem 0 1.2rem; }
.stays .chip { border: 1px solid var(--line); background: var(--card); }
.stays .chip svg { width: 14px; height: 14px; color: var(--lime); }
.toollist { display: grid; gap: .45rem; }
.toollist a { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .8rem; min-width: 0; transition: transform .12s var(--ease), border-color .15s, box-shadow .15s; }
.toollist a:hover { transform: translate(-2px, -2px); border-color: var(--lime); box-shadow: 4px 4px 0 var(--pink); }
.toollist .ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg2); }
.toollist .ic img { width: 28px; height: 28px; image-rendering: pixelated; }
.toollist .ic svg { width: 22px; height: 22px; color: var(--lime); }
.toollist b { font-family: var(--display); font-size: .88rem; white-space: nowrap; }
.toollist span.line { color: var(--muted); font-size: .8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.toollist .soon { font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); border: 1px solid var(--amber); border-radius: 6px; padding: .1rem .35rem; flex: none; }
.toollist .go { color: var(--dim); flex: none; }
.toollist .go svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .toollist a { flex-wrap: wrap; gap: .4rem .7rem; } .toollist span.line { flex-basis: 100%; white-space: normal; padding-left: calc(36px + .7rem); } .toollist .go { display: none; } }

/* "was this useful?" thumbs (common.js thumbs()) */
.thumbs { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; min-height: 36px; color: var(--muted); font-size: .82rem; }
.thumbs .thumb { width: 36px; height: 36px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; }
.thumbs .thumb:hover { border-color: var(--lime); color: var(--text); }
.thumbs .thumb svg { width: 18px; height: 18px; }
.thumbs .thumb[data-v="1"] svg { transform: rotate(-90deg); }
.thumbs .thumb[data-v="0"] svg { transform: rotate(-90deg); }
.thumbs .thumbs-why { display: flex; gap: .4rem; width: 100%; max-width: 380px; }
.thumbs .thumbs-why .input { flex: 1; min-width: 0; }
.thumbs .thumbs-done { display: inline-flex; align-items: center; gap: .3rem; color: var(--lime); }
.thumbs .thumbs-done svg { width: 16px; height: 16px; }

/* tiny steps: one step at a time */
.one { text-align: center; padding: 1.4rem 1rem 1.2rem; background: var(--card2); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--pink); }
.one .n { color: var(--dim); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.one .task { color: var(--muted); font-size: .8rem; margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.one .txt { font-family: var(--display); font-size: 1.35rem; margin: .7rem 0 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.one .acts { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.one .acts .btn { flex: 1 1 auto; }
.one .hint { color: var(--muted); font-size: .78rem; margin-top: .8rem; }
.split-note { font-size: .78rem; color: var(--muted); }
.mytasks { display: grid; gap: .4rem; }
.mytask { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .6rem; }
.mytask.cur { border-color: var(--lime); }
.mytask .go { flex: 1; min-width: 0; text-align: left; color: var(--text); display: grid; gap: .1rem; }
.mytask .go b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mytask .go small { color: var(--muted); font-size: .72rem; }
.mytask .mini-bar { height: 5px; border-radius: 3px; background: var(--bg2); overflow: hidden; margin-top: .25rem; }
.mytask .mini-bar i { display: block; height: 100%; background: var(--lime); }
details.drawer { margin-top: .75rem; }
details.drawer summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .85rem; color: var(--muted); padding: .6rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
details.drawer summary::-webkit-details-marker { display: none; }
details.drawer summary::after { content: '+'; font-family: var(--display); color: var(--lime); }
details.drawer[open] summary::after { content: '–'; }
details.drawer .steps { margin-top: .5rem; }
.room-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: .5rem .8rem; margin-bottom: .75rem; }
.room-line svg { width: 16px; height: 16px; color: var(--lime); flex: none; }
.room-line a { color: var(--text); margin-left: auto; font-weight: 700; }

/* exam countdown: per-subject rows, this week, access arrangements, big view */
.exam .grow .sub { display: block; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam .grow .sub b { display: inline; font-family: var(--body); font-size: .76rem; color: var(--text); }
.exam.aa { border-left-color: var(--amber); background: rgba(255,176,32,.06); }
.week { display: flex; gap: .7rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; margin-bottom: .75rem; font-size: .85rem; }
.week svg { width: 18px; height: 18px; color: var(--lime); flex: none; margin-top: .1rem; }
.week b { font-family: var(--display); font-size: .8rem; display: block; }
.week .muted { font-size: .78rem; }
.week a { color: var(--text); }
.aa-box { display: flex; gap: .6rem; align-items: flex-start; font-size: .82rem; color: var(--muted); }
.aa-box input[type=checkbox] { margin-top: .25rem; accent-color: var(--lime); width: 18px; height: 18px; flex: none; }
.aa-box b { color: var(--text); }
.aa-when { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.aa-when .input { max-width: 190px; }
.bigview { display: none; }
body.big { background: #000; }
body.big .wrap > *:not(.bigview), body.big .strip-slot, body.big .toast { display: none !important; }
body.big .wrap { max-width: none; padding: 0; min-height: 100dvh; }
body.big .bigview { text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; padding: 6vh 6vw; text-align: center; color: #F4F2FF; cursor: pointer; user-select: none; }
.bigview .num { font-family: var(--display); font-weight: 800; font-size: clamp(5rem, 28vw, 15rem); line-height: .95; color: var(--lime); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bigview .num small { font-size: .28em; color: var(--muted); margin-left: .1em; letter-spacing: 0; }
.bigview .unit { font-family: var(--display); font-size: clamp(1rem, 4vw, 1.6rem); color: var(--muted); text-transform: uppercase; letter-spacing: .2em; margin-top: .3rem; }
.bigview .what { font-family: var(--display); font-size: clamp(1.2rem, 5vw, 2.2rem); margin-top: 1.4rem; line-height: 1.25; overflow-wrap: anywhere; }
.bigview .when { color: var(--muted); font-size: clamp(.9rem, 3vw, 1.1rem); margin-top: .4rem; }
.bigview .then { margin-top: 2.2rem; color: var(--dim); font-size: .85rem; line-height: 1.7; }
.bigview .then b { color: var(--muted); font-weight: 700; }
.bigview .back { position: fixed; top: 10px; right: 12px; font-size: .72rem; color: var(--dim); text-decoration: none; }
.toolbar a .tb { width: 20px; height: 20px; color: var(--lime); }
.toolbar a[aria-current] .tb { color: var(--ink); }
