@font-face { font-family: "Outfit"; font-weight: 400; font-display: swap; src: url("fonts/outfit-400.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("fonts/outfit-500.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("fonts/outfit-600.woff2") format("woff2"); }
:root {
  /* "Cutter" palette */
  --bg: #1B1B1E; --panel: #373F51; --panel2: #2A303D; --line: #4A5468; --text: #D8DBE2;
  --dim: #A9BCD0; --accent: #58A4B0; --on-accent: #1B1B1E;
  --roll: #242933; --grid: #2E3441; --warn: #E07A5F; --danger: #E07A5F;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, "Segoe UI", sans-serif;
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
/* Lockup (brand.md): wordmark 24px (lockup >= 160px wide), icon 1.24 x = 30px (24-47px icon: blade stroke 7),
   gap 0.24 x icon = 7px, icon centered, clear space 15px (half the icon). Dark: Fantasti in Steel, Cut in Mist, on Black. */
.brand { display: flex; align-items: center; gap: 7px; font-size: 24px; line-height: 1; letter-spacing: 0; margin: 0 15px 0 3px; padding: 15px 0; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand .wm > span:first-child { color: #A9BCD0; } .brand .wm > span:last-child { color: #D8DBE2; }
.group { display: flex; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.spacer { flex: 1; }

button { font: inherit; color: inherit; }
.tb { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.tb:hover:not(:disabled) { border-color: var(--accent); }
.tb:disabled { opacity: 0.35; cursor: not-allowed; }
.tb.icon { min-width: 36px; padding: 6px 8px; font-size: 16px; line-height: 1; }
.tb[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tb.primary-ghost { border-color: var(--accent); color: var(--accent); }
.tb.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.cutbtn { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; padding: 8px 22px; min-height: 38px; font-weight: 700; cursor: pointer; }
.cutbtn:hover:not(:disabled) { filter: brightness(1.1); }
.cutbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.conn { display: inline-flex; align-items: center; gap: 8px; }
.conn .dot { width: 9px; height: 9px; border-radius: 50%; background: #E5484D; flex: none; }
.conn-text { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
#conn-dev { font-size: 11px; font-weight: 500; color: #A9BCD0; }
.conn.on .dot { background: #6BCB77; opacity: 1; box-shadow: 0 0 6px #6BCB77; }
.conn.busy .dot { background: #F2C14E; opacity: 1; }

/* ---------- work area ---------- */
.work { display: grid; grid-template-columns: 1fr 290px; min-height: 0; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
#canvas { display: block; touch-action: none; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; color: var(--dim); }
.empty .big { font-size: 22px; color: var(--text); margin: 0 0 4px; font-family: "Outfit", system-ui, sans-serif; }
.empty p { margin: 0; }
.empty button { pointer-events: auto; font-size: inherit; }
.drop { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 16px; display: none; place-content: center; font-size: 22px; background: rgba(88,164,176,0.08); pointer-events: none; }
.stage.dragging .drop { display: grid; }
.zoombar { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.zoombar span { min-width: 48px; text-align: center; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- side panel ---------- */
.side { background: var(--panel2); border-left: 1px solid var(--line); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.panel h2 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.hint { color: var(--dim); font-size: 12.5px; margin: 8px 0 0; }
label { color: var(--dim); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
label.block { margin-bottom: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; cursor: pointer; }
label.check.big { font-size: 14px; font-weight: 600; }
input[type=number], input[type=search], input[type=text], select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font: inherit; width: 100%; min-height: 34px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; font-size: 15px; }
select[size] { min-height: 120px; padding: 2px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
output { color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.row.col { flex-direction: column; gap: 8px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btns .tb { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13px; }
.facts dt { color: var(--dim); } .facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.layers { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.layers li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.layers li:hover { background: var(--panel2); }
.layers li.sel { background: rgba(88,164,176,0.25); }
.layers .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); flex: none; }
.layers .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers .kd { color: var(--dim); font-size: 11px; }
.layers .empty-li { color: var(--dim); cursor: default; }

/* ---------- status bar + log ---------- */
.statusbar { display: flex; align-items: center; gap: 16px; padding: 4px 12px; background: var(--panel2); border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.statusbar .legal a { color: var(--text); text-decoration: none; }
.statusbar .legal a:hover { color: var(--accent); }
.statusbar #st-cursor, .statusbar #st-sel { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.logdrawer { position: fixed; left: 12px; right: 302px; bottom: 34px; height: 240px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.logbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.logbar .tb { min-height: 28px; padding: 2px 10px; font-size: 12px; }
#log { margin: 0; padding: 8px 10px; overflow: auto; flex: 1; font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---------- dialogs ---------- */
.dlg { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px 16px; width: min(720px, 96vw); max-height: 92vh; }
.dlg.wide { width: min(980px, 96vw); }
.dlg::backdrop { background: rgba(0,0,0,0.6); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--panel2); padding: 14px 0 8px; margin: 0; z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 18px; font-family: "Outfit", system-ui, sans-serif; }
.dlg h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 16px 0 8px; }
.dlg-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.cut-body { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; }
.cut-right canvas { width: 100%; height: auto; background: var(--roll); border: 1px solid var(--line); border-radius: 8px; display: block; }
.warn { margin: 8px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
.warn:empty { display: none; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { text-align: left; color: var(--dim); font-weight: 500; padding: 4px; font-size: 12px; }
.ptable td { padding: 3px; }
.ptable input[type=number] { width: 70px; min-height: 30px; padding: 4px 6px; }
.ptable input[type=text] { min-width: 150px; min-height: 30px; padding: 4px 6px; }
.ptable tr.active { outline: 1px solid var(--accent); }
.settings .end { display: flex; align-items: end; }
.keys { font-size: 13px; border-collapse: collapse; }
.keys td { padding: 2px 16px 2px 0; } .keys td:first-child { color: var(--dim); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 20; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); max-width: min(560px, 92vw); pointer-events: none; }
.toast.err { border-left-color: var(--danger); }

/* ---------- Phase 2: menu, layers, cut options ---------- */
.panel h3.sub { margin: 12px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.panel .end { display: flex; align-items: end; }
input[type=color] { width: 100%; min-height: 34px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.ctx { position: fixed; z-index: 30; min-width: 210px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.55); }
.ctx button { display: flex; width: 100%; justify-content: space-between; gap: 18px; background: none; border: 0; border-radius: 6px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--text); font-size: 13.5px; }
.ctx button:hover:not(:disabled), .ctx button:focus-visible { background: rgba(88,164,176,0.22); outline: none; }
.ctx button:disabled { opacity: 0.35; cursor: default; }
.ctx button .kb { color: var(--dim); font-size: 12px; }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.ctx button.danger:hover:not(:disabled) { color: var(--danger); }
.clayers li { gap: 6px; }
.clayers input[type=color] { width: 26px; min-height: 24px; height: 24px; padding: 1px; flex: none; }
.clayers input[type=text] { min-height: 26px; padding: 2px 6px; font-size: 13px; }
.clayers .ct { color: var(--dim); font-size: 11px; flex: none; }
details.opt { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 10px 0 0; }
details.opt summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 2px 0; }
details.opt[open] summary { margin-bottom: 6px; }
details.opt label.check { margin: 6px 0; }
.checklist { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist label.check { margin: 2px 0 !important; }
.checklist .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 170px; overflow-y: auto; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 13px; }
.steps li.cur { border-color: var(--accent); background: rgba(88,164,176,0.15); }
.steps li.done { color: var(--dim); }
.steps li.done .n::after { content: " \2713"; color: #6BCB77; }
.steps .n { font-weight: 700; min-width: 54px; }
.steps .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); flex: none; }
.steps .lbl { flex: 1; }
.steps .dim { font-size: 12px; }
.legend { color: var(--dim); font-size: 12px; margin: 6px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.legend .k { width: 14px; height: 3px; display: inline-block; border-radius: 2px; margin-left: 6px; }
.legend .k.design { background: #58A4B0; } .legend .k.weed { background: #F2C14E; } .legend .k.mark { background: #E07A5F; }
.legend .k.travel { background: rgba(169,188,208,0.6); }

@media (max-width: 860px) {
  .work { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); max-height: 42vh; }
  .cut-body { grid-template-columns: 1fr; }
  .logdrawer { right: 12px; }
  .statusbar .legal { width: 100%; }
}

/* ---------- Brand rules (claude/brand.md, Phase 3) ----------
   Palette only: Mist #D8DBE2, Steel #A9BCD0, Teal #58A4B0, Slate #373F51, Black #1B1B1E (tints are these colors with alpha).
   Dark mode: Black page, Slate panels, Steel dividers and secondary text, Teal accent.
   Type: Outfit 400-500 for UI (13-16px), 600 for headings; small caps labels Outfit 600, 0.12em; numbers in monospace; never under 11px.
   Shapes: 8px buttons/inputs, 12px panels, 16px dialogs; 8px spacing grid; clickable targets at least 44 x 44px.
   Warnings keep #E07A5F until an error color is approved (brand.md suggests #E5484D). */
:root {
  --bg: #1B1B1E; --panel: #373F51; --panel2: #1B1B1E; --line: rgba(169, 188, 208, 0.35); --text: #D8DBE2;
  --dim: #A9BCD0; --accent: #58A4B0; --on-accent: #1B1B1E;
  --roll: rgba(55, 63, 81, 0.55); --grid: rgba(169, 188, 208, 0.12);
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}
body { font: 400 14px/1.45 "Outfit", system-ui, "Segoe UI", sans-serif; }
.topbar { background: #1B1B1E; gap: 8px; padding: 8px 16px; }
.group { gap: 8px; padding-left: 8px; }
.tb, .btns .tb, .logbar .tb, .cutbtn { min-height: 44px; border-radius: 8px; }
.tb.icon { min-width: 44px; }
.btns .tb { padding: 4px 12px; font-size: 13px; }
.btns { gap: 8px; }
.zoombar { background: var(--panel); border-radius: 12px; gap: 4px; }
.side { padding: 8px; gap: 8px; }
.panel { border-radius: 12px; padding: 16px; }
.panel h2, .dlg h3, .panel h3.sub { font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.dlg { background: var(--panel); border-radius: 16px; padding: 0 24px 16px; }
.dlg-head { background: var(--panel); padding: 16px 0 8px; }
.dlg-head h2 { font-weight: 600; font-size: 20px; }
input[type=number], input[type=search], input[type=text], select, textarea { border-radius: 8px; min-height: 44px; }
input[type=number], .facts dd, .zoombar span, .statusbar #st-cursor, .statusbar #st-sel, #st-ver, .steps .dim { font-family: var(--mono); font-size: 13px; }
select[size] { min-height: 132px; }
label.check { min-height: 44px; }
.row.col { gap: 0; }
.grid2 { gap: 8px; }
.layers li { min-height: 44px; border-radius: 8px; }
.layers .kd, .clayers .ct { font-size: 11px; }
.ctx { background: var(--panel); border-radius: 12px; }
.ctx button { min-height: 44px; align-items: center; border-radius: 8px; }
.toast { border-radius: 12px; }
.statusbar { gap: 16px; padding: 4px 16px; background: #1B1B1E; }
.statusbar .link, .statusbar .legal a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.logdrawer { background: var(--panel); border-radius: 12px; }
.steps li { min-height: 44px; border-radius: 8px; }
details.opt { border-radius: 8px; }
details.opt summary { min-height: 44px; display: flex; align-items: center; }
.cut-right canvas { border-radius: 8px; }
.empty .big { font-weight: 600; }

/* ---------- Phones and small tablets (Phase 3 fix) ----------
   Full designing on a phone (Galaxy S24, about 360 x 780 CSS px): one brand row plus one scrolling tool strip,
   the canvas gets the rest, the side panel is a pull-up sheet, and the status bar is two short lines. */
.tools { display: contents; }
.sheet-handle { display: none; }
.install-hint { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 40; display: flex; gap: 8px; align-items: center;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 8px 8px 16px; font-size: 14px; }
.install-hint span { flex: 1; }
@media (max-width: 860px) {
  .work { grid-template-rows: minmax(0, 1fr) auto; }
  .side { max-height: 60vh; padding-top: 0; }
  .sheet-handle { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 2; width: calc(100% + 16px); margin: 0 -8px;
    min-height: 44px; padding: 0 16px; background: var(--bg); color: var(--text); border: 0; border-bottom: 1px solid var(--line);
    font: 600 12px "Outfit", system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
  .sheet-handle .grip { width: 32px; height: 4px; border-radius: 2px; background: var(--dim); }
  .sheet-handle #sheet-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet-handle .chev::after { content: "\25BE"; font-size: 14px; color: var(--dim); }
  .side.collapsed .sheet-handle .chev::after { content: "\25B4"; }
  .side.collapsed { overflow: hidden; }
  .side.collapsed > :not(.sheet-handle) { display: none !important; }
}
@media (max-width: 600px) {
  .topbar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; padding: 0 12px 8px; }
  .brand { margin: 0; padding: 15px 0; justify-self: start; }
  .topbar > .cutbtn { min-width: 88px; grid-column: 2; grid-row: 1; }
  .tools { display: flex; grid-column: 1 / -1; grid-row: 2; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
  .tools::-webkit-scrollbar { display: none; }
  .tools .group { flex: none; }
  .tools .group:first-child { border-left: 0; padding-left: 0; }
  .tools .spacer { display: none; }
  .tools > .tb { flex: none; }
  .zoombar { right: 8px; bottom: 8px; }
  .zoombar .tb { padding: 4px 8px; }
  .statusbar { gap: 4px 12px; padding: 8px 12px; font-size: 12px; }
  .statusbar .link { display: inline-block; min-height: 0; min-width: 44px; padding: 14px 0; margin: -14px 0; }
  .statusbar #st-cursor, .statusbar #st-saved, #st-ver .long { display: none; }
  .statusbar .spacer { display: none; }
  .statusbar .legal { width: 100%; font-size: 11px; line-height: 1.4; }
  /* links stay 44px tall to touch without making the bar tall */
  .statusbar .legal a { display: inline-block; min-height: 0; min-width: 0; padding: 14px 0; margin: -14px 0; }
  .toasts { top: auto; bottom: 140px; left: 8px; right: 8px; transform: none; align-items: stretch; }
  .dlg { padding: 0 16px 16px; width: 100vw; max-width: 100vw; max-height: 100dvh; border-radius: 16px 16px 0 0; margin: auto 0 0; }
  .dlg.wide { width: 100vw; }
}
.boot-fail { position: fixed; left: 8px; right: 8px; top: 8px; z-index: 100; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: #1B1B1E; color: #D8DBE2; border: 2px solid var(--warn, #E07A5F); border-radius: 12px; padding: 8px 16px; font-size: 14px; }
.boot-fail span { flex: 1 1 240px; font-family: var(--mono); font-size: 12px; color: #A9BCD0; word-break: break-word; }

/* EMFDPRODCO maker link in the top bar (between the edit tools and Connect cutter) */
.spacer:has(.maker) { display: flex; justify-content: center; align-items: center; }
.maker { font-family: Outfit, sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #A9BCD0; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; }
.maker:hover, .maker:focus-visible { color: #D8DBE2; }
.load-tip { margin: 0 20px 8px; }

/* EMFDPRODCO popup */
@font-face { font-family: "NEXT ART"; src: url("fonts/next-art-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
.dlg.emfd { width: min(560px, 96vw); }
.emfd-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 16px; }
.emfd-hero img { width: 168px; height: 168px; }
.emfd-mark { margin: 0; font: 700 28px "NEXT ART", "Outfit", sans-serif; letter-spacing: 0.08em; color: #D8DBE2; }
.emfd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.emfd-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.emfd-list a { color: #58A4B0; font-weight: 600; text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.emfd-list a:hover { text-decoration: underline; }
.emfd-list span { color: #A9BCD0; font-size: 13px; }
.emfd-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 16px; }
.emfd-foot a { text-decoration: none; display: inline-flex; align-items: center; }
.emfd-foot .cutbtn { padding: 0 18px; }

/* Nothing sits on top of the design area's edges */
.empty-card { background: rgba(27, 27, 30, 0.94); border: 1px solid var(--line); border-radius: 12px; padding: 16px 24px; max-width: min(440px, calc(100% - 32px)); margin: 0 auto; }
@media (max-width: 860px) {
  /* the install tip floats over the canvas, below the rulers, never over the tools sheet or status bar */
  .install-hint { position: fixed; bottom: auto; top: var(--hint-top, 140px); left: 44px; right: 8px; z-index: 30; }
}
@media (max-width: 600px) {
  /* the tool strip fades at its right edge instead of cutting a button in half */
  .tools { padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .empty-card { padding: 12px 16px; font-size: 14px; }
  .empty .big { font-size: 20px; }
}
@media (max-width: 600px) {
  .toasts { bottom: var(--toast-bottom, 140px); left: 44px; right: 8px; }
}

/* ---------- Pleatherface ---------- */
.pf { position: absolute; left: 44px; bottom: 12px; z-index: 6; }
.pf-btn { position: relative; width: 64px; height: 84px; padding: 4px; background: transparent; border: 0; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.pf-btn:hover, .pf-btn:focus-visible { background: rgba(88, 164, 176, 0.12); }
.pf-btn:focus-visible { outline: 2px solid #58A4B0; outline-offset: 2px; }
.pf-svg { width: 30px; height: 80px; overflow: visible; }
.pf-body { transform-origin: 141px 226px; animation: pf-bob 3.2s ease-in-out infinite; }
@keyframes pf-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }
.pf.pf-hop .pf-body { animation: pf-hop 0.6s ease-out 2, pf-bob 3.2s ease-in-out 1.2s infinite; }
@keyframes pf-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) rotate(-6deg); } }
.pf-eyes { animation: pf-blink 5s infinite; transform-origin: 141px 118px; }
@keyframes pf-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@media (prefers-reduced-motion: reduce) { .pf-body, .pf-eyes, .pf.pf-hop .pf-body { animation: none; } }
.pf-badge { position: absolute; top: 4px; right: 10px; width: 12px; height: 12px; border-radius: 50%; background: #58A4B0; border: 2px solid #1B1B1E; }
.pf-bubble { position: absolute; left: 0; bottom: 92px; width: min(360px, calc(100vw - 80px)); max-height: min(62vh, 560px); overflow: auto;
  background: #373F51; color: #D8DBE2; border: 1px solid rgba(169, 188, 208, 0.35); border-radius: 16px; padding: 8px 16px 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); font-size: 14px; }
.pf-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; background: #373F51; padding: 8px 0 4px; }
.pf-head strong { font-family: Outfit, sans-serif; font-weight: 600; font-size: 16px; }
.pf-x { min-width: 44px; min-height: 44px; margin-right: -12px; background: none; border: 0; color: #A9BCD0; font-size: 22px; cursor: pointer; border-radius: 8px; }
.pf-x:hover { color: #D8DBE2; }
.pf-msg p { margin: 4px 0 8px; line-height: 1.45; }
.pf-actions, .pf-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.pf-act { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(169, 188, 208, 0.45); background: transparent; color: #D8DBE2; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.pf-act:hover { border-color: #58A4B0; }
.pf-act.primary { background: #58A4B0; border-color: #58A4B0; color: #1B1B1E; }
.pf-ask { display: flex; gap: 8px; margin: 8px 0; }
.pf-ask input { flex: 1; min-width: 0; min-height: 44px; border-radius: 8px; border: 1px solid rgba(169, 188, 208, 0.45); background: #1B1B1E; color: #D8DBE2; padding: 0 12px; font: inherit; }
.pf-ask input:focus { outline: 2px solid #58A4B0; outline-offset: 1px; }
.pf-go { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 0; background: #58A4B0; color: #1B1B1E; font: inherit; font-weight: 600; cursor: pointer; }
.pf-card { border-top: 1px solid rgba(169, 188, 208, 0.3); padding: 10px 0 4px; }
.pf-card h4 { margin: 0 0 4px; font-family: Outfit, sans-serif; font-weight: 600; font-size: 15px; }
.pf-card p, .pf-card li, .pf-ex { color: #D8DBE2; line-height: 1.45; }
.pf-card ul, .pf-card ol { padding-left: 20px; margin: 4px 0; }
.pf-card a { color: #8FC7D0; }
.pf-card .keys td { padding: 2px 10px 2px 0; }
.pf-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; border-top: 1px solid rgba(169, 188, 208, 0.3); padding-top: 8px; margin-top: 4px; }
.pf-foot a, .pf-link { color: #A9BCD0; min-height: 44px; display: inline-flex; align-items: center; background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.pf-foot a:hover, .pf-link:hover { color: #D8DBE2; }
.pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pf-flash { animation: pf-flash 0.8s ease-in-out 3; outline: 2px solid #58A4B0; outline-offset: 3px; }
@keyframes pf-flash { 50% { outline-color: transparent; box-shadow: 0 0 0 6px rgba(88, 164, 176, 0.35); } }
/* Pre-cut checkup in the Cut window */
.pf-check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; background: #1B1B1E; border: 1px solid rgba(169, 188, 208, 0.3); }
.pf-mini .pf-svg { width: 18px; height: 48px; }
.pf-checklist { flex: 1; display: grid; gap: 8px; }
.pf-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.pf-item span { flex: 1 1 220px; color: #D8DBE2; }
@media (max-width: 860px) {
  .pf { left: auto; right: 8px; bottom: auto; top: 40px; }
  .pf-btn { width: 48px; height: 56px; }
  .pf-svg { height: 52px; width: 20px; }
  .pf-bubble { position: fixed; left: 8px; right: 8px; width: auto; top: var(--pf-top, 120px); bottom: auto; max-height: 60vh; }
  .install-hint { right: 64px; }
}
