/* Furrow: an illustrated garden. Wooden beds on a lawn, plant stakes in the person's hand, a robin in the margin. */
:root {
  --lawn: #dfe9c9; --lawn-2: #cfdcb3; --lawn-3: #bfd0a0;
  --sky: #e6f0f4;
  --soil: #c99a6b; --soil-2: #b9884f; --furrow: #a97a48; --soil-dark: #8f6338;
  --wood: #b57a3e; --wood-2: #8f5c2b; --wood-3: #d6a06a;
  --stake: #efd8ad; --stake-2: #c9a26a;
  --paper: #fffdf6; --paper-line: #dfe4ea; --paper-margin: #e7a3a3;
  --ink: #2b2a22; --ink-2: #5a5a4c; --ink-3: #8c8a78;
  --pen: #2b5ca8; --pen-soft: #e3ecf9;
  --pencil: #7c8578;
  --red: #c8412c; --red-soft: #f8e0da;
  --marker: #ffd84d;
  --spring: #d7ecc0; --summer: #fbe7a6; --autumn: #f6cfa4; --winter: #dbe6ef;
  --hand: "Architects Daughter", "Segoe Print", "Bradley Hand", cursive;
  --type: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --tray-h: 118px;
  --f-brassica: #5f9e4c; --f-legume: #3b8a5c; --f-allium: #a07cc4; --f-solanaceae: #d0463f; --f-cucurbit: #e0972f;
  --f-umbellifer: #d9702a; --f-chenopod: #b0386a; --f-aster: #8ec55f; --f-grass: #c1ad3f; --f-other: #6f86a3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --lawn: #232a1d; --lawn-2: #1d2318; --lawn-3: #2c3524; --sky: #1a222a;
    --soil: #5a4530; --soil-2: #4b3a27; --furrow: #3f3122; --soil-dark: #2e2418;
    --wood: #7a5230; --wood-2: #5a3a20; --wood-3: #9a6a40;
    --stake: #4a3b28; --stake-2: #7a6244;
    --paper: #262a22; --paper-line: #33392f; --paper-margin: #6a3f3f;
    --ink: #ece9dd; --ink-2: #c2bfae; --ink-3: #8c8a78;
    --pen: #8fb3ee; --pen-soft: #1f2c44; --pencil: #8d968a;
    --red: #ef7a66; --red-soft: #3e241f; --marker: #c9ad2e;
    --spring: #2f4426; --summer: #4a3f1c; --autumn: #4a3220; --winter: #2a3540;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; color: var(--ink); font-family: var(--type); font-size: 15px; line-height: 1.5;
  background-color: var(--lawn);
  background-image: radial-gradient(circle at 20% 30%, var(--lawn-2) 1.2px, transparent 1.6px), radial-gradient(circle at 70% 60%, var(--lawn-3) 1px, transparent 1.4px);
  background-size: 34px 34px, 52px 52px;
  padding-bottom: var(--tray-h); min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.ic { width: 1.35em; height: 1.35em; vertical-align: -.35em; flex: none; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 28px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid color-mix(in srgb, var(--wood) 30%, transparent);
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.05rem; }
.wordmark .ic { width: 1.5em; height: 1.5em; }
.top .spacer { flex: 1; }
.agent-status { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-2); }
.agent-status .ic { width: 1.6em; height: 1.6em; }
.agent-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.agent-status.is-live i { background: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.btn { border: 1px solid color-mix(in srgb, var(--ink-2) 55%, transparent); background: var(--paper); color: var(--ink); padding: 6px 12px; border-radius: 8px; font-size: .84rem; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-pen { border-color: var(--pen); color: var(--pen); }
.btn-pen:hover { background: var(--pen-soft); }
.btn-fill { background: var(--wood); color: #fff; border-color: var(--wood-2); }
.btn-fill:hover { background: var(--wood-2); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: color-mix(in srgb, var(--ink-2) 10%, transparent); border-color: transparent; }
.btn-sm { padding: 3px 9px; font-size: .78rem; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid color-mix(in srgb, var(--ink-2) 40%, transparent); border-radius: 8px; min-width: 190px; padding: 4px; display: grid; z-index: 30; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); }
.menu-list[hidden] { display: none; }
.menu-list button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .86rem; }
.menu-list button:hover { background: color-mix(in srgb, var(--ink-2) 10%, transparent); }

/* ---------- hero ---------- */
.hero { position: relative; height: 160px; overflow: hidden; }
.hero .scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-text { position: absolute; left: 28px; right: 28px; bottom: 14px; display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.hero-text h1 { font-family: var(--hand); font-weight: 400; font-size: 2.1rem; margin: 0; line-height: 1; color: #2b2a22; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.hero-text .line { font-family: var(--hand); font-size: 1.05rem; color: #2b2a22; background: color-mix(in srgb, #fff 70%, transparent); padding: 4px 10px; border-radius: 6px; }
.hero-text .line button { border: 0; background: none; padding: 0 0 0 8px; font-family: var(--type); font-size: .8rem; color: var(--pen); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .hero-text h1, .hero-text .line { color: #ece9dd; text-shadow: none; } .hero-text .line { background: rgba(0,0,0,.45); } .hero .scene { filter: brightness(.55) saturate(.8); } }

/* ---------- sheet ---------- */
.sheet { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 26px; padding: 22px 28px 24px; max-width: 1560px; margin: 0 auto; align-items: start; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.leaders g { opacity: 0; transition: opacity .15s; }
.leaders g.is-hover, .leaders g.is-active { opacity: 1; }
.leaders path { fill: none; stroke: var(--pen); stroke-width: 1.75; }
.leaders circle { fill: var(--pen); }

/* ---------- plot ---------- */
.plot { min-width: 0; }
.plot-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px 4px; font-family: var(--hand); font-size: 1.25rem; }
.plot-head .waiting { margin-left: auto; font-family: var(--type); font-size: .82rem; color: var(--ink-2); }

/* the pinned note */
.note {
  background: var(--paper); border-radius: 4px; padding: 18px 22px 16px; margin: 0 0 22px; max-width: 760px; position: relative;
  box-shadow: 0 12px 28px -14px rgba(40,30,10,.45), 0 1px 0 rgba(0,0,0,.05); transform: rotate(-.4deg);
  background-image: repeating-linear-gradient(transparent 0 27px, var(--paper-line) 27px 28px);
}
.note::before { content: ""; position: absolute; left: 50%; top: -10px; width: 54px; height: 18px; margin-left: -27px; background: color-mix(in srgb, var(--marker) 70%, transparent); transform: rotate(-2deg); border-radius: 2px; }
.note h2 { font-family: var(--hand); font-weight: 400; font-size: 1.3rem; margin: 0 0 4px; line-height: 28px; }
.note p { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); max-width: 62ch; line-height: 28px; }
.note form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.note label { display: grid; grid-template-rows: 28px auto; font-size: .8rem; color: var(--ink-2); align-items: end; }
.note label.wide { grid-column: 1 / -1; }
.note input, .note textarea { font-family: var(--hand); font-size: 1.05rem; line-height: 28px; border: 0; background: transparent; padding: 0 2px; border-radius: 0; height: 28px; }
.note textarea { min-height: 56px; resize: vertical; }
.note .actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding-top: 8px; }

/* beds */
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 30px; }
.bed {
  position: relative; border-radius: 6px; padding: 12px 12px 14px;
  background: var(--soil);
  border: 9px solid var(--wood);
  box-shadow: inset 0 0 0 2px var(--wood-2), inset 0 10px 22px -10px rgba(0,0,0,.45), 0 10px 20px -12px rgba(0,0,0,.45);
  background-image: radial-gradient(circle at 30% 20%, color-mix(in srgb, #fff 8%, transparent) 1px, transparent 2px), radial-gradient(circle at 70% 70%, color-mix(in srgb, #000 8%, transparent) 1px, transparent 2px);
  background-size: 18px 18px, 26px 26px;
}
.bed::after { content: ""; position: absolute; inset: -9px; border-radius: 8px; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,.18), transparent 12%, transparent 88%, rgba(0,0,0,.12)); mix-blend-mode: multiply; }
.bed.is-open { box-shadow: inset 0 0 0 2px var(--wood-2), inset 0 10px 22px -10px rgba(0,0,0,.45), 0 0 0 4px var(--marker), 0 12px 24px -12px rgba(0,0,0,.5); }
.bed-name { display: flex; align-items: center; gap: 10px; }
.bed-name h2 { font-family: var(--hand); font-weight: 400; font-size: 1.35rem; margin: 0; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.bed-name .sun { display: inline-flex; align-items: center; gap: 4px; font-family: var(--hand); font-size: .95rem; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.bed-name .sun .ic { width: 1.5em; height: 1.5em; }
.bed-name .marks { margin-left: auto; display: inline-flex; gap: 6px; font-size: .74rem; }
.bed-name .m-red, .bed-name .m-pen { background: var(--paper); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.bed-name .m-red { color: var(--red); }
.bed-name .m-pen { color: var(--pen); display: inline-flex; align-items: center; gap: 4px; }
.bed-last { font-family: var(--hand); font-size: .92rem; color: #fff8ea; text-shadow: 0 1px 0 rgba(0,0,0,.35); margin: 0 0 8px; }
.strips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.strip {
  position: relative; min-width: 0; min-height: 118px; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: var(--soil-2);
  background-image: repeating-linear-gradient(180deg, transparent 0 9px, color-mix(in srgb, var(--furrow) 70%, transparent) 9px 11px);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
  transition: box-shadow .15s, transform .15s;
}
.strip:hover { box-shadow: inset 0 2px 6px rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.5); }
.strip.is-selected { box-shadow: inset 0 2px 6px rgba(0,0,0,.25), 0 0 0 3px var(--marker); }
.strip.is-dropping { box-shadow: inset 0 0 0 3px var(--marker); transform: scale(1.02); }
.strip .season { display: flex; align-items: center; gap: 4px; padding: 3px 6px; font-family: var(--hand); font-size: .9rem; color: var(--ink); }
.strip .season .ic { width: 1.2em; height: 1.2em; }
.strip[data-season="spring"] .season { background: var(--spring); }
.strip[data-season="summer"] .season { background: var(--summer); }
.strip[data-season="autumn"] .season { background: var(--autumn); }
.strip[data-season="winter"] .season { background: var(--winter); }
.strip .season .end { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
.strip .season .flag { color: var(--red); font-weight: 700; font-family: var(--type); font-size: .8rem; }
.strip .season .dot-pen { width: 8px; height: 8px; border-radius: 50%; background: var(--pen); display: inline-block; border: 1.5px solid #fff; }
.strip .tags { display: grid; gap: 5px; padding: 7px 6px 8px; }
.strip .empty { font-family: var(--hand); font-size: .8rem; color: rgba(255,255,255,.7); text-align: center; padding: 26px 4px 0; }

/* plant stakes */
.tag {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 5px; align-items: center;
  background: linear-gradient(180deg, var(--stake), var(--stake-2) 140%); border: 1px solid var(--stake-2); border-radius: 4px 4px 2px 2px;
  padding: 3px 6px 4px 5px; font-family: var(--hand); font-size: .92rem; line-height: 1.15; color: var(--ink);
  box-shadow: 0 2px 3px rgba(0,0,0,.25);
}
.tag::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--stake-2); margin-left: -5px; }
.tag .ic { width: 1.5em; height: 1.5em; }
.tag > .txt { overflow-wrap: normal; hyphens: none; }
.tag .x { position: absolute; right: 2px; top: 2px; border: 0; background: var(--paper); color: var(--ink-3); cursor: pointer; padding: 0 5px; border-radius: 3px; font-family: var(--type); font-size: .95rem; line-height: 1.2; opacity: 0; }
.tag:hover .x, .tag .x:focus-visible { opacity: 1; }
.tag .x:hover { color: var(--red); }
.tag.is-agent { border-color: var(--pen); box-shadow: 0 2px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--pen-soft); }
.tag.is-ghost { background: color-mix(in srgb, var(--paper) 55%, transparent); border: 1.5px dashed var(--pencil); color: var(--pencil); box-shadow: none; }
.tag.is-ghost::after { display: none; }
.tag.is-ghost .ic { opacity: .55; filter: grayscale(.4); }
.tag.is-ghost .yn { grid-column: 1 / -1; justify-self: end; display: inline-flex; gap: 2px; }
.tag.is-ghost .yn button { border: 0; background: var(--paper); cursor: pointer; color: var(--pen); font-family: var(--type); font-size: .8rem; padding: 1px 6px; border-radius: 3px; line-height: 1.2; }
.tag.is-ghost .yn button:hover { background: var(--pen-soft); }
.tag.is-new { animation: settle .4s ease; }
@keyframes settle { from { transform: translateY(-6px); opacity: .4; } to { } }

/* bed opened in place */
.bed-open { margin-top: 12px; background: var(--paper); border-radius: 6px; padding: 12px 14px; display: grid; gap: 10px; min-width: 0; overflow-wrap: anywhere; box-shadow: 0 6px 16px -10px rgba(0,0,0,.4); }
.bed-open h3 { font-family: var(--hand); font-weight: 400; font-size: 1.15rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.bed-open h3 .ic { width: 1.4em; height: 1.4em; }
.bed-open h3 .close { margin-left: auto; }
.bed-open .facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: end; }
.bed-open .facts label { display: grid; gap: 3px; font-size: .76rem; color: var(--ink-2); }
.bed-open .facts input, .bed-open .facts select { width: 100%; min-width: 0; font-family: var(--hand); font-size: .95rem; border: 0; border-bottom: 1px solid var(--ink-3); background: transparent; padding: 3px 2px; border-radius: 0; }
.bed-open .row { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; }
.bed-open .row .ic { width: 2.4em; height: 2.4em; flex: none; }
.bed-open .row > div { min-width: 0; }
.bed-open .row .facts-text { color: var(--ink-2); font-size: .8rem; }
.bed-open .row .btn { margin-left: auto; flex: none; }
.bed-open .red { color: var(--red); font-size: .84rem; display: flex; gap: 8px; background: var(--red-soft); padding: 8px 10px; border-radius: 6px; }
.bed-open .red b { font-weight: 600; flex: none; }
.bed-open .ghost-line { display: flex; gap: 8px; align-items: center; font-size: .86rem; flex-wrap: wrap; background: var(--pen-soft); padding: 8px 10px; border-radius: 6px; }
.bed-open .ghost-line .ic { width: 1.8em; height: 1.8em; }
.bed-open .ghost-line .why { color: var(--ink-2); flex: 1 1 100%; font-size: .8rem; }
.bed-open .hint { font-size: .8rem; color: var(--ink-3); margin: 0; }
.pen-text { color: var(--pen); }

/* ---------- margin: the notebook ---------- */
.margin { position: relative; min-height: 200px; }
.notebook {
  background: var(--paper); border-radius: 4px; padding: 16px 16px 16px 30px; position: relative;
  background-image: linear-gradient(90deg, transparent 22px, var(--paper-margin) 22px, var(--paper-margin) 23px, transparent 23px), repeating-linear-gradient(transparent 0 27px, var(--paper-line) 27px 28px);
  background-position: 0 0, 0 8px;
  box-shadow: 0 14px 30px -16px rgba(40,30,10,.5);
  min-height: 240px;
}
.notebook::before { content: ""; position: absolute; left: 6px; top: 26px; bottom: 26px; width: 10px; background: repeating-linear-gradient(180deg, transparent 0 22px, var(--lawn-3) 22px 30px); border-radius: 3px; opacity: .8; }
.margin-head { font-size: .84rem; color: var(--ink-2); display: grid; gap: 8px; margin-bottom: 12px; line-height: 28px; }
.margin-head .who-writes { display: flex; align-items: center; gap: 8px; font-family: var(--hand); font-size: 1.1rem; color: var(--ink); }
.margin-head .who-writes .ic { width: 2em; height: 2em; }
.margin-head .row { display: flex; gap: 8px; flex-wrap: wrap; }
.comments { position: relative; }
.comment { position: absolute; left: 0; right: 0; padding: 2px 0 2px 10px; border-left: 2px solid var(--pen); font-size: .86rem; transition: top .25s ease; background: color-mix(in srgb, var(--paper) 75%, transparent); }
.comment.is-static { position: static; margin-bottom: 12px; }
.comment .who { color: var(--pen); font-weight: 600; font-size: .78rem; display: flex; gap: 8px; align-items: baseline; }
.comment .who span { color: var(--ink-3); font-weight: 400; }
.comment .who .where { font-family: var(--hand); color: var(--ink-2); font-size: .92rem; }
.comment p { margin: 2px 0 6px; color: var(--ink); line-height: 1.45; }
.comment .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.comment .acts button { border: 0; background: none; padding: 0; color: var(--pen); cursor: pointer; font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.comment .acts button.apply { text-decoration: none; border: 1px solid var(--pen); border-radius: 6px; padding: 2px 9px; background: var(--paper); }
.comment .acts button.apply:hover { background: var(--pen-soft); }
.comment.is-high { border-left-color: var(--red); }
.comment.is-high .who { color: var(--red); }
.comment.is-closed { border-left-color: var(--ink-3); opacity: .7; }
.comment.is-closed .who { color: var(--ink-3); }
.comment .note-back { font-family: var(--hand); color: var(--ink-2); font-size: .92rem; }
.comment:hover, .comment:focus-within { border-left-width: 3px; }
.margin .empty { font-size: .86rem; color: var(--ink-2); line-height: 28px; }
.margin .empty b { font-weight: 600; }
.history { margin-top: 20px; font-size: .8rem; }
.history summary { cursor: pointer; color: var(--ink-2); }
.history ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.history li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; color: var(--ink-2); }
.history li .ic { width: 1.2rem; height: 1.2rem; }
.history li time { color: var(--ink-3); margin-left: 6px; }

/* ---------- seed tray ---------- */
.tray {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tray-h); z-index: 15;
  background: linear-gradient(180deg, var(--wood-3), var(--wood)); border-top: 3px solid var(--wood-2);
  box-shadow: 0 -8px 24px -12px rgba(0,0,0,.5);
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding: 0 28px;
}
.tray-side { display: grid; gap: 6px; max-width: 230px; }
.tray-side .hint { font-family: var(--hand); font-size: 1rem; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.4); line-height: 1.25; }
.fams { display: flex; gap: 4px; flex-wrap: wrap; }
.fams button { width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.fams button.is-on { border-color: #fff; }
.fams button.all { background: var(--paper); font-size: .58rem; color: var(--ink); }
.packets { display: flex; gap: 10px; overflow-x: auto; padding: 10px 4px 12px; scrollbar-width: thin; }
.packet {
  flex: none; width: 88px; height: 90px; background: var(--paper); border-radius: 4px 4px 6px 6px;
  display: grid; grid-template-rows: 8px 1fr auto; cursor: grab; user-select: none; overflow: hidden;
  box-shadow: 0 3px 6px -2px rgba(0,0,0,.45); transition: transform .12s;
  position: relative;
}
.packet::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(0,0,0,.06) 6px 8px); }
.packet:hover { transform: translateY(-4px) rotate(-1deg); }
.packet:active { cursor: grabbing; }
.packet.is-armed { outline: 3px solid var(--marker); }
.packet b { display: block; }
.packet .pic { display: grid; place-items: center; padding-top: 6px; }
.packet .pic .ic { width: 38px; height: 38px; }
.packet .name { font-family: var(--hand); font-size: .9rem; text-align: center; padding: 0 4px 6px; line-height: 1.1; }

/* ---------- toasts, inspector ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tray-h) + 12px); transform: translateX(-50%); display: grid; gap: 6px; z-index: 40; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-size: .84rem; display: flex; gap: 8px; align-items: center; }
.toast .tag-who { font-weight: 600; font-size: .74rem; opacity: .8; }
.inspector { position: fixed; right: 16px; bottom: calc(var(--tray-h) + 12px); width: min(460px, calc(100vw - 32px)); max-height: 70vh; background: var(--paper); border: 1px solid var(--ink-3); border-radius: 8px; z-index: 35; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); }
.inspector[hidden] { display: none; }
.inspector-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--paper-line); }
.inspector-head h2 { font-size: .95rem; margin: 0; font-weight: 600; }
.inspector-head .close { margin-left: auto; }
.inspector-body { padding: 12px 14px; overflow: auto; display: grid; gap: 10px; }
.inspector-body p.note { font-size: .78rem; color: var(--ink-2); margin: 0; background: none; border: 0; padding: 0; transform: none; box-shadow: none; max-width: none; }
.inspector-body p.note::before { display: none; }
.inspector-body label { font-size: .76rem; color: var(--ink-2); display: grid; gap: 4px; }
.inspector-body select, .inspector-body textarea { border: 1px solid var(--ink-3); background: var(--paper); border-radius: 6px; padding: 6px 8px; font-size: .84rem; }
.inspector-body textarea { font-family: ui-monospace, Menlo, monospace; font-size: .76rem; min-height: 110px; }
.inspector-body .out { font-family: ui-monospace, Menlo, monospace; font-size: .74rem; background: var(--lawn); border: 1px solid var(--paper-line); padding: 8px; white-space: pre-wrap; max-height: 200px; overflow: auto; border-radius: 6px; }
.inspector-body .out.err { border-color: var(--red); color: var(--red); }
.tool-desc { font-size: .8rem; color: var(--ink-2); margin: 0; }
.inspector-body .actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.tag-agent, .tag-system { font-size: .74rem; font-weight: 600; color: var(--pen); }
.tag-system { color: var(--ink-3); }
.btn-primary { background: var(--wood); color: #fff; border-color: var(--wood-2); }
.btn-ghost { border-color: transparent; background: transparent; }

/* ---------- responsive, print, motion ---------- */
@media (max-width: 980px) {
  .sheet { grid-template-columns: 1fr; padding: 16px 14px; }
  .leaders { display: none; }
  .comment { position: static; margin-bottom: 12px; }
  .margin { margin-top: 22px; }
  .beds { grid-template-columns: 1fr; gap: 22px; }
  .top { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .hero { height: 130px; }
  .hero-text { left: 14px; right: 14px; }
  .hero-text h1 { font-size: 1.7rem; }
  .tray { padding: 0 12px; grid-template-columns: 1fr; gap: 2px; --tray-h: 132px; }
  .tray-side { max-width: none; }
  .tray-side .fams { display: none; }
  .note form { grid-template-columns: 1fr; }
  .bed-open .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .strips { grid-template-columns: 1fr 1fr; }
}
@media print {
  .top, .tray, .inspector, .toasts, .leaders, .history, .note, .bed-open, .margin-head .row, .tag .x, .tag .yn, .hero { display: none !important; }
  body { background: #fff; padding: 0; }
  .sheet { grid-template-columns: 1fr 260px; }
  .comment { position: static; margin-bottom: 10px; }
  .bed { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
