/* ============================================================
   The Idea Sketchbook — styles
   Aesthetic: cream paper, ruled grid, handwriting, tape & pins.
   ============================================================ */

:root {
  --paper:        #f4efe1;   /* cream page          */
  --paper-2:      #efe7d3;   /* deeper cream        */
  --ink:          #2b2a26;   /* pencil/pen ink      */
  --ink-soft:     #57534a;
  --ink-faint:    #8b8578;
  --line:         #cdbfa0;   /* ruled grid line     */
  --red:          #d1495b;
  --amber:        #e5a244;
  --green:        #4c8b6f;
  --blue:         #3d6d99;
  --violet:       #7d6a9c;
  --highlight:    #fff3a3;   /* highlighter yellow  */
  --tape:         rgba(228, 214, 170, .55);
  --shadow:       rgba(40, 34, 20, .18);
  --sans:         'Inter', system-ui, sans-serif;
  --hand:         'Caveat', cursive;
  --hand-body:    'Kalam', cursive;
  --hand-alt:     'Patrick Hand', cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--hand-body);
  color: var(--ink);
  background-color: var(--paper);
  /* ruled + grid paper */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205,191,160,.4) 1px, transparent 1px);
  background-size: 100% 30px, 30px 100%;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* subtle paper grain / vignette on top of everything */
.paper-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 120% at 50% 0%, transparent 60%, rgba(90,70,30,.10) 100%);
  mix-blend-mode: multiply;
}

/* the red margin line of a notebook */
body::before {
  content: ""; position: fixed; top: 0; bottom: 0; left: 46px; width: 2px;
  background: rgba(209,73,91,.35); z-index: 2; pointer-events: none;
}
@media (max-width: 720px){ body::before { left: 20px; } }

img { max-width: 100%; }
a { color: inherit; }

/* ---------------- NAV TABS ---------------- */
.tabs {
  position: fixed; top: 18px; right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.tab {
  font-family: var(--hand); font-size: 1.15rem; font-weight: 600;
  text-decoration: none; color: #fff; white-space: nowrap;
  padding: 7px 18px 7px 34px;
  border-radius: 8px 0 0 8px;              /* right edge square: connects to the page */
  box-shadow: -2px 2px 6px var(--shadow);
  transform: translateX(calc(100% - 24px)); /* hide the word: only a colored tab shows */
  transition: transform .22s ease, box-shadow .22s ease;
  opacity: .96;
}
.tab:hover, .tab:focus-visible,
.tabs.is-open .tab { transform: translateX(0); box-shadow: -4px 3px 10px var(--shadow); outline: none; }
.tab--red    { background: var(--red); }
.tab--amber  { background: var(--amber); }
.tab--green  { background: var(--green); }
.tab--blue   { background: var(--blue); }
.tab--violet { background: var(--violet); }
@media (max-width: 720px){
  .tabs { flex-direction: row; top: auto; bottom: 0; right: 0; left: 0;
          justify-content: center; background: rgba(244,239,225,.9);
          padding: 6px; gap: 4px; backdrop-filter: blur(4px); }
  .tab { transform: none; border-radius: 8px; padding: 5px 12px; font-size: 1rem;
         box-shadow: 0 2px 4px var(--shadow); }
}

/* ---------------- shared layout ---------------- */
.sheet {
  position: relative; z-index: 3;
  max-width: 940px; margin: 0 auto; padding: 90px 28px 70px 70px;
}
@media (max-width: 720px){ .sheet { padding: 70px 20px 60px 34px; } }

.section-title {
  font-family: var(--hand); font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700; margin: 0 0 .2em; line-height: 1;
  display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap;
}
.section-title--light { color: var(--paper); }
.section-title__no {
  font-family: var(--hand-alt); font-size: .5em; color: var(--ink-faint);
  transform: rotate(-3deg); border: 1.5px solid var(--ink-faint);
  padding: 0 .4em; border-radius: 40% 60% 55% 45%;
}
.section-lede {
  font-size: 1.25rem; max-width: 60ch; color: var(--ink-soft); margin: .2em 0 1.6em;
}
.section-lede--light { color: rgba(244,239,225,.85); }

/* ---------------- COVER ---------------- */
.cover {
  position: relative; z-index: 3;
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  max-width: 900px; margin: 0 auto; padding: 40px 28px 40px 70px; text-align: center;
}
.cover__eyebrow {
  font-family: var(--hand-alt); letter-spacing: .06em; color: var(--ink-faint);
  margin: 0 0 .4em; font-size: 1.05rem;
}
.cover__title {
  font-family: var(--hand); font-weight: 700; margin: 0;
  font-size: clamp(3.6rem, 15vw, 8.5rem); line-height: .86; letter-spacing: -.01em;
}
.scribble-underline { position: relative; white-space: nowrap; }
.scribble-underline::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .04em; height: .28em;
  background: var(--red); opacity: .85; z-index: -1; border-radius: 50%;
  transform: rotate(-1.5deg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='24'%3E%3Cpath d='M2,14 C60,4 120,20 180,10 C230,2 280,16 298,8' fill='none' stroke='black' stroke-width='14' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='24'%3E%3Cpath d='M2,14 C60,4 120,20 180,10 C230,2 280,16 298,8' fill='none' stroke='black' stroke-width='14' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/100% 100%;
}
.cover__by { font-family: var(--hand-alt); font-size: 1.5rem; margin: .8em 0 0; color: var(--ink-soft); }
.cover__link {
  color: var(--blue); font-weight: 700; text-decoration: underline wavy rgba(61,109,153,.5);
  text-underline-offset: 4px; padding: 0 2px; border-radius: 4px;
  transition: background .15s ease, color .15s ease;
}
.cover__link:hover, .cover__link:focus-visible { background: var(--highlight); color: var(--ink); outline: none; }
.cover__blurb { font-size: 1.35rem; max-width: 44ch; margin: 1.4em auto 0; color: var(--ink-soft); }
.cover__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 2.2em; }

