/* Panopticon Notes — raw flat heavy-metal woodcut zine. Ink, iron, bone, blood. No gloss. */
:root { --bg: #060505; --parch: #ebe4d5; --parch-ink: #140d0b; --nav-h: 64px; }
body { padding-bottom: calc(var(--nav-h) + var(--safe-bot) + 8px); }
.napp { max-width: 440px; margin: 0 auto; padding: var(--safe-top) 0 0; position: relative; min-height: 100dvh;
  background-image: linear-gradient(180deg, rgba(184,15,29,.2) 0, rgba(184,15,29,.03) 110px, transparent 200px); }
.napp::before, .napp::after { content: ''; position: fixed; top: 40px; bottom: 76px; width: 4px; pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--iron-bright) 0 8px, var(--bg) 8px 14px); opacity: .4; }
.napp::before { left: max(2px, calc(50% - 218px)); } .napp::after { right: max(2px, calc(50% - 218px)); }
.kicker { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.kicker.gold { color: var(--gold); }

/* header */
.nhdr { margin: 8px 10px 0; padding: 8px 10px; background: var(--stone); border: 2px solid var(--iron-bright); border-top-color: var(--ink);
  box-shadow: 0 4px 0 #000, inset 0 0 0 2px #000; }
.nhdr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nlogo { font-family: var(--font-title); font-size: 32px; line-height: .9; text-shadow: 2px 2px 0 #000, -1px 0 0 var(--blood); }
.nlogo span { display: block; font-family: var(--font-body); font-size: 9px; letter-spacing: .32em; text-transform: uppercase; color: var(--dim); text-shadow: none; margin-top: 2px; }
.nacts { display: flex; gap: 6px; align-items: center; }
.ibtn { height: 32px; min-width: 32px; border: 2px solid var(--iron-bright); background: #000; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.ibtn svg { width: 16px; height: 16px; }
.spill { height: 32px; padding: 0 9px; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; border: 2px solid var(--iron-bright); background: #000; color: var(--dim); }
.spill.synced { border-color: var(--ok); color: var(--ok); } .spill.syncing { border-color: var(--gold); color: var(--gold); }
.spill.offline, .spill.error { border-color: var(--red); color: var(--red); }

.nmain { padding: 12px 10px 20px; display: flex; flex-direction: column; gap: 10px; }

/* capture */
.hero { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; background: var(--stone); border: 2px solid var(--iron-bright); padding: 8px; box-shadow: 0 4px 0 #000; }
.hero.slim { grid-template-columns: 64px 1fr; padding: 6px 8px; }
.hplate { border: 2px solid var(--ink); background: #000; aspect-ratio: 1; overflow: hidden; }
.hplate img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.15) grayscale(.2); }
.htext b { display: block; font-family: var(--font-title); font-size: 21px; line-height: 1.05; margin: 2px 0; }
.hsub { font-size: 12px; color: var(--dim); }
.parch { position: relative; background: var(--parch); color: var(--parch-ink); border: 2px solid #000; box-shadow: 0 4px 0 #000, inset 0 0 0 3px rgba(20,13,11,.15); padding: 8px 10px 10px 40px; }
.parch::before { content: ''; position: absolute; left: 30px; top: 0; bottom: 0; width: 1.5px; background: rgba(184,15,29,.5); }
.phead { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #6a1218; margin-bottom: 4px; }
.parch textarea { width: 100%; border: 0; background: transparent; color: var(--parch-ink); font-size: 17px; line-height: 1.45; resize: none; min-height: 52px;
  background-image: repeating-linear-gradient(180deg, transparent 0 24px, rgba(20,13,11,.14) 24px 25px); }
.parch.open textarea { min-height: 130px; }
.parch textarea:focus { outline: none; }
.interim { font-style: italic; color: #6a1218; font-size: 15px; }
.record { width: 100%; min-height: 168px; margin-top: 2px; border: 3px solid var(--ink); background: var(--blood); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 6px 0 #000, inset 0 0 0 4px #000, inset 0 0 0 6px var(--crimson);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); touch-action: manipulation; }
.record .rdot { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); border: 4px solid #000; }
.record .rlabel { font-family: var(--font-title); font-size: 40px; line-height: 1; text-shadow: 2px 2px 0 #000; }
.record .rsub { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.record.live { background: #000; border-color: var(--red); color: var(--red); }
.record.live .rdot { background: var(--red); border-radius: 0; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(.8); opacity: .6; } }
.preview { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.tok { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid var(--iron-bright); background: #000; color: var(--dim); padding: 2px 6px; }
.tok b { color: var(--ink); margin-right: 4px; }
.tok.money, .tok.monster { border-color: var(--red); } .tok.event, .tok.due { border-color: var(--gold); } .tok.shopping { border-color: var(--ok); }
.tok.route { border-color: var(--gold); color: var(--gold); }
.corr { font-size: 11px; color: var(--ichor); }
.cbtns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.bbtn { min-height: 46px; border: 2px solid var(--ink); background: #000; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #000;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.bbtn.crimson { background: var(--blood); } .bbtn.ghost { border-color: var(--iron-bright); color: var(--dim); }
.bbtn.ichor { border-color: var(--ichor); color: var(--ichor); } .bbtn.gold { border-color: var(--gold); color: var(--gold); }
.bbtn.red { color: var(--red); border-color: var(--red); } .bbtn.sm { min-height: 34px; font-size: 10px; }
.gate { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.gate::after { content: ''; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--iron-bright) 0 6px, transparent 6px 10px); }
.gate.red { color: var(--red); } .gate.ichor { color: var(--ichor); }
.gate .link { background: none; border: 0; color: var(--dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; order: 3; }

/* note cards */
.ncard { display: flex; gap: 10px; align-items: flex-start; background: var(--stone); border: 2px solid var(--iron-bright); padding: 9px; position: relative; box-shadow: 0 3px 0 #000, inset 0 0 0 2px #000; }
.ncard.done .ntext { text-decoration: line-through; color: var(--muted); }
.ncard.editing { border-color: var(--gold); }
.ncheck { flex: none; width: 28px; height: 28px; border: 2px solid var(--iron-bright); background: #000; color: var(--ok); font-weight: 800; }
.ncheck.on { border-color: var(--ok); }
.nbody { flex: 1; cursor: pointer; }
.ntext { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.nmeta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.btag { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border: 1.5px solid var(--ink); color: var(--ink); background: #000; }
.btag.sub { border-color: var(--iron-bright); color: var(--dim); } .btag.gold { border-color: var(--gold); color: var(--gold); }
.btag.red, .btag.money { border-color: var(--red); color: var(--red); } .btag.dim { border-color: var(--iron); color: var(--muted); }
.btag.assist { border-color: var(--gold); color: var(--gold); } .btag.unsorted { border-color: var(--ichor); color: var(--ichor); }
.rstamp { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 800; letter-spacing: .14em; padding: 2px 7px; border: 2px solid var(--gold); color: var(--gold); transform: rotate(-1.5deg); }
.rstamp.ok { border-color: var(--ok); color: var(--ok); } .rstamp.warn { border-color: var(--red); color: var(--red); }
.etext { width: 100%; background: var(--parch); color: var(--parch-ink); border: 2px solid #000; padding: 8px; font-size: 16px; resize: vertical; }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; }
.tagrow button { background: #000; border: 1.5px solid var(--iron-bright); color: var(--dim); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; min-height: 30px; }
.tagrow button.pri { background: var(--blood); color: var(--ink); border-color: var(--ink); } .tagrow button.on { border-color: var(--gold); color: var(--gold); }
.tagrow.sub { margin-top: 5px; } .tagrow.sub button { font-size: 9.5px; min-height: 26px; padding: 3px 6px; }
.egrid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.egrid label span { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.egrid input, .field input, .search input { width: 100%; background: #000; color: var(--ink); border: 2px solid var(--iron-bright); padding: 7px 8px; font-size: 16px; min-height: 40px; }
.ebtns { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.ebtns .bbtn { min-height: 38px; font-size: 10px; }

/* buckets */
.search input { border-color: var(--ink); }
.bgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btile { aspect-ratio: 1 / .92; background: var(--stone); border: 2px solid var(--iron-bright); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 4px 0 #000, inset 0 0 0 2px #000, inset 0 0 0 3px var(--iron); position: relative; }
.btile .bs { font-size: 24px; color: var(--gold); line-height: 1; }
.btile .bn { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.btile .bc { font-family: var(--font-title); font-size: 26px; line-height: 1; }
.btile.money { border-color: var(--blood); } .btile.money .bs { color: var(--red); }
.btile.unsorted { border-color: var(--ichor); } .btile.unsorted .bs { color: var(--ichor); }
.bhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bhead h2 { flex: 1; margin: 0; font-size: 26px; text-transform: capitalize; } .bhead .bs { color: var(--gold); font-family: var(--font-body); }
.empty { text-align: center; color: var(--dim); font-size: 13px; margin: 26px 10px; }

/* nav */
.nnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 440px; margin: 0 auto;
  background: #000; border-top: 3px solid var(--blood); padding-bottom: var(--safe-bot); }
.nnav button { height: var(--nav-h); background: transparent; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nnav button svg { width: 22px; height: 22px; fill: currentColor; }
.nnav button.on { color: var(--ink); background: linear-gradient(180deg, var(--crimson), #000); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.78); display: flex; align-items: flex-end; justify-content: center; }
.sbox { width: 100%; max-width: 440px; max-height: 92dvh; overflow: auto; background: var(--stone); border: 2px solid var(--ink); border-bottom: 0; padding: 12px 14px calc(18px + var(--safe-bot)); box-shadow: 0 -4px 0 #000; }
.shead { display: flex; justify-content: space-between; align-items: center; } .shead h2 { margin: 0; }
.field { display: block; margin: 8px 0; } .field span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.cline { font-size: 12.5px; color: var(--dim); margin: 8px 0 0; } .cline.ok { color: var(--ok); } .cline.red { color: var(--red); }

.ntoast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-bot) + 12px); z-index: 50; background: #000; color: var(--ink); border: 2px solid var(--gold);
  padding: 9px 14px; font-size: 13px; font-weight: 700; max-width: 90vw; box-shadow: 0 4px 0 #000; }
