:root {
  --navy: #1a2744;
  --navy-2: #243556;
  --sage: #7d9b8a;
  --sage-2: #5f7f6e;
  --cream: #f7f4ef;
  --cream-2: #efeae2;
  --gold: #c4a35a;
  --text: #1c2434;
  --muted: #6b7280;
  --card: #ffffff;
  --radius: 18px;
  --font-serif: "Fraunces", "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: #d9d2c8;
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.15);
}

.screen { display: none; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
.screen.is-active { display: flex; }

/* —— 01 onboarding —— */
.ob {
  padding: 28px 22px 20px;
  text-align: center;
  background: linear-gradient(180deg, #fbf9f6 0%, var(--cream) 100%);
}
.ob-crest {
  width: 56px; height: 56px; margin: 8px auto 10px;
  border: 2px solid var(--navy); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 22px; color: var(--navy);
  box-shadow: inset 0 0 0 4px var(--cream-2);
}
.ob-brand { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--navy); font-weight: 600; }
.ob h1 {
  font-family: var(--font-serif);
  font-weight: 560;
  font-size: 34px;
  line-height: 1.15;
  margin: 14px 0 8px;
  color: var(--navy);
}
.ob .tag { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.ob-hero {
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #ddd;
  box-shadow: 0 18px 40px rgba(26,39,68,0.12);
  margin-bottom: 22px;
}
.ob-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border: 0; border-radius: 14px; padding: 16px 18px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans);
}
.btn .ico { width: 22px; text-align: left; }
.btn-navy { background: var(--navy); color: #fff; margin-bottom: 10px; }
.btn-sage { background: var(--sage); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid rgba(26,39,68,0.15); }
.ob-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.room-label { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--navy); letter-spacing: 0.02em; }
.room-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.room-chips .chip { font-size: 12px; }
.ob-foot {
  margin-top: auto; padding: 18px 22px 28px; text-align: center;
  font-family: var(--font-serif); font-size: 14px; color: var(--navy-2); line-height: 1.4;
}
.trust {
  margin-top: 14px; padding: 10px 12px; border-radius: 12px;
  background: var(--cream-2); font-size: 11px; color: var(--muted);
}

/* —— common header —— */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; gap: 8px;
}
.topbar h2 {
  margin: 0; font-family: var(--font-serif); font-size: 18px; color: var(--navy); font-weight: 560;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: var(--cream-2); color: var(--navy); font-size: 18px; cursor: pointer;
}
.steps {
  display: flex; gap: 8px; padding: 0 16px 10px; align-items: center;
}
.steps .dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--cream-2); color: var(--muted);
}
.steps .dot.on { background: var(--navy); color: #fff; }
.steps .dot.done { background: var(--sage); color: #fff; }
.steps .line { flex: 1; height: 2px; background: #ddd; }
.badge-live {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  margin: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; background: rgba(26,39,68,0.88); color: #fff;
  font-size: 9px; letter-spacing: 0.1em; font-weight: 700;
  pointer-events: none;
}
.badge-wall {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  margin: 0; display: inline-flex; align-items: center;
  padding: 4px 9px; border-radius: 999px; background: rgba(90,60,40,0.88); color: #fff;
  font-size: 9px; letter-spacing: 0.06em; font-weight: 700;
  pointer-events: none;
}

/* —— stage —— */
.stage-wrap {
  margin: 0 auto;
  width: calc(100% - 32px);
  max-width: 390px;
  border-radius: 18px;
  overflow: hidden;
  background: #d8d2c8;
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: min(52vh, 420px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.1);
}
.stage-wrap canvas,
.stage-wrap img.photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill; /* холст уже 3:4 — без letterbox, маркеры = пиксели фото */
  background: #d8d2c8;
}
.tryon-toolbar {
  margin: 8px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.layer-pills {
  display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; align-items: center;
}
.pill-sep {
  width: 1px; height: 16px; background: rgba(26,39,68,0.15); margin: 0 2px;
}
.pill {
  border: 1px solid rgba(26,39,68,0.1); border-radius: 999px; padding: 5px 10px;
  font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.92); color: var(--navy); cursor: pointer;
}
.pill.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.fab-style { display: none; }
.open-actions {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; z-index: 2;
}
.open-btn {
  border: 1px solid rgba(26,39,68,0.1); border-radius: 10px; padding: 7px 2px;
  font-size: 10px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,0.95); color: var(--navy);
  font-family: inherit; white-space: nowrap;
}
.open-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.open-btn:active { transform: scale(0.97); }
.layer-hint { margin: 4px 0 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.roman-hint { display: none; margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.roman-hint.is-on { display: block; }

/* —— markers (screen 02) —— */
.mark-banner {
  margin: 0 16px 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
}
.mark-stage { touch-action: none; position: relative; }
.quad-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.quad-overlay polygon {
  fill: rgba(196, 163, 90, 0.12);
  stroke: rgba(196, 163, 90, 0.9);
  stroke-width: 0.6;
  stroke-dasharray: 1.2 0.8;
  vector-effect: non-scaling-stroke;
}
.quad-overlay .floor-seg {
  stroke: var(--sage-2);
  stroke-width: 0.7;
  stroke-dasharray: 1.4 0.9;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.m-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.m-handle.corner .m-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
}
.m-handle.floor .m-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--sage-2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--navy);
  font-weight: 700;
}
.m-handle .m-lab {
  background: rgba(255,255,255,0.95);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  white-space: nowrap;
}
.m-handle.is-active .m-ico {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  transform: scale(1.08);
}
.m-handle.is-active .m-lab { background: var(--navy); color: #fff; }
.tool-row {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  overflow-x: auto;
}
.tool {
  flex: 1 0 auto;
  border: 1px solid #e0dbd3;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.tool.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tool-auto {
  background: #eef6f1;
  border-color: var(--sage-2);
  color: var(--navy);
  font-weight: 700;
}
.return-hint { margin: 4px 0 0; font-size: 11px; display: none; }
#return-range:disabled { opacity: 0.45; }
.mark-sheet .step-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--gold);
}
.step-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--sage);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

