/* Grainbook Studio. Same family look as Grainbook Mill: warm sawdust neutrals, a green accent, navy bars. */
:root {
  --bg: #F5F3EE; --paper: #FFFFFF; --ink: #22252B; --muted: #6B6F78; --line: #DDD8CE;
  --green: #2F5D46; --green-dark: #23473A; --tint: #E7EFE9;
  --nav: #1E2A24; --nav-ink: #F2F0EA; --nav-muted: #A9B3AC;
  --wood: #C9A473; --cut: #2F5D46; --sel: #D9822B; --snap: #D9822B; --grid: #ECE7DD; --grid-major: #DCD5C7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }

.top { display: flex; align-items: center; gap: 16px; padding: 8px 14px; background: var(--nav); color: var(--nav-ink); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 16px; }
.brand small { font-size: 12px; color: var(--nav-muted); }
.proj { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.proj i { font-style: normal; font-weight: 400; color: var(--nav-muted); margin-left: 6px; }
.top-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: var(--nav-ink); }
.top .btn.primary { background: var(--green); border-color: var(--green); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }

.main { flex: 1; display: flex; min-height: 0; }
.tools { width: 84px; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; overflow-y: auto; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; font-size: 12px; color: var(--muted); }
.tool svg { width: 26px; height: 26px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--bg); }
.tool.on { background: var(--tint); border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.tool.on svg { stroke: var(--green-dark); }
.tools hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

.stage { flex: 1; position: relative; min-width: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; cursor: crosshair; }
.hint { position: absolute; left: 12px; top: 10px; max-width: calc(100% - 24px); background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 14px; pointer-events: none; }
.hint:empty { display: none; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; }

.panel { width: 290px; background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; padding: 12px 14px 30px; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 8px; }
.panel h3:first-child { margin-top: 0; }
.field { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 8px; margin-bottom: 6px; }
.field label { font-size: 14px; color: var(--muted); }
.field input, .field select { width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; text-align: right; }
.field input.bad { border-color: #B3261E; background: #FDEDEC; }
.facts { font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }
.row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.cmd { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--paper); border-top: 1px solid var(--line); }
.cmd label { font-size: 13px; color: var(--muted); }
.cmd input { flex: 1; min-width: 0; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 7px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.status { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.sheet { position: fixed; inset: 0; background: rgba(20,24,22,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.sheet-card { background: var(--paper); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 18px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.sheet-card h2 { margin: 0 0 4px; font-size: 20px; }
.sheet-card .sub { color: var(--muted); margin-bottom: 14px; }
.starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.start { text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.start b { display: block; }
.start span { font-size: 13px; color: var(--muted); }
.start.on { border-color: var(--green); background: var(--tint); }
.start.soon { opacity: .55; cursor: default; }
.starts.groups { grid-template-columns: repeat(3, 1fr); }
.types { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; padding: 10px; background: var(--bg); border-radius: 10px; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .btn { justify-content: space-between; }
.menu { position: fixed; z-index: 15; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; min-width: 220px; }
.menu button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.menu button:hover { background: var(--tint); }
.menu small { display: block; color: var(--muted); }

.modes { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.mode { flex: 1; border: 0; background: none; padding: 8px 2px; border-radius: 7px; white-space: nowrap; font-size: 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.mode.on { background: var(--paper); color: var(--green-dark); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.edit-grid .btn { min-height: 32px; padding: 4px 6px; font-size: 13px; }
.tp { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; }
.tp-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tp-head span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tp .row { margin-top: 6px; } .tp .btn { min-height: 30px; padding: 3px 10px; font-size: 14px; }
.warn { background: #FFF4E5; border: 1px solid #F0C27B; border-radius: 7px; padding: 5px 8px; font-size: 13px; margin-top: 6px; }
.bitrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sheet-card h3 { font-size: 14px; margin: 14px 0 6px; } .sheet-card h3 small { font-weight: 400; color: var(--muted); }
.sheet-card .field { grid-template-columns: 1fr 200px; }
.toast { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); background: var(--nav); color: #fff; padding: 9px 14px; border-radius: 9px; z-index: 30; }
.toast.bad { background: #B3261E; }

@media (max-width: 900px) {
  .panel { width: 230px; }
  .brand small { display: none; }
}
.main { position: relative; }
@media (max-width: 700px) {
  .top { flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
  .brand b { display: none; }
  .top .btn { min-height: 32px; padding: 4px 9px; font-size: 14px; }
  .top-btns { flex: 1; }
  .starts, .starts.groups { grid-template-columns: 1fr 1fr; }
  .proj { order: 3; flex-basis: 100%; }
  .tools { width: 64px; }
  .tool { font-size: 11px; }
  .panel { position: absolute; right: 0; bottom: 50px; top: auto; width: 100%; max-height: 40vh; border-left: 0; border-top: 1px solid var(--line); }
  .status { display: none; }
}

/* furniture: no drawing tools; reports over the drawing */
body.parts .tools { display: none; }
body.parts #cv { cursor: grab; }
.report { position: absolute; inset: 0; overflow-y: auto; background: var(--bg); padding: 16px 20px 60px; z-index: 2; }
.rep { max-width: 980px; margin: 0 auto; }
.rep h2 { font-size: 19px; margin: 18px 0 8px; }
.tbl { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); padding: 7px 10px; }
.tbl td { padding: 7px 10px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl td:not(:first-child):not(:last-child) { white-space: nowrap; }
.tbl tr.grp td { background: var(--tint); font-weight: 700; color: var(--green-dark); }
.tbl tr.sum td { font-weight: 700; } .tbl tr.big td { font-size: 17px; }
.tbl.small input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.tbl.small input.num { width: 80px; text-align: right; }
.sheetbox { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; break-inside: avoid; }
.sheetsvg { width: 100%; height: auto; display: block; margin: 6px 0; }
.lh { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--green); padding-bottom: 10px; margin-bottom: 8px; }
.lh-right { text-align: right; }
.panel h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
@media print {
  .top, .tools, .panel, .cmd, .zoom, .hint, #cv, .toast, .sheet { display: none !important; }
  body { overflow: visible; display: block; background: #fff; }
  .main, .stage { display: block; position: static; }
  .report { position: static; overflow: visible; padding: 0; background: #fff; }
  .rep .btn, .rep .row { display: none; }
}
.rep ol.steps { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 12px 36px; } .rep ol.steps li { margin: 6px 0; }
.chk { font-size: 11px; background: #FFF4E5; color: #8A5A12; border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.hw-list { max-height: 50vh; overflow-y: auto; }
.tbl.small select { border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.swbtn { justify-content: flex-start; gap: 8px; width: 100%; font-size: 13px; overflow: hidden; }
.swbtn i, .sw i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; }
.sw { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.sw i { width: 100%; height: 44px; }
.sw small { color: var(--muted); font-size: 11px; }
.sw.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--tint); }
.toolno { font: 600 12px ui-monospace, Menlo, monospace; background: var(--nav); color: #fff; border-radius: 5px; padding: 1px 5px; }
.est-pics { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: center; margin: 8px 0 12px; } .est-pics img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #F2EFE8; }
@media (max-width: 700px) { .est-pics { grid-template-columns: 1fr; } }

/* Render: a photo-real picture fills the window */
.render { position: fixed; inset: 0; z-index: 30; background: #1C1E22; display: flex; flex-direction: column; color: #EEE; }
.render-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; background: #26292E; border-bottom: 1px solid #000; font-size: 14px; }
.render-bar label { display: flex; gap: 6px; align-items: center; color: #C9CCD2; }
.render-bar select, .render-bar input[type=range] { font: inherit; }
.render-bar select { background: #33373D; color: #EEE; border: 1px solid #4A4F57; border-radius: 6px; padding: 4px 6px; }
.rn-prog { color: #AFC8A8; min-width: 190px; }
.rn-btns { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.render-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 12px; }
.render-stage canvas { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #EFECE6; }
.rn-wait { position: absolute; color: #DDD; background: rgba(0,0,0,.55); padding: 10px 16px; border-radius: 10px; }
.rn-wait[hidden] { display: none; }
@media (max-width: 700px) { .rn-btns { margin-left: 0; } .render-bar { font-size: 13px; } }

/* Library */
.sheet-card.wide { width: min(900px, 100%); }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lib-filter { align-items: center; }
.lib-tbl tr[data-mi] { cursor: pointer; }
.lib-tbl tr[data-mi]:hover td { background: var(--bg); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); vertical-align: -2px; margin-right: 6px; }
.sheet-card.wide .field { grid-template-columns: 1fr minmax(180px, 360px); }
.sheet-card.wide .field textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.field.qrow { grid-template-columns: 1fr; }
.qgrid { display: grid; grid-template-columns: repeat(7, minmax(56px, 1fr)); gap: 6px; }
@media (max-width: 600px) { .qgrid { grid-template-columns: repeat(4, 1fr); } .sheet-card.wide .field { grid-template-columns: 1fr 1fr; } }
.qgrid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.qgrid input { width: 100%; }
.sheet-card.wide .field select { text-align: left; }
.est-cust { margin: 6px 0 10px; line-height: 1.35; }
.bad-text { color: #B3261E; }
.ai-list { margin: 4px 0 8px 18px; padding: 0; } .ai-list li { margin: 2px 0; }
.sheet-card.wide .field.qrow { grid-template-columns: 1fr; }
.surf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 8px; }
.surf-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font: inherit; }
.surf-card img { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; }
.surf-card span { font-size: 12px; color: var(--muted); } .surf-card.add { justify-content: center; align-items: center; min-height: 120px; }
.surf-prev { width: 120px; height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.cab-sheet { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; break-inside: avoid; } .cab-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; } .cab-head span { flex: 1; color: var(--muted); }
/* Machine picker (posts.js) */
.btn.pick-machine { width: 100%; justify-content: space-between; text-align: left; white-space: normal; font-weight: 600; }
.checks { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; font-size: 14px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; }
.mlist { max-height: 56vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 10px; margin: 8px 0; }
.mlist h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }
.mrow { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 8px; cursor: pointer; font: inherit; color: var(--ink); }
.mrow:hover { background: var(--bg); }
.mrow span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.mmaker summary { cursor: pointer; padding: 6px 2px; font-weight: 600; }
.mmaker summary span, .mname { color: var(--muted); font-weight: 400; font-size: 13px; }
.mname { font-weight: 600; color: var(--ink); margin: 10px 0 2px; }
@media (max-width: 600px) { .mrow { flex-direction: column; gap: 2px; } .mrow span { white-space: normal; } }
/* Start screen (start.js) */
.start-page { position: fixed; inset: 0; z-index: 15; display: grid; grid-template-columns: 270px 1fr; background: var(--bg); }
.start-page[hidden] { display: none; }
.st-side { background: #1F2A24; color: #E8EDE9; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.st-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.st-brand b { display: block; font-size: 17px; } .st-brand small { color: #A9B7AE; }
.st-link { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.st-link:hover, .st-link:focus-visible { background: rgba(255,255,255,.08); }
.st-link .ic { width: 20px; height: 20px; flex: none; opacity: .85; }
.st-back { background: rgba(255,255,255,.1); font-weight: 600; margin-bottom: 6px; }
.st-machine span { font-size: 14px; line-height: 1.3; }
.st-sep { border-top: 1px solid rgba(255,255,255,.12); margin: 10px 0; }
.st-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #A9B7AE; padding: 0 10px 4px; }
.st-main { overflow-y: auto; padding: 34px 40px 60px; }
.st-hello h1 { margin: 0 0 4px; font-size: 28px; } .st-hello p { margin: 0 0 22px; color: var(--muted); }
.st-main h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 12px; }
.st-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kcard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: var(--ink); transition: border-color .12s, transform .12s; }
.kcard:hover, .kcard:focus-visible { border-color: var(--green); transform: translateY(-1px); }
.kcard .kic { width: 30px; height: 30px; color: var(--green); margin-bottom: 6px; }
.kcard span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.st-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.st-recent-head input { max-width: 300px; flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); }
.st-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 2px; padding: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: var(--ink); overflow: hidden; }
.pcard:hover, .pcard:focus-visible { border-color: var(--green); }
.pcard b, .pcard small { padding: 0 12px; } .pcard b { margin-top: 8px; } .pcard small { color: var(--muted); font-size: 12px; }
.pthumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: #EFEBE3; border-bottom: 1px solid var(--line); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; } .pthumb .ph { width: 40px; height: 40px; color: #B9B2A4; }
.st-empty { color: var(--muted); padding: 30px; border: 1px dashed var(--line); border-radius: 12px; grid-column: 1 / -1; text-align: center; }
@media (max-width: 760px) { .start-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .st-side { flex-direction: row; flex-wrap: wrap; padding: 12px; } .st-brand { width: 100%; margin-bottom: 4px; } .st-link { width: auto; } .st-sep, .st-label { display: none; } .st-main { padding: 20px 16px 40px; } }
.undo-grp { display: inline-flex; gap: 2px; margin-right: 6px; }
.btn.icon-btn { padding: 6px 8px; min-width: 36px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:disabled:hover { border-color: var(--line); }
/* Measure tool bar (measure.js) */
.mbar { position: absolute; left: 12px; top: 46px; max-width: min(560px, calc(100% - 24px)); background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.08); z-index: 3; }
.mbar[hidden] { display: none; }
.mmodes { display: flex; flex-wrap: wrap; gap: 4px; }
.mmodes .btn { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.mout { position: absolute; left: 12px; bottom: 12px; max-width: min(380px, calc(100% - 140px)); max-height: 55%; overflow-y: auto; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.08); z-index: 3; }
.mout[hidden] { display: none; }
.mout table { border-collapse: collapse; margin: 4px 0 6px; max-height: 40vh; }
.mout th { text-align: left; font-weight: 400; color: var(--muted); padding: 2px 14px 2px 0; }
.mout td { font-variant-numeric: tabular-nums; font-weight: 600; }
.mout .row { gap: 6px; } .mout .row .btn { min-height: 30px; font-size: 13px; }
.sub-back { margin: -4px 0 8px; }
/* Signing in (signin.js) */
.signin { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: #1F2A24; padding: 16px; overflow-y: auto; }
.signin[hidden] { display: none; }
.si-card { background: var(--paper); border-radius: 16px; padding: 26px 24px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.si-card .field { text-align: left; } .si-card .field input { text-align: left; }
.si-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.si-card h2 { margin: 6px 0 4px; } .si-card p { color: var(--muted); margin: 0 0 14px; }
.btn.wide { width: 100%; margin-top: 8px; min-height: 46px; font-size: 16px; }
.si-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.si-person { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.si-person:hover, .si-person:focus-visible { border-color: var(--green); }
.si-initial { width: 52px; height: 52px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.si-dots { display: flex; justify-content: center; gap: 12px; min-height: 18px; margin: 4px 0 14px; }
.si-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.si-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.si-pad button { min-height: 58px; font-size: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; color: var(--ink); }
.si-pad button.go { background: var(--green); color: #fff; border-color: var(--green); font-size: 18px; }
.si-wait { width: 36px; height: 36px; margin: 10px auto; border: 4px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: si-spin 1s linear infinite; }
@keyframes si-spin { to { transform: rotate(360deg); } }
.st-badge { background: #C2410C; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.pp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
/* Phones and iPads (2026-11-09): the notch, a ☰ menu, the panel as a pull-up sheet */
.phone-only { display: none !important; }
.top { padding-top: max(8px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.cmd { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; min-height: 46px; font-size: 16px; }
@media (max-width: 700px) {
  .phone-only { display: inline-flex !important; }
  .top-btns > .btn:not(#save-btn):not(#menu-btn), .top-btns > select, .top-btns > a { display: none !important; }
  .top-btns { flex: 0 0 auto; }
  .proj { order: 0; flex-basis: auto; flex: 1; }
  .brand span { display: none; }
  .cmd { display: none; }
  .panel { display: none; position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 62vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.12); padding-bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 4; }
  body.panel-open .panel { display: block; }
  .panel-toggle { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5; min-height: 42px; border-radius: 21px; box-shadow: 0 4px 14px rgba(0,0,0,.15); background: var(--green); color: #fff; border-color: var(--green); }
  .main { position: relative; }
  .zoom { bottom: 64px; }
  .field { grid-template-columns: 1fr 140px; }
  .field input, .field select { min-height: 40px; font-size: 16px; } /* 16px: iPhone doesn't zoom in on the box */
  .sheet { padding: 0; align-items: flex-end; }
  .sheet-card { border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .mbar { top: 44px; } .mout { max-width: calc(100% - 24px); bottom: 64px; }
  .tool svg { width: 22px; height: 22px; }
}
@media (max-width: 760px) { .st-kinds { grid-template-columns: 1fr 1fr; gap: 10px; } .kcard { padding: 12px; } .st-recent { grid-template-columns: 1fr 1fr; gap: 10px; } .st-hello h1 { font-size: 24px; } }