/* tape on cover */
.cover__tape {
  position: absolute; width: 120px; height: 34px; background: var(--tape);
  box-shadow: 0 1px 2px var(--shadow); z-index: 4;
}
.cover__tape--tl { top: 8%; left: 12%; transform: rotate(-24deg); }
.cover__tape--br { bottom: 12%; right: 10%; transform: rotate(-16deg); }
@media (max-width: 720px){ .cover__tape { display: none; } }

/* doodle arrow near CTA */
.doodle { position: absolute; color: var(--blue); width: 110px; }
.doodle--arrow { left: 24%; right: auto; bottom: 29%; transform: rotate(2deg); }
.doodle-note {
  position: absolute; left: 14%; right: auto; bottom: 34%; font-family: var(--hand);
  color: var(--blue); font-size: 1.4rem; transform: rotate(-6deg);
}
@media (max-width: 900px){ .doodle, .doodle-note { display: none; } }

.scroll-hint {
  margin-top: 3rem; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-faint); font-family: var(--hand-alt); font-size: 1rem;
  animation: bob 2.4s ease-in-out infinite;
}
.scroll-hint svg { width: 22px; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(7px);} }

/* ---------------- BUTTONS ---------------- */
.btn {
  font-family: var(--hand); font-size: 1.35rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  padding: 8px 22px; border-radius: 14px 10px 16px 8px;
  display: inline-block; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--ink {
  background: var(--ink); color: var(--paper);
  box-shadow: 3px 3px 0 rgba(43,42,38,.25);
}
.btn--ink:hover { box-shadow: 4px 5px 0 rgba(43,42,38,.28); transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--ink);
}
.btn--ghost:hover { background: rgba(43,42,38,.06); }
.btn--paper {
  background: var(--paper); color: var(--ink);
  box-shadow: 3px 3px 0 rgba(0,0,0,.25);
}
.btn--paper:hover { transform: translateY(-2px) rotate(-1deg); }

/* ---------------- ABOUT ---------------- */
.sheet__pin {
  position: absolute; top: 66px; left: 50%; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, var(--red));
  box-shadow: 0 3px 5px var(--shadow), inset 0 -2px 3px rgba(0,0,0,.25);
}
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; align-items: start; margin-top: 1.4em; }
@media (max-width: 720px){ .about { grid-template-columns: 1fr; } }

.sticky {
  background: var(--highlight); padding: 26px 24px; font-size: 1.3rem; color: var(--ink);
  box-shadow: 4px 6px 14px var(--shadow); transform: rotate(var(--rot, -2deg));
  position: relative;
}
.sticky--yellow { background: #fff2a0; }
.sticky p { margin: 0 0 .7em; }
.sticky::before { /* corner curl */
  content: ""; position: absolute; bottom: 0; right: 0; width: 26px; height: 26px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.10) 50%);
}
.about__facts { list-style: none; margin: .4em 0 0; padding: 0; font-size: 1.3rem; }
.about__facts li { margin: 0 0 .85em; display: flex; gap: .55em; }
.marker { color: var(--red); font-size: 1.1em; }