/* light pills: selected = cream outline feel like etalon */

.sheet {
  margin-top: auto; background: #fff; border-radius: 24px 24px 0 0;
  padding: 18px 16px 20px; box-shadow: 0 -8px 30px rgba(0,0,0,0.06);
}
.sheet h3 { margin: 0 0 4px; font-family: var(--font-serif); font-size: 20px; color: var(--navy); }
.sheet .sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }

/* Примерка: превью сверху, тулбар на полу фото, витрина занимает низ */
.screen-tryon {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.screen-tryon .topbar-compact {
  padding: 6px 12px 2px;
}
.screen-tryon .topbar-compact h2 {
  font-size: 15px;
}
.screen-tryon .topbar-compact .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
}
.screen-tryon .tryon-sticky {
  flex: 0 0 auto;
  background: var(--cream);
  padding-bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.screen-tryon .tryon-sticky .stage-wrap {
  max-height: min(48vh, 400px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
}
.screen-tryon .tryon-toolbar-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  margin: 0;
  width: 100%;
  max-width: none;
  align-self: stretch;
  padding: 10px 8px 9px;
  gap: 5px;
  box-sizing: border-box;
  background: rgba(22, 28, 40, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.screen-tryon .tryon-toolbar-floor > * {
  pointer-events: auto;
}
.screen-tryon .tryon-toolbar-floor .layer-pills {
  justify-content: center;
}
.screen-tryon .tryon-toolbar-floor .wall-chips {
  justify-content: center;
  gap: 4px;
}
.screen-tryon .tryon-toolbar-floor .pill {
  padding: 4px 9px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.screen-tryon .tryon-toolbar-floor .pill.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.screen-tryon .tryon-toolbar-floor .pill-sep {
  background: rgba(255, 255, 255, 0.35);
}
.screen-tryon .tryon-toolbar-floor .chip {
  padding: 4px 9px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.screen-tryon .tryon-toolbar-floor .chip.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.screen-tryon .tryon-toolbar-floor .open-btn {
  padding: 6px 2px;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.screen-tryon .tryon-toolbar-floor .open-btn.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.screen-tryon .badge-live {
  margin-bottom: 0;
}
.screen-tryon .abc-rail {
  position: absolute;
  left: 8px;
  top: 38%;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 18px;
  background: rgba(18, 24, 36, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.screen-tryon .abc-rail .abc {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.screen-tryon .abc-rail .abc.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.screen-tryon .sheet-tryon .vitrina-pin {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  margin: 0 -16px 6px;
  padding: 8px 12px 6px;
  border-bottom: 1px solid #eee;
}
.screen-tryon .vitrina-pin .cat-chips,
.screen-tryon .vitrina-pin .style-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen-tryon .vitrina-pin .style-chips {
  margin-bottom: 0;
}
.screen-tryon .vitrina-pin .chip {
  flex: 0 0 auto;
}
.screen-tryon .sheet-tryon {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: -6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 0;
  padding-bottom: 8px;
  overscroll-behavior: contain;
}
.screen-tryon .layer-hint,
.screen-tryon .vitrina-count {
  display: none !important;
}
.screen-tryon .sheet-tryon .fabrics {
  max-height: none;
  overflow: visible;
}
.screen-tryon .bottom-nav {
  flex: 0 0 auto;
}
.topbar-compact {
  padding: 8px 12px 4px;
}
.topbar-compact h2 {
  font-size: 16px;
}
.bottom-nav-steps button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  line-height: 1.15;
}
.bottom-nav-steps .nav-n {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: var(--cream-2);
  color: var(--muted);
}
.bottom-nav-steps button.on .nav-n {
  background: var(--navy);
  color: #fff;
}
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fabrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 38vh;
  overflow-y: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.fab-card {
  flex: none; width: 100%; border: 2px solid transparent; border-radius: 16px; overflow: hidden;
  background: var(--cream-2); cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit;
}
.fab-card.on { border-color: var(--sage-2); }
.fab-card img { width: 100%; height: 88px; object-fit: cover; display: block; }
.fab-card .meta { padding: 8px 10px 10px; }
.fab-card strong { display: block; font-size: 12px; }
.fab-card small { color: var(--muted); font-size: 11px; }

.length-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.len-card {
  border: 1px solid #e5e1da; border-radius: 14px; padding: 12px; text-align: left;
  background: #fff; cursor: pointer; font: inherit;
}
.len-card.on { background: #e8f0ea; border-color: var(--sage-2); }
.len-card strong { display: block; font-size: 13px; color: var(--navy); }
.len-card small { color: var(--muted); font-size: 11px; }

.slider-row { margin: 8px 0 16px; }
.slider-row label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.slider-row input[type=range] { width: 100%; accent-color: var(--sage-2); }

.quote-box {
  background: var(--cream); border-radius: 14px; padding: 12px; font-size: 13px; margin-bottom: 12px;
}
.quote-box .line { display: flex; justify-content: space-between; margin: 4px 0; color: var(--muted); }
.quote-box .total { margin-top: 8px; font-weight: 700; color: var(--navy); font-size: 15px; }

/* before/after */
.ba {
  margin: 0 16px; border-radius: 20px; overflow: hidden; position: relative;
  aspect-ratio: 4/3; background: #ccc;
}
.ba canvas, .ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .after { clip-path: inset(0 0 0 50%); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 36px; margin-left: -18px;
  z-index: 3; cursor: ew-resize; touch-action: none;
}
.ba-handle::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff;
  transform: translateX(-50%); box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.ba-knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--navy);
  display: grid; place-items: center; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.ba-label {
  position: absolute; top: 10px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  background: rgba(0,0,0,0.45); color: #fff; padding: 4px 8px; border-radius: 8px;
}
.ba-label.l { left: 10px; }
.ba-label.r { right: 10px; }

.form label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.form input, .form textarea {
  width: 100%; border: 1px solid #e0dbd3; border-radius: 12px; padding: 12px 14px;
  font: inherit; background: #fff;
}

.bottom-nav {
  display: flex; justify-content: space-around; padding: 10px 8px 18px;
  background: #fff; border-top: 1px solid #eee;
}
.bottom-nav button {
  border: 0; background: transparent; font-size: 10px; color: var(--muted); cursor: pointer;
}
.bottom-nav button.on { color: var(--navy); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(26,39,68,0.95); color: #fff; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; z-index: 50; opacity: 0; pointer-events: none; transition: 0.2s;
  max-width: 90%;
}
.toast.show { opacity: 1; }

.more-link {
  display: block; text-align: center; margin: 8px 16px; font-size: 12px; color: var(--muted);
}
hidden { display: none !important; }

.cat-chips, .style-chips, .abc-row, .extras-row, .check-grid {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.style-chips .chip { font-size: 11px; padding: 6px 10px; }
.vitrina-count { margin: -4px 0 8px; font-size: 11px; }
.chip, .abc {
  border: 1px solid #e0dbd3; background: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.chip.on, .abc.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.abc { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
.fab-card .badge {
  display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700;
  color: var(--sage-2); letter-spacing: 0.04em;
}
.fab-card .price { display: block; margin-top: 2px; font-size: 11px; color: var(--navy); font-weight: 600; }
.wall-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.wall-chips .chip { font-size: 11px; padding: 5px 10px; }
.rod-warehouse { margin: 0 0 10px; }
.icon-btn.icon-text { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; }
.role-note {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.keys-banner {
  position: sticky;
  top: 0;
  z-index: 80;
  background: #1a2744;
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  text-align: center;
}
.keys-banner a { color: #b8e0d0; font-weight: 700; }
html.degrade-1 .fab-grid { filter: saturate(0.85); }
html.degrade-1 .screen-tryon .stage-wrap { transition: opacity 0.8s; }
html.degrade-2 .vitrina-pin .chip:nth-child(n+4),
html.degrade-2 #abc-slots { opacity: 0.35; pointer-events: none; }
html.degrade-3 .screen-tryon .tryon-toolbar,
html.degrade-3 .sheet-tryon .fab-grid,
.stage-el { margin-bottom: 8px; }
#role-body input[type="number"],
#role-body input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8d2c8;
  font: inherit;
  background: #fff;
  margin-bottom: 4px;
}
#role-body .login-label { font-size: 0.75rem; color: #6b7280; margin: 6px 0 2px; display: block; }
.role-screen {
  background: var(--cream);
  min-height: 100dvh;
  min-height: 100vh;
}
.role-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 16px 28px;
  -webkit-overflow-scrolling: touch;
}
.role-hero {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.role-hero h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--navy);
}
.role-firm {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.role-screen .btn { margin-bottom: 8px; }
.role-screen .cab-title {
  margin: 16px 0 8px;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--navy);
  font-weight: 560;
}
.cab-title {
  margin: 18px 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.cab-panel { margin-bottom: 12px; font-size: 14px; line-height: 1.45; color: var(--navy); }
.cab-panel p { margin: 0 0 8px; }
.cab-panel .fint { display: none; }
.cab-blank {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.cab-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.cab-list li {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--navy);
}
.cab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cab-actions .btn { margin: 0; padding: 12px 8px; font-size: 13px; }
.cab-job-card,
.role-job {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--navy);
}
.role-job strong,
.cab-job-card strong { display: block; margin-bottom: 2px; font-size: 14px; }
.role-job small,
.cab-job-card .sub { color: var(--muted); }
.cab-status-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wh-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
.wh-row input, .role-screen input[type="text"], .role-screen input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e0dbd3;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-grid .role-job strong {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.1;
}
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.kanban-col {
  background: #f6f3ee;
  border: 1px solid #e6e1d8;
  border-radius: 14px;
  padding: 10px;
  min-height: 120px;
}
.kanban-col h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  color: #3a342c;
}
.kanban-col h4 span { color: #8a8074; font-weight: 600; }
.kanban-card {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid #e0dbd3;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font: inherit;
  cursor: pointer;
}
.kanban-card strong { font-size: 13px; }
.kanban-card small { color: #8a8074; font-size: 11px; }
.kanban-empty { margin: 0; font-size: 12px; color: #9a9186; }
.empty-hint {
  background: #fff7e8;
  border: 1px solid #e8d4a8;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.empty-hint strong { display: block; margin-bottom: 4px; }
.empty-hint p { margin: 0; font-size: 13px; color: #5c4a28; line-height: 1.4; }
.role-card {
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}
.login-label {
  display: block; text-align: left; width: 100%; max-width: 320px;
  margin: 8px auto 4px; font-size: 12px; color: var(--muted); font-weight: 600;
}
#login-slug, #login-pin {
  width: 100%; max-width: 320px; margin: 0 auto;
  display: block; box-sizing: border-box;
  border: 1px solid #e0dbd3; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; font-family: inherit;
  background: #fff; color: var(--navy);
}
.cab-blank p { margin: 0 0 6px; }
.screen[data-screen="supplier"] .sheet { max-width: 420px; }
.cm-box {
  background: var(--cream); border-radius: 12px; padding: 10px 12px;
  font-size: 12px; color: var(--navy); margin-bottom: 10px; line-height: 1.45;
}
.check-grid label {
  flex: 1 1 42%; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.extras-row label {
  flex: 1 1 auto; font-size: 12px; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
  background: var(--cream); padding: 8px 10px; border-radius: 10px;
}
.cut-details {
  margin: 0 0 12px; border-radius: 12px; background: var(--cream-2); padding: 8px 12px;
  font-size: 12px; color: var(--muted);
}
.cut-details summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.cut-body { margin-top: 8px; line-height: 1.45; white-space: pre-wrap; }
.disclaimer { font-size: 11px; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.quote-box .line strong { color: var(--navy); font-weight: 600; }
.quote-box .total { font-size: 18px; font-family: var(--font-serif); }
