/* AlphaReporter: clean green-on-black terminal. Phone first. All colours checked against #020a05 for AA contrast. */
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
:root {
  --bg: #020a05; --panel: #06140b; --panel2: #0a1d10;
  --line: #1d6b38; --line-dim: #123d21;
  --text: #c4f7d2; --dim: #73b389; --acc: #39ff6a;
  --amber: #ffb02e; --idea: #7df2d0; --danger: #ff7a6e; --r: 6px;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "JetBrains Mono", ui-monospace, Consolas, Menlo, monospace; min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0 0 10px; }
.dim { color: var(--dim); } .small { font-size: 13px; } .center { text-align: center; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px dashed var(--acc); outline-offset: 2px; }

.matrix-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .5; }
.matrix-bg.off { display: none; }
#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line-dim); }
.logo { background: none; border: 0; padding: 6px 0; font-size: 19px; font-weight: 800; color: var(--acc); letter-spacing: .02em; cursor: pointer; text-shadow: 0 0 10px rgba(57,255,106,.45); }
.logo .us { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pills { display: flex; gap: 8px; }
.pill { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: var(--dim); font-size: 13px; cursor: pointer; }
.pill.gear { padding: 0; width: 36px; }
.tog.row { min-height: 48px; font-size: 14px; color: var(--text); }
.pill.on { color: var(--acc); border-color: var(--acc); }

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.body { flex: 1; padding: 14px; }
.crumb { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
.ptitle { flex: 1; font-size: 18px; color: var(--acc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh { font-size: 17px; color: var(--acc); margin-bottom: 10px; }
.sub { font-size: 13px; color: var(--dim); margin: 18px 0 8px; font-weight: 600; }
.lnk { background: none; border: 0; padding: 8px 4px; min-height: 40px; color: var(--acc); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lnk.dim { color: var(--dim); }
.lnk.push { margin-left: auto; }
.block-c { display: block; margin: 4px auto; }
.icon-btn { flex: none; width: 44px; height: 44px; border: 1px solid var(--line-dim); border-radius: var(--r); background: var(--bg); color: var(--dim); font-size: 18px; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 16px; border: 1px solid var(--acc); border-radius: var(--r); background: transparent; color: var(--acc); font-weight: 700; letter-spacing: .05em; cursor: pointer; text-shadow: 0 0 8px rgba(57,255,106,.4); }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.pri { background: var(--acc); color: #02130a; text-shadow: none; box-shadow: 0 0 16px rgba(57,255,106,.3); }
.btn.pri.ok { background: #b9ffcb; }
.btn.danger { border-color: var(--danger); color: var(--danger); text-shadow: none; }
.btn:active { transform: translateY(1px); }

.fld { display: block; width: 100%; min-height: 48px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font: inherit; font-size: 16px; caret-color: var(--acc); }
.fld::placeholder { color: #5b9570; }
.fld:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 0 14px rgba(57,255,106,.2); }
.ta { resize: none; line-height: 1.45; }
.fld.code { text-align: center; letter-spacing: .5em; font-size: 22px; }

/* projects */
.pcard { display: flex; gap: 8px; margin-bottom: 10px; }
.pcard .icon-btn { height: auto; }
.icon-btn.handle { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.pcard.dragging { position: relative; z-index: 6; opacity: .96; filter: drop-shadow(0 0 12px rgba(57,255,106,.45)); }
.pcard.dragging .icon-btn.handle { cursor: grabbing; border-color: var(--acc); color: var(--acc); }
.pcard.arch { opacity: .6; }
.pmain { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; text-align: left; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.pname { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psub { grid-column: 1; color: var(--dim); font-size: 13px; }
.pcount { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 22px; font-weight: 800; color: #3f7a55; }
.pcount.has { color: var(--acc); text-shadow: 0 0 10px rgba(57,255,106,.5); }
.hint { padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--dim); font-size: 13px; }
.hint .lnk { padding: 0 2px; min-height: 0; }
.empty { border: 1px solid var(--line-dim); border-radius: var(--r); padding: 0 14px 14px; overflow: hidden; }
.rain { display: block; width: 100%; background: var(--bg); }
.rain.panel { height: 96px; margin: 0 -14px 12px; width: calc(100% + 28px); }
.rain.strip { height: 60px; margin-bottom: 10px; border-radius: var(--r); }
.demo-links { display: flex; justify-content: space-between; margin-top: 18px; }
.demo-note { padding: 8px 10px; border: 1px dashed var(--amber); color: var(--amber); border-radius: var(--r); font-size: 12.5px; margin-top: 12px; }

/* composer */
.composer { display: grid; gap: 10px; }
.chips { display: flex; gap: 8px; }
.chip { flex: 1; min-height: 46px; border: 1px solid var(--line-dim); border-radius: var(--r); background: var(--bg); color: var(--dim); font-weight: 700; letter-spacing: .04em; cursor: pointer; }
.chip.t-bug[aria-checked="true"] { border-color: var(--amber); color: var(--amber); background: rgba(255,176,46,.1); }
.chip.t-polish[aria-checked="true"] { border-color: var(--acc); color: var(--acc); background: rgba(57,255,106,.1); }
.chip.t-idea[aria-checked="true"] { border-color: var(--idea); color: var(--idea); background: rgba(125,242,208,.1); }
.whererow { display: flex; gap: 8px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; }
.recent:empty { display: none; }
.mini { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-dim); border-radius: 99px; background: var(--bg); color: var(--dim); font-size: 13px; cursor: pointer; }
.tog { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--dim); font-size: 13px; }
.tog input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); display: grid; place-content: center; cursor: pointer; }
.tog input:checked { border-color: var(--acc); background: var(--acc); }
.tog input:checked::after { content: "✓"; color: #02130a; font-weight: 800; font-size: 15px; line-height: 1; }

/* notes */
.notes { display: grid; gap: 8px; }
.note { display: grid; gap: 4px; text-align: left; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-dim); border-radius: var(--r); cursor: pointer; width: 100%; }
.nhead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.where { color: var(--text); background: var(--panel2); border-radius: 3px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.when { margin-left: auto; color: var(--dim); flex: none; }
.ntext { white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font-weight: 800; letter-spacing: .03em; flex: none; }
.t-bug.tag { color: var(--amber); } .t-polish.tag { color: var(--acc); } .t-idea.tag { color: var(--idea); }

.bar { position: sticky; bottom: 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line-dim); }
.bar .btn.block { margin-top: 0; }

/* history */
.batch { border: 1px solid var(--line-dim); border-radius: var(--r); margin-bottom: 10px; background: var(--panel); }
.batch summary { display: flex; justify-content: space-between; gap: 8px; padding: 14px; min-height: 48px; cursor: pointer; }
.bdate { font-weight: 700; } .bcount { color: var(--dim); }
.bbody { padding: 0 14px 14px; }
.hnote { padding: 10px 0; border-top: 1px solid var(--line-dim); }

/* sheets, toast */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.72); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; background: var(--panel); border-top: 1px solid var(--acc); border-radius: 12px 12px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(57,255,106,.12); animation: up .18s ease-out; outline: none; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-in > * + * { margin-top: 10px; }
.sheet-in > .btn.block { margin-top: 10px; }
.plain { margin: 0; padding-left: 18px; } .plain li { margin-bottom: 6px; }
.pre { margin: 0; padding: 12px; max-height: 38vh; max-height: 38dvh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font: 13.5px/1.5 inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.edit-head summary { cursor: pointer; color: var(--dim); min-height: 40px; display: flex; align-items: center; }
.edit-head .fld { margin: 6px 0; }
.warn { color: var(--amber); font-size: 13px; }
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 30; display: flex; align-items: center; gap: 12px; max-width: min(92vw, 520px); padding: 8px 14px; background: var(--panel2); border: 1px solid var(--acc); border-radius: var(--r); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* Forge icon preview (demo only) */
.forge-demo { padding: 14px; }
.rack { margin: 14px 0; padding: 0 0 18px; background: linear-gradient(#2a1a10, #120a06); border: 1px solid #4a3220; border-radius: var(--r); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail { grid-column: 1 / -1; height: 14px; background: linear-gradient(#6e4a2a, #3a2210); border-bottom: 2px solid #1d1109; border-radius: var(--r) var(--r) 0 0; }
.slot { text-align: center; color: #e9d9bd; font-family: Georgia, "Times New Roman", serif; }
.slot .icon { display: block; width: 92px; height: 138px; margin: 0 auto; }
.slot .tagline { margin: 4px auto 0; padding: 4px 8px; width: 94%; max-width: 190px; background: #d9c9a8; color: #2a1708; border-radius: 3px; font-size: 13px; line-height: 1.25; }
.slot .tagline b { display: block; font-size: 14px; }
.slot.ghost { opacity: .35; align-self: center; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .logo .us { animation: none; }
  .sheet { animation: none; }
  #toast { transition: none; }
}
@media (min-width: 600px) { .scrim { align-items: center; } .sheet { border-radius: 12px; border: 1px solid var(--acc); } }