/* ---------------- VAULT / CARDS ---------------- */
.sheet--grid { }
.vault-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 1.6em; }
.chip {
  font-family: var(--hand-alt); font-size: 1.05rem; cursor: pointer;
  background: transparent; color: var(--ink-soft);
  border: 2px solid var(--ink-faint); border-radius: 30px 24px 28px 22px;
  padding: 3px 16px; transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.vault-status { font-family: var(--hand); color: var(--ink-faint); font-size: 1.15rem; margin-left: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }
.cards__empty {
  grid-column: 1 / -1; text-align: center; color: var(--ink-faint);
  font-family: var(--hand); font-size: 1.5rem; padding: 40px 20px;
  border: 2px dashed var(--line); border-radius: 8px; transform: rotate(-.4deg);
}

.card {
  position: relative; background: #fffdf5; padding: 22px 22px 60px;
  border-radius: 4px; box-shadow: 3px 4px 12px var(--shadow);
  transform: rotate(var(--tilt, 0deg)); transition: transform .16s ease, box-shadow .16s ease;
  border: 1px solid rgba(0,0,0,.06); min-height: 230px; display: flex; flex-direction: column;
}
.card:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 5px 8px 20px var(--shadow); }
.card__tape {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 90px; height: 26px; background: var(--tape); box-shadow: 0 1px 2px var(--shadow);
}
.card__kicker {
  font-family: var(--hand-alt); font-size: .95rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-faint); margin: 4px 0 2px;
  display: flex; align-items: center; gap: 8px;
}
.card__tag { padding: 1px 9px; border-radius: 20px; color: #fff; font-size: .78rem; letter-spacing: .02em; }
.tag-idea     { background: var(--green); }
.tag-teardown { background: var(--blue); }
.tag-open     { background: var(--amber); color: var(--ink); }
.card__title { font-family: var(--hand); font-size: 1.75rem; font-weight: 700; margin: .1em 0 .25em; line-height: 1.05; }
.card__teaser { font-size: 1.12rem; color: var(--ink-soft); margin: 0; flex: 1; }

.card__foot {
  position: absolute; left: 22px; right: 22px; bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--hand-alt); font-size: .95rem; color: var(--ink-faint);
}
.card__lock { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--red); }
.card__open-link { color: var(--blue); font-weight: 700; }
.card__cta {
  background: none; border: none; cursor: pointer; font-family: var(--hand); font-size: 1.2rem;
  color: var(--ink); text-decoration: underline wavy rgba(43,42,38,.35); text-underline-offset: 3px;
  padding: 0;
}
.card__cta:hover { color: var(--red); }

