/* Timetable Maker (2026-10-19). Loaded only by /timetable-maker. Every selector is .tm- or #tm-
   prefixed, so nothing here can reach another app. Built to the approved mocks in the vault:
   05 Apps/Timetable Maker mock v2 2026-10-19.html (welcome + maker) and
   05 Apps/Timetable Maker styles mock 2026-10-19.html (the export screen). */

/* ── Header: the three steps sit IN the shell header, never a second bar (Rob) ─────────── */
#tm-steps{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:7px;white-space:nowrap;z-index:3;}
#tm-steps .tm-ar{color:#8a7f6d;font-weight:700;font-size:.8rem;font-family:'Space Grotesk',sans-serif;}
.tm-si{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 13px 0 5px;border:2px solid #191510;border-radius:50px;background:#fff;color:#8a7f6d;font-weight:700;font-size:.8rem;white-space:nowrap;font-family:'Space Grotesk',sans-serif;cursor:default;box-sizing:border-box;transition:transform .08s;}
.tm-si .tm-n{width:20px;height:20px;border-radius:50%;border:2px solid currentColor;display:inline-flex;align-items:center;justify-content:center;font-family:'Space Mono',monospace;font-size:.62rem;flex:0 0 20px;box-sizing:border-box;}
.tm-si.cur{color:#191510;outline:3px solid #FFCE45;outline-offset:0;}
.tm-si.cur .tm-n{border-color:#191510;}
.tm-si.done{background:#6FD060;color:#191510;cursor:pointer;}
.tm-si.done .tm-n{background:#191510;border-color:#191510;color:#6FD060;}
.tm-si.cta{background:#FFCE45;color:#191510;padding:0 14px;cursor:pointer;}
.tm-si.cta .tm-n{display:none;}
.tm-si.done:hover,.tm-si.cta:hover{transform:translateY(-2px);}
.tm-si .tm-sh{display:none;}
/* Compact: the steps either side of the current one become circles; only the current one is named. */
#tm-steps.tm-compact{gap:6px;}
#tm-steps.tm-compact .tm-ar{display:none;}
#tm-steps.tm-compact .tm-si:not(.cur){width:28px;height:28px;padding:0;justify-content:center;gap:0;}
#tm-steps.tm-compact .tm-si:not(.cur) .tm-lw{display:none;}
#tm-steps.tm-compact .tm-si:not(.cur) .tm-n{border:0;width:auto;height:auto;font-size:.72rem;background:none;flex:none;}
#tm-steps.tm-compact .tm-si.done:not(.cur) .tm-n{color:#191510;}
#tm-steps.tm-compact .tm-si.cta:not(.cur) .tm-n{display:inline;color:#191510;}
#tm-steps.tm-compact .tm-si.cur{height:28px;padding:0 10px 0 5px;gap:5px;font-size:.72rem;}
#tm-steps.tm-compact .tm-si.cur .tm-n{width:18px;height:18px;flex:0 0 18px;font-size:.58rem;}
#tm-steps.tm-compact .tm-si.cur .tm-lw{display:none;}
#tm-steps.tm-compact .tm-si.cur .tm-sh{display:inline;}
/* Tiny: every step is a circle. */
#tm-steps.tm-tiny .tm-si.cur{width:28px;padding:0;justify-content:center;gap:0;}
#tm-steps.tm-tiny .tm-si.cur .tm-sh{display:none;}
#tm-steps.tm-tiny .tm-si.cur .tm-n{border:0;width:auto;height:auto;font-size:.72rem;}

/* Header pills: the shell's .sg-hdr-pill, plus the class picker and the save state. */
#tm-hdr-right{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;}
.tm-clspill{max-width:230px;}
.tm-clspill .tm-clst{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:none;letter-spacing:0;font-size:.78rem;}
.tm-clspill .tm-car{font-size:.55rem;flex-shrink:0;}
.tm-svpill{gap:7px;}
.tm-svpill .tm-cloud{display:none;}
.tm-svpill .tm-cl-wait,.tm-svpill .tm-cl-err{display:none;}
.tm-svpill.saving .tm-cl-ok,.tm-svpill.err .tm-cl-ok{display:none;}
.tm-svpill.saving .tm-cl-wait,.tm-svpill.err .tm-cl-err{display:inline;}
.tm-svpill .tm-ok{width:9px;height:9px;border-radius:50%;background:#6FD060;border:1.5px solid #191510;flex:0 0 9px;box-sizing:border-box;}
.tm-svpill.saving .tm-ok{background:#FFCE45;}
.tm-svpill.err .tm-ok{background:#FF6F5E;}
.tm-svpill.err{background:#FFE3DE;}
.tm-dlpill svg{flex-shrink:0;}
@media (max-width:640px){
    .tm-clspill{max-width:72px;height:32px;padding:0 8px;}
    .tm-clspill .tm-clst{white-space:normal;line-height:1.05;font-size:.62rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
    .tm-clspill .tm-car{display:none;}
    .tm-svpill{width:36px;padding:0;}
    .tm-svpill .tm-ok{display:none;}
    .tm-svpill .tm-cloud{display:block;}
    .tm-svpill .tm-svw{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
    .tm-dlpill{width:32px;padding:0 !important;}
    .tm-dlpill .tm-dlw{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
}

/* ── Welcome A ─────────────────────────────────────────────────────────────── */
.tm-welcome{position:relative;background:#FBF6EC;}
.tm-welcome .tm-rc{display:flex;flex-direction:column;gap:16px;min-width:0;}
.tm-welcome .tm-lc{min-width:0;}
@media (min-width:900px){
    .tm-welcome .sg-setup{display:grid;grid-template-columns:300px minmax(0,1fr);column-gap:60px;align-items:start;}
    .tm-welcome .sg-title{font-size:2.7rem;line-height:1.2;}
    .tm-welcome .sg-desc{font-size:.92rem;}
}
@media (max-width:899px){
    .tm-welcome .sg-title{font-size:2.15rem;line-height:1.2;}
    .tm-welcome .sg-desc{font-size:.9rem;margin-top:.45rem;}
    .tm-welcome .sg-help{margin-top:.6rem;}
    .tm-welcome .sg-card{padding:16px 18px;}
    .tm-welcome .sg-go{font-size:1.08rem;min-height:50px;padding:12px;}
}
.tm-welcome .sg-row.tm-cp{--sg-n:2 !important;}
.tm-welcome .sg-row.tm-cp>*{flex:0 0 calc((100% - 8px) / 2) !important;}
.tm-cpill{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1.2;padding:8px;min-height:54px;}
.tm-cpill .tm-cpn{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tm-cpill .tm-ctg{font-family:'Space Mono',monospace;font-weight:700;font-size:.54rem;text-transform:uppercase;letter-spacing:.1em;color:#8a7f6d;}
.tm-cpill.on .tm-ctg{color:#3f5c39;}
.tm-addc{display:block;margin:12px auto 0;background:none;border:0;cursor:pointer;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.85rem;color:#191510;padding:4px 8px;}
.tm-addc:hover{text-decoration:underline;}
.tm-sep{border-top:1.5px dashed #cfc5b2;margin:14px 0;}
.tm-sf{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.tm-sf .sg-pill{padding:10px 6px;font-size:.92rem;min-height:44px;}
.tm-sf .tm-sfp{grid-column:1/-1;}
@media (max-width:560px){
    .tm-sf{grid-template-columns:repeat(3,minmax(0,1fr));}
    .tm-sf .sg-pill{min-height:42px;padding:8px 4px;font-size:.88rem;}
    .tm-sf .tm-sfp{grid-column:2/-1;}
}
.tm-hp-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;}
.tm-hp-row .sg-lbl{margin-bottom:8px;}
.tm-hp-cnt{font-family:'Space Mono',monospace;font-weight:700;font-size:.66rem;color:#8a7f6d;text-transform:uppercase;letter-spacing:.1em;white-space:nowrap;}
.tm-note{font-weight:500;font-size:.82rem;color:#8a7f6d;margin:10px 0 0;text-align:center;}
.tm-note.err{font-weight:700;color:#B8321F;}
.tm-welcome .sg-input{display:block;min-width:0;}
.tm-welcome .sg-input:focus{border-color:#6FD060;}
.tm-welcome textarea.sg-input{height:84px;min-height:0;resize:none;line-height:1.5;}
.tm-thumb{height:128px;border:2px solid #191510;border-radius:12px;background:#FBF6EC;padding:8px;margin-bottom:14px;}
@media (max-width:560px){.tm-thumb{height:96px;padding:6px;margin-bottom:12px;}}
.tm-thumb .tm-mini{display:grid;width:100%;height:100%;gap:3px;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(0,.35fr) minmax(0,1fr) minmax(0,.35fr) minmax(0,1fr) minmax(0,1fr);grid-template-rows:repeat(5,minmax(0,1fr));}
.tm-thumb .tm-mini i{display:block;border:1.5px solid #191510;border-radius:5px;min-width:0;min-height:0;}
.tm-thumb .tm-mini i.b{background:#ECE3CF;border-color:#d8cdb2;}
.tm-loading{font-weight:500;font-size:.9rem;color:#8a7f6d;text-align:center;padding:18px 0;}

/* ── The maker, v3: one white board, an even 14px gutter all round, no modes ────────────────
   Lifted from 05 Apps/Timetable Maker mock v3. --k grows the Day by day rows on a whiteboard;
   the mock's sizes are the floor. */
.tm-maker{position:relative;flex:1 1 auto;min-height:0;background:#FBF6EC;font-family:'Space Grotesk',sans-serif;color:#191510;}
.tm-board{position:absolute;inset:14px;background:#fff;border:2px solid #191510;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;padding:8px 12px 10px;box-sizing:border-box;--k:1;}
.tm-board *{box-sizing:border-box;}
.tm-topr{flex:0 0 38px;height:38px;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;padding:2px 2px;}
.tm-topr>.tm-tgp{justify-self:start;}
.tm-mid{justify-self:center;display:flex;}
.tm-mid .tm-addp{height:32px;padding:0 18px;font-size:.82rem;}
.tm-tgp{display:flex;gap:6px;}
.tm-tp{width:112px;height:34px;border:2px solid #191510;border-radius:50px;background:#fff;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.82rem;color:#191510;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:transform .08s;}
.tm-tp.on{background:#6FD060;}
.tm-tp:hover{transform:translate(-2px,-2px);}
.tm-tr{display:flex;align-items:center;gap:8px;justify-self:end;}
.tm-tr .tm-copy{margin-right:12px;}
.tm-ic{width:32px;height:32px;border-radius:50%;border:2px solid #191510;background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:transform .08s;}
.tm-ic:hover:not(:disabled){transform:translate(-2px,-2px);}
.tm-ic.tm-redo svg{transform:scaleX(-1);}
.tm-ic:disabled{opacity:.35;cursor:default;}
.tm-ql{background:none;border:0;padding:0;margin-right:10px;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.78rem;color:#5f584c;text-decoration:underline;cursor:pointer;white-space:nowrap;}
.tm-ql:hover{color:#191510;}
.tm-copy{height:32px;padding:0 14px;border:2px solid #191510;border-radius:50px;background:#fff;color:#191510;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.78rem;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer;transition:transform .08s;flex-shrink:0;}
.tm-copy:hover{transform:translate(-2px,-2px);}
.tm-copy .tm-car{font-size:.6rem;}
.tm-addp{height:28px;padding:0 14px;border:2px solid #191510;border-radius:50px;background:#fff;color:#191510;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.78rem;cursor:pointer;white-space:nowrap;flex-shrink:0;}
.tm-addp:hover{background:#FFF8DB;}
.tm-main{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 4px 2px;margin-top:4px;display:flex;flex-direction:column;}
.tm-main::-webkit-scrollbar{width:6px;}
.tm-main::-webkit-scrollbar-thumb{background:#d8cdb2;border-radius:6px;}
.tm-muted{font-weight:500;font-size:.75rem;color:#8a7f6d;line-height:1.2;}
.tm-muted.c{text-align:center;padding-top:4px;flex:0 0 auto;}

/* Day by day: tabs and rows share one centred column, the same left and right edges */
.tm-col{width:calc(760px * var(--k));max-width:calc(100% - 52px);margin:0 auto;display:flex;flex-direction:column;gap:6px;flex:0 0 auto;}
.tm-dtabs{display:flex;gap:6px;width:100%;}
.tm-dtab{height:calc(32px * var(--k));min-width:0;flex:1;border:2px solid #191510;border-radius:12px;background:#fff;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:calc(.9rem * var(--k));color:#191510;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:transform .08s;}
.tm-dtab.on{background:#6FD060;}
.tm-dtab:hover{transform:translate(-2px,-2px);}
.tm-cprow{display:flex;justify-content:space-between;align-items:center;gap:8px;}
.tm-cprow .tm-addp{height:32px;}
.tm-addline{display:flex;justify-content:center;align-items:center;gap:14px;margin-bottom:6px;flex:0 0 auto;}
.tm-rows{display:flex;flex-direction:column;gap:3px;}
.tm-rw{display:grid;grid-template-columns:calc(48px * var(--k)) calc(84px * var(--k)) minmax(0,1fr);gap:8px;align-items:center;height:calc(32px * var(--k));position:relative;isolation:isolate;}
.tm-rw.band{height:calc(20px * var(--k));}
.tm-rw>.tm-hd{position:absolute;left:-23px;top:50%;transform:translateY(-50%);width:18px;}
.tm-rw>.tm-rm{position:absolute;right:-23px;top:50%;transform:translateY(-50%);}
.tm-hd{opacity:0;cursor:grab;font-size:.8rem;color:#8a7f6d;text-align:center;letter-spacing:-.2em;touch-action:none;user-select:none;-webkit-user-select:none;line-height:1;overflow:hidden;}
.tm-rm{opacity:0;width:18px;height:18px;border-radius:50%;border:0;background:none;color:#8a7f6d;font-size:1.05rem;cursor:pointer;padding:0;line-height:1;display:flex;align-items:center;justify-content:center;}
.tm-rm:hover{color:#191510;background:#FFEDEA;}
.tm-rw:hover .tm-hd,.tm-rw:hover .tm-rm,.tm-wh:hover .tm-hd,.tm-wh:hover .tm-rm,.tm-rw:focus-within .tm-hd,.tm-rw:focus-within .tm-rm,.tm-wh:focus-within .tm-rm,.tm-rm:focus{opacity:1;}
@media (hover:none){.tm-hd,.tm-rm{opacity:.55;}}
body.tm-dragging,body.tm-dragging *{cursor:grabbing !important;user-select:none;-webkit-user-select:none;}
.tm-ed{font-family:inherit;border:0;background:transparent;outline:none;padding:0;color:#191510;cursor:text;min-width:0;width:100%;text-decoration:underline dashed transparent;text-underline-offset:4px;text-decoration-thickness:1.5px;}
.tm-ed:hover,.tm-cb:hover,.tm-bnote:hover{text-decoration:underline dashed rgba(25,21,16,.4);text-underline-offset:4px;text-decoration-thickness:1.5px;}
.tm-ed:focus{text-decoration-color:transparent;background:#FFF8DB;border-radius:4px;}
.tm-ed::placeholder{color:#a79c85;}
.tm-tm3{font-family:'Space Mono',monospace;font-weight:700;font-size:calc(.78rem * var(--k));}
.tm-nm3{font-weight:700;font-size:calc(.85rem * var(--k));color:#5f584c;}
.tm-rw.band .tm-tm3,.tm-rw.band .tm-nm3{font-size:calc(.66rem * var(--k));}
.tm-cb{height:100%;min-width:0;border:2px solid #191510;border-radius:10px;padding:0 12px;display:flex;align-items:center;font-weight:700;font-size:calc(.9rem * var(--k));outline:none;cursor:text;background:#fff;overflow:hidden;white-space:nowrap;position:relative;color:#191510;-webkit-user-select:text;user-select:text;}
.tm-cb:empty::before{content:attr(data-ph);color:#a79c85;font-weight:500;}
.tm-cb.sel{outline:3px solid #FFCE45;outline-offset:1px;}
.tm-cb.drop{outline:3px solid #6FD060;outline-offset:1px;}
.tm-bnote{height:100%;min-width:0;border:2px solid #d8cdb2;border-radius:9px;background:#ECE3CF;padding:0 10px;display:flex;align-items:center;font-family:'Space Mono',monospace;font-weight:700;font-size:calc(.62rem * var(--k));text-transform:uppercase;color:#5f584c;outline:none;cursor:text;white-space:nowrap;overflow:hidden;-webkit-user-select:text;user-select:text;}
.tm-bnote:empty::before{content:attr(data-ph);color:#a79c85;}
.tm-bnote:focus{border-color:#191510;}
.tm-ins{position:absolute;left:0;right:0;bottom:-5px;height:8px;opacity:0;display:flex;align-items:center;cursor:pointer;z-index:3;}
.tm-ins::before{content:'';flex:1;height:2px;background:#191510;}
.tm-ins b{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:16px;height:16px;border-radius:50%;background:#FFCE45;border:2px solid #191510;font-size:.7rem;line-height:1;display:flex;align-items:center;justify-content:center;}
.tm-ins:hover{opacity:1;}
.tm-addrow{display:flex;align-items:center;gap:12px;margin-top:2px;}
.tm-addrow .tm-addp{height:calc(28px * var(--k));font-size:calc(.78rem * var(--k));}
.tm-addrow .tm-muted{font-size:calc(.75rem * var(--k));}

/* Whole week: slot heads type in place, ⋮⋮ and × on hover */
.tm-wkwrap{flex:1;min-height:0;display:flex;flex-direction:column;}
.tm-wk{display:grid;width:100%;gap:5px;flex:1;min-height:0;align-items:stretch;--fs:.72rem;--hfs:.54rem;}
.tm-wk>*{min-width:0;min-height:0;}
.tm-wh{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:8px;padding:2px;}
.tm-wh.b{background:#ECE3CF;}
.tm-wh .tm-ed{text-align:center;font-family:'Space Mono',monospace;font-weight:700;font-size:var(--hfs);text-transform:uppercase;letter-spacing:.02em;line-height:1.25;}
.tm-wh .tm-ht{color:#8a7f6d;}
.tm-wh .tm-hd{position:absolute;left:0;top:0;width:12px;font-size:.6rem;z-index:2;}
.tm-wh .tm-rm{position:absolute;right:-1px;top:-1px;width:14px;height:14px;font-size:.8rem;z-index:2;}
.tm-wk .tm-td{display:flex;align-items:center;justify-content:center;font-family:'Space Mono',monospace;font-weight:700;font-size:var(--hfs);text-transform:uppercase;letter-spacing:.04em;}
.tm-wk .tm-cb{padding:2px 4px;justify-content:center;text-align:center;font-size:var(--fs);line-height:1.15;white-space:normal;border-radius:9px;word-break:break-word;}
.tm-wk .tm-bnote{padding:0 2px;justify-content:center;text-align:center;font-size:var(--hfs);border-radius:8px;white-space:normal;}
.tm-wk .tm-bnote:empty::before{content:none;}
.tm-flash{animation:tmFlash 1.1s;}
@keyframes tmFlash{0%,55%{background-color:#FFF0B8;}100%{}}

/* The one subject bar */
.tm-barwrap{flex:0 0 auto;display:flex;justify-content:center;margin-top:8px;min-width:0;}
.tm-bar{background:#191510;border-radius:50px;padding:7px 10px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:3px;max-width:100%;}
.tm-bar.one{flex-wrap:nowrap;width:max-content;max-width:none;}
.tm-bar em,.tm-chip{font-family:'Space Mono',monospace;font-weight:700;font-size:.62rem;text-transform:uppercase;letter-spacing:.04em;color:#FBF6EC;padding:7px 10px;border-radius:50px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-style:normal;background:none;border:0;line-height:1.2;}
.tm-bar em{color:#8a7f6d;padding-right:4px;}
.tm-chip{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;}
.tm-chip:hover{color:#FFCE45;background:rgba(255,206,69,.18);}
.tm-chip:focus{outline:none;}
.tm-chip:focus-visible{box-shadow:0 0 0 2px #FFCE45;}
.tm-chip.tm-addsub,.tm-chip.tm-more{cursor:pointer;}
.tm-chip u{width:10px;height:10px;border-radius:50%;border:1.5px solid #FBF6EC;display:inline-block;text-decoration:none;flex:0 0 10px;}
.tm-ghost{position:fixed;z-index:9999;pointer-events:none;background:#191510;color:#FBF6EC;}
.tm-chip-in{font-family:'Space Mono',monospace;font-weight:700;font-size:.62rem;text-transform:uppercase;background:#FBF6EC;color:#191510;border:0;border-radius:50px;padding:7px 12px;outline:none;width:110px;}
.tm-pop.tm-morep{background:#191510;border:0;border-radius:24px;box-shadow:none;max-width:380px;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:3px;padding:8px;}

/* A phone: the column fills the board, ⋮⋮ and × sit inside each row */
.tm-narrow{padding:8px 8px 10px;}
.tm-narrow .tm-tp{width:108px;font-size:.8rem;}
.tm-narrow .tm-main{padding:4px 8px 2px;}
.tm-narrow .tm-col{width:100%;max-width:100%;}
.tm-narrow .tm-dtabs{margin:0 21px 0 19px;width:auto;}
.tm-narrow .tm-cprow{margin-right:21px;}
.tm-narrow .tm-rw{grid-template-columns:14px 40px 44px minmax(0,1fr) 16px;gap:5px;height:32px;}
.tm-narrow .tm-rw.band{height:20px;}
.tm-narrow .tm-rw>.tm-hd,.tm-narrow .tm-rw>.tm-rm{position:static;transform:none;opacity:.55;}
.tm-narrow .tm-rm{width:16px;height:16px;}
.tm-narrow .tm-tm3{font-size:.7rem;}
.tm-narrow .tm-nm3{font-size:.76rem;}
.tm-narrow .tm-rw.band .tm-tm3,.tm-narrow .tm-rw.band .tm-nm3{font-size:.62rem;}
.tm-narrow .tm-ins{display:none;}
.tm-narrow .tm-addrow{padding-left:19px;gap:8px;}
.tm-narrow .tm-muted{font-size:.66rem;}
.tm-narrow .tm-chip{padding:6px 8px;}
.tm-narrow .tm-bar{padding:6px 8px;}

/* Popovers (never a modal) */
.tm-pop{position:fixed;z-index:9500;background:#fff;border:2px solid #191510;border-radius:14px;box-shadow:4px 4px 0 #191510;padding:8px;font-family:'Space Grotesk',sans-serif;color:#191510;max-height:70vh;overflow:auto;box-sizing:border-box;}
.tm-pop *{box-sizing:border-box;}
.tm-pop .tm-mi{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:#fff;border:0;border-radius:9px;padding:8px 10px;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.85rem;color:#191510;cursor:pointer;white-space:nowrap;}
.tm-pop .tm-mi:hover{background:#FBF6EC;}
.tm-pop .tm-mi.on{background:#191510;color:#fff;}
.tm-pop .tm-mlbl{font-family:'Space Mono',monospace;font-weight:700;font-size:.6rem;text-transform:uppercase;letter-spacing:.12em;color:#8a7f6d;padding:6px 10px 4px;}
.tm-pop .tm-msep{height:2px;background:#EFE7D6;margin:5px 4px;}
.tm-addm{width:min(260px,calc(100vw - 16px));}
.tm-opt{display:block;width:100%;text-align:left;padding:7px 10px;border:0;background:none;border-radius:10px;font-weight:700;font-size:.9rem;cursor:pointer;font-family:'Space Grotesk',sans-serif;color:#191510;}
.tm-opt:hover{background:#FBF6EC;}
.tm-opt small{display:block;font-weight:500;font-size:.72rem;color:#8a7f6d;}
.tm-ta{position:fixed;z-index:9600;background:#fff;border:2px solid #191510;border-radius:12px;padding:4px;min-width:150px;font-family:'Space Grotesk',sans-serif;color:#191510;}
.tm-ta div{padding:5px 10px;border-radius:8px;font-weight:700;font-size:.85rem;display:flex;gap:8px;align-items:center;cursor:pointer;white-space:nowrap;}
.tm-ta div.on,.tm-ta div:hover{background:#FFCE45;}
.tm-ta u{width:10px;height:10px;border-radius:50%;border:1.5px solid #191510;display:inline-block;flex:0 0 10px;}
.tm-sws{display:grid;grid-template-columns:repeat(6,30px);gap:7px;padding:6px 8px;}
.tm-sw{width:30px;height:30px;border-radius:50%;border:2px solid #191510;cursor:pointer;padding:0;transition:transform .08s;}
.tm-sw:hover{transform:translate(-2px,-2px);}
.tm-sw.on{box-shadow:0 0 0 3px #FFCE45;}
.tm-pin{display:block;width:100%;box-sizing:border-box;padding:9px 12px;border:2px solid #191510;border-radius:10px;font-family:'Space Grotesk',sans-serif;font-weight:500;font-size:.95rem;color:#191510;outline:none;background:#fff;min-width:0;}
.tm-pin:focus{border-color:#6FD060;}
.tm-pin.bad{border-color:#FF6F5E;background:#FFF1EE;}
.tm-pbtn{height:34px;padding:0 14px;border:2px solid #191510;border-radius:50px;background:#fff;color:#191510;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:.82rem;cursor:pointer;white-space:nowrap;transition:transform .08s;display:inline-flex;align-items:center;justify-content:center;gap:6px;}
.tm-pbtn:hover{transform:translate(-2px,-2px);}
.tm-pbtn.y{background:#FFCE45;}

/* House card (confirms, paste, help) */
.tm-modal{position:fixed;inset:0;z-index:10001;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;padding:18px;}
.tm-modal .sg-modal-card{max-width:520px;}
.tm-modal .sg-modal-card h2{font-size:1.4rem;}
.tm-modal textarea{width:100%;box-sizing:border-box;height:170px;border:2px solid #191510;border-radius:12px;padding:10px 12px;font-family:'Space Mono',monospace;font-size:.78rem;line-height:1.45;resize:none;outline:none;color:#191510;}
.tm-modal textarea:focus{border-color:#6FD060;}
.tm-modal .tm-mres{font-weight:700;font-size:.85rem;margin:8px 0 2px;min-height:1.2em;color:#3f5c39;}
.tm-modal .tm-mres.err{color:#B8321F;}
.tm-modal .tm-mrow{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:12px;flex-wrap:wrap;}
.tm-modal .tm-link{background:none;border:0;font-family:'Space Grotesk',sans-serif;font-weight:600;font-size:.88rem;color:#6b6355;text-decoration:underline;cursor:pointer;padding:6px;}
.tm-modal .tm-go{min-height:44px;padding:0 22px;border:2px solid #191510;border-radius:12px;background:#FFCE45;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:1rem;cursor:pointer;color:#191510;transition:transform .08s;}
.tm-modal .tm-go:hover{transform:translate(-2px,-2px);}
.tm-modal .tm-go.danger{background:#FF6F5E;}
.tm-modal .tm-go[disabled]{opacity:.4;cursor:default;transform:none;}

/* ── Export: pick a style, see how it prints ────────────────────────────────────────── */
.tm-exp{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:clamp(400px,32vw,560px) minmax(0,1fr);gap:12px;padding:12px;background:#FBF6EC;font-family:'Space Grotesk',sans-serif;color:#191510;box-sizing:border-box;}
.tm-exp .sg-cap{min-height:0;min-width:0;}
.tm-exp .sg-cap-hd{font-size:.66rem;display:flex;justify-content:space-between;align-items:center;gap:8px;}
.tm-exp .sg-cap-hd em{font-style:normal;color:#B9AF9C;letter-spacing:.06em;white-space:nowrap;}
.tm-exp .sg-cap-bd{flex:1 1 auto;min-height:0;padding:12px 14px;display:flex;flex-direction:column;background:#fff;}
/* seventeen styles (styles mock 2): the thumbnails scroll inside their own panel if a sheet shape needs it; Direction and Paper stay put below */
.tm-capl .sg-cap-bd{overflow:hidden;}
.tm-thumbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:4px 6px 6px 4px;margin:-4px -6px -6px -4px;flex:0 1 auto;min-height:0;overflow-y:auto;align-content:start;}
.tm-th2{position:relative;border:2.5px solid #191510;border-radius:10px;background:#FBF6EC;padding:3px 3px 2px;cursor:pointer;min-width:0;font:inherit;color:#191510;transition:transform .08s;}
.tm-th2:hover{transform:translate(-2px,-2px);}
.tm-th2.on{border-color:#6FD060;box-shadow:0 0 0 1.5px #6FD060;}
.tm-th2 canvas{display:block;width:100%;height:auto;border-radius:3px;}
.tm-th2 .tm-tk{display:none;position:absolute;right:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#6FD060;border:2px solid #191510;align-items:center;justify-content:center;z-index:3;box-sizing:border-box;}
.tm-th2.on .tm-tk{display:flex;}
.tm-th2 .tm-tn{font-weight:700;font-size:11px;line-height:14px;margin-top:2px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.tm-opts{flex:0 0 auto;margin-top:12px;padding-top:12px;border-top:2px dashed #E3DCCD;}
.tm-orow{display:grid;grid-template-columns:76px minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center;}
.tm-orow+.tm-orow{margin-top:8px;}
.tm-olab{font-family:'Space Mono',monospace;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:#8a7f6d;}
.tm-orow .tm-pl{min-height:34px;padding:0 10px;white-space:nowrap;}
.tm-rowlab{font-family:'Space Mono',monospace;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:#8a7f6d;margin:11px 0 5px;}
.tm-pills{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:2px 4px 4px 2px;margin:-2px -4px -4px -2px;}
.tm-pl{min-height:36px;padding:0 12px;border:2px solid #191510;border-radius:12px;background:#fff;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:13.5px;display:flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;color:#191510;transition:transform .08s;}
.tm-pl:hover{transform:translate(-2px,-2px);}
.tm-pl.on{background:#6FD060;}
.tm-pl.dis{opacity:.4;cursor:not-allowed;}
.tm-pl.dis:hover{transform:none;}
.tm-xhint{flex:0 0 auto;font-weight:500;font-size:11.5px;color:#6b6252;margin-top:9px;line-height:1.3;}
.tm-paperbox{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:4px;position:relative;}
.tm-paperbox canvas{display:block;box-shadow:0 0 0 2px #191510,0 4px 12px rgba(0,0,0,.18);}
.tm-pvcap{margin-top:9px;font-weight:700;font-size:14px;}
.tm-pvcap span{display:block;font-weight:500;font-size:12px;color:#6b6252;margin-top:2px;}
@media (max-width:760px){
    .tm-exp{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;padding:10px;gap:10px;overflow:hidden;}
    .tm-exp .sg-cap-bd{padding:10px 12px;}
    .tm-capl .sg-cap-bd{padding:8px 0 6px 10px;overflow:visible;}
    .tm-thumbs{display:grid;grid-auto-flow:column;grid-template-rows:auto auto;grid-template-columns:none;grid-auto-columns:76px;gap:7px;overflow-x:auto;overflow-y:hidden;padding:5px 10px 6px 4px;margin:-5px 0 0 -4px;scrollbar-width:none;}
    .tm-thumbs::-webkit-scrollbar{display:none;}
    .tm-th2 .tm-tn{font-size:10px;line-height:13px;}
    .tm-orow{grid-template-columns:70px minmax(0,1fr) minmax(0,1fr);gap:7px;}
    .tm-orow .tm-pl{font-size:12.5px;padding:0 6px;gap:5px;}
    .tm-thumbs .tm-th2{flex:0 0 92px;}
    .tm-rowlab{margin:0 0 4px;}
    .tm-pl{min-height:34px;}
    .tm-pvcap{font-size:13px;margin-top:6px;}
    .tm-pvcap span{display:none;}
    .tm-paperbox{padding:0;}
}