/* redacted preview strip inside locked cards */
.redacted { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.redacted span { height: 9px; background: repeating-linear-gradient(90deg,var(--ink) 0 60px, transparent 60px 66px); opacity: .22; border-radius: 3px; }
.redacted span:nth-child(2){ width: 82%; }
.redacted span:nth-child(3){ width: 64%; }

.card.is-unlocked .card__lock { color: var(--green); }

/* ---------------- BUILT / PROJECTS ---------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 30px; margin-top: 1.2em; }
.project {
  background: #fffdf5; border-radius: 6px; box-shadow: 3px 5px 14px var(--shadow);
  overflow: hidden; border: 1px solid rgba(0,0,0,.06); transform: rotate(var(--tilt,0deg));
  transition: transform .16s ease, box-shadow .16s ease; display: flex; flex-direction: column;
}
.project:hover { transform: rotate(0) translateY(-4px); box-shadow: 6px 9px 22px var(--shadow); }
.project__sketch {
  aspect-ratio: 16/9; background: var(--paper-2); position: relative;
  display: flex; align-items: center; justify-content: center; border-bottom: 2px dashed var(--line);
}
.project__sketch svg { width: 70%; height: 70%; color: var(--ink-soft); }
.project__badge {
  position: absolute; top: 10px; right: 10px; font-family: var(--hand); font-size: 1.05rem;
  background: var(--green); color: #fff; padding: 1px 12px; border-radius: 20px; transform: rotate(4deg);
  box-shadow: 0 2px 4px var(--shadow);
}
.project__badge--wip { background: var(--amber); color: var(--ink); }
.project__body { padding: 18px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.project__title { font-family: var(--hand); font-size: 1.85rem; font-weight: 700; margin: 0 0 .1em; }
.project__role { font-family: var(--hand-alt); color: var(--ink-faint); margin: 0 0 .6em; font-size: 1rem; }
.project__desc { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 1em; flex: 1; }
.project__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.project__tool { font-family: var(--sans); font-size: .78rem; background: var(--paper-2); padding: 2px 10px; border-radius: 20px; color: var(--ink-soft); }
.project__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.project__link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-family: var(--hand-alt); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px 9px 13px 8px;
  padding: 3px 12px; box-shadow: 2px 2px 0 rgba(43,42,38,.22);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.project__link:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 3px 4px 0 rgba(43,42,38,.26); background: var(--highlight); }
.project__link svg { width: 16px; height: 16px; }

/* ---------------- MARGINS / DARK ---------------- */
.sheet--dark {
  max-width: none; margin-top: 40px; background: #26241f; color: var(--paper);
  padding-top: 80px; padding-bottom: 90px;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px;
}
.sheet--dark .section-title { color: var(--paper); }
.sheet--dark .section-title__no { color: rgba(244,239,225,.6); border-color: rgba(244,239,225,.4); }
.margins { display: flex; gap: 16px; flex-wrap: wrap; margin: 1.4em 0 1.6em; }
.margins__fine { font-family: var(--hand-alt); color: rgba(244,239,225,.55); font-size: 1rem; }

/* ---------------- MODALS ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(30,26,18,.55); backdrop-filter: blur(2px); }
.modal__sheet {
  position: relative; z-index: 1; max-width: 720px; margin: 6vh auto; max-height: 88vh; overflow: auto;
  background: var(--paper); border-radius: 6px; padding: 40px 44px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 30px;
  animation: pop .18s ease;
}
.modal__sheet--narrow { max-width: 440px; text-align: center; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 720px){ .modal__sheet { margin: 3vh 14px; padding: 32px 24px; } }
.modal__close {
  position: absolute; top: 12px; right: 16px; background: none; border: none; cursor: pointer;
  font-size: 2rem; line-height: 1; color: var(--ink-faint); font-family: var(--sans);
}
.modal__close:hover { color: var(--red); }

.modal__body .kicker { font-family: var(--hand-alt); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin: 0; }
.modal__body h2 { font-family: var(--hand); font-size: 2.6rem; margin: .1em 0 .3em; line-height: 1; }
.modal__body h3 { font-family: var(--hand); font-size: 1.7rem; margin: 1.1em 0 .2em; color: var(--ink); }
.modal__body p, .modal__body li { font-size: 1.18rem; color: var(--ink-soft); }
.modal__body ul { padding-left: 1.3em; }
.modal__meta { font-family: var(--hand-alt); color: var(--ink-faint); border-top: 2px dashed var(--line); margin-top: 1.6em; padding-top: .8em; font-size: 1rem; }
.confidential {
  display: inline-block; font-family: var(--hand); transform: rotate(-4deg);
  border: 2.5px solid var(--red); color: var(--red); padding: 2px 14px; border-radius: 40% 60% 50% 50%;
  font-size: 1.2rem; margin-bottom: 1em; letter-spacing: .02em;
}

/* ---------------- LOCK MODAL ---------------- */
.lock__title { font-family: var(--hand); font-size: 2.2rem; margin: 0 0 .2em; }
.lock__copy { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.2em; }
.lock__form { display: flex; gap: 8px; }
.lock__form input {
  flex: 1; font-family: var(--hand-body); font-size: 1.2rem; padding: 8px 14px;
  border: 2px solid var(--ink-faint); border-radius: 10px; background: #fffdf5; color: var(--ink);
}
.lock__form input:focus { outline: none; border-color: var(--ink); }
.lock__error { color: var(--red); font-family: var(--hand); font-size: 1.2rem; min-height: 1.4em; margin: .6em 0 0; }
.lock__hint { font-family: var(--hand-alt); color: var(--ink-faint); font-size: 1rem; margin-top: .8em; }
.lock__hint a { color: var(--blue); font-weight: 700; }
.lock__demo { display: block; margin-top: 4px; opacity: .8; }
.lock__demo code { background: var(--paper-2); padding: 1px 6px; border-radius: 5px; font-size: .95em; }

/* ---------------- FOOTER ---------------- */
.footer { position: relative; z-index: 3; text-align: center; padding: 30px 20px 40px; color: var(--ink-faint); font-family: var(--hand-alt); }
@media (max-width: 720px){ .footer { padding-bottom: 70px; } }

/* ============================================================
   IN-PAGE EDITOR (edit mode) — hidden until body.sb-editing
   ============================================================ */
.sb-editor {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 90;
  background: #fbf7ec; color: var(--ink); box-shadow: -8px 0 30px rgba(40,34,20,.28);
  border-left: 3px solid var(--ink);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  font-family: var(--sans);
}
body.sb-editing .sb-editor { transform: translateX(0); }
body.sb-editing { }  /* page stays interactive so you see the live preview */

.sb-editor__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 2px dashed var(--line); flex: none;
}
.sb-editor__bar strong { font-family: var(--hand); font-size: 1.5rem; font-weight: 700; }
.sb-editor__x { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-faint); }
.sb-editor__x:hover { color: var(--red); }

.sb-editor__body { flex: 1; overflow-y: auto; padding: 16px; }

.sb-editor__foot {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 2px dashed var(--line); background: #f4eeddcc;
}
.sb-editor:not(.sb-authed) .sb-editor__foot { display: none; }  /* hidden until passphrase entered */
.sb-editor__status { font-size: .82rem; color: var(--ink-faint); flex: 1; }
.sb-editor__status.is-ok    { color: var(--green); font-weight: 600; }
.sb-editor__status.is-err   { color: var(--red);   font-weight: 600; }
.sb-editor__status.is-muted { color: var(--ink-faint); }

/* editor buttons */
.sb-btn { font-family: var(--sans); font-size: .88rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 9px; padding: 7px 14px; background: var(--paper); color: var(--ink); }
.sb-btn--ink { background: var(--ink); color: var(--paper); }
.sb-btn--ghost { background: transparent; }
.sb-btn:hover { transform: translateY(-1px); }
.sb-block { display: block; width: 100%; margin-top: 10px; }
.sb-btn--add { width: 100%; border-style: dashed; background: transparent; margin-bottom: 14px; padding: 10px; }

.sb-hint { font-size: .85rem; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.sb-hint code, .sb-field__hint code { background: var(--paper-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* tabs */
.sb-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.sb-tab { flex: 1; font-family: var(--sans); font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--ink-faint); border-radius: 8px; padding: 6px; background: transparent; color: var(--ink-soft); }
.sb-tab.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* list rows */
.sb-list { display: flex; flex-direction: column; gap: 8px; }
.sb-row { display: flex; align-items: stretch; gap: 6px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.sb-row__main { flex: 1; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.sb-row__main:hover { background: var(--highlight); }
.sb-row__title { font-weight: 600; font-size: .92rem; }
.sb-row__meta { font-size: .76rem; color: var(--ink-faint); }
.sb-row__ctl { display: flex; flex-direction: column; border-left: 1.5px solid var(--line); }
.sb-mini { flex: 1; background: none; border: none; cursor: pointer; padding: 0 9px; font-size: .8rem; color: var(--ink-faint); }
.sb-mini:hover { background: var(--paper-2); color: var(--ink); }
.sb-mini--del:hover { color: var(--red); }

/* form */
.sb-back { background: none; border: none; cursor: pointer; color: var(--blue); font-weight: 600; font-size: .88rem; padding: 0 0 12px; }
.sb-form { display: flex; flex-direction: column; gap: 14px; }
.sb-field { display: flex; flex-direction: column; gap: 5px; }
.sb-field__label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.sb-field__sub { font-weight: 400; color: var(--ink-faint); }
.sb-field__hint { font-size: .74rem; color: var(--ink-faint); }
.sb-input { font-family: var(--sans); font-size: .9rem; padding: 8px 10px; border: 1.5px solid var(--ink-faint);
  border-radius: 7px; background: #fff; color: var(--ink); width: 100%; }
.sb-input:focus { outline: none; border-color: var(--ink); }
.sb-area { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; line-height: 1.5; resize: vertical; }
.sb-check { width: 18px; height: 18px; align-self: flex-start; }
select.sb-input { cursor: pointer; }

@media (max-width: 480px){ .sb-editor { width: 100vw; } }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
