/* ============================================================
   Simple mode — the calm interface.

   Sizing here is deliberate, not decorative. Body text is 17px and
   never drops below 15; every tap target clears 48px and the plus/
   minus buttons are 56; contrast is kept above 7:1 against the panel
   so it still reads with an ageing eye or a screen in daylight.
   Nothing depends on hover, because a touch screen has none.
   ============================================================ */

:root {
  --sm-panel-w: 430px;
  --sm-bg: #171B21;
  --sm-raised: #202730;
  --sm-line: #39424F;
  --sm-text: #F4F7FB;
  --sm-muted: #A9B6C7;
  --sm-accent: #4C93FF;
  --sm-accent-ink: #0A0E14;
  --sm-ok: #4ED08A;
  --sm-warn: #F2B544;
  --sm-error: #FF7A6B;
}

/* ---- the panel ---- */
.sm-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  right: 10px;
  bottom: 10px;
  width: var(--sm-panel-w);
  max-width: calc(100vw - 20px);
  display: flex;
  flex-direction: column;
  background: var(--sm-bg);
  border: 1px solid var(--sm-line);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5);
  z-index: 28;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.5;
  color: var(--sm-text);
}
.sm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 22px 28px;
  -webkit-overflow-scrolling: touch;
}
.sm-scroll::-webkit-scrollbar { width: 12px; }
.sm-scroll::-webkit-scrollbar-thumb { background: var(--sm-line); border-radius: 8px; }

/* Simple mode hides the professional chrome. The modules keep running
   underneath — switching back to Pro restores everything untouched. */
body.simple-mode .panel,
body.simple-mode .toolbar-wrap,
body.simple-mode .panel-toggle,
body.simple-mode .viewport-hint,
body.simple-mode .sel-bar,
body.simple-mode .wall-selection-actions,
body.simple-mode .wall-direction-popover,
body.simple-mode .tpl-overlay { display: none !important; }
body.simple-mode .stage { left: 0; bottom: 0; }

/* ---- mode toggle in the top bar ---- */
.ui-mode-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #15181D;
  border: 1px solid #343940;
  border-radius: 9px;
}
.ui-mode-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sm-muted);
  font: 700 13px var(--font);
  cursor: pointer;
}
.ui-mode-toggle button:hover { color: var(--sm-text); }
.ui-mode-toggle button.active { background: var(--sm-accent); color: #fff; }
.ui-mode-toggle button i { font-size: 15px; }

/* ---- typography ---- */
.sm-title {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.2px;
}
.sm-subtitle {
  margin: 32px 0 12px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sm-muted);
}
.sm-hint {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--sm-muted);
}

/* ---- home: pick a type ---- */
.sm-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sm-type-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 138px;
  padding: 18px 16px;
  border: 2px solid var(--sm-line);
  border-radius: 12px;
  background: var(--sm-raised);
  color: var(--sm-text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sm-type-card:hover,
.sm-type-card:focus-visible { border-color: var(--sm-accent); background: #262F3A; outline: none; }
.sm-type-card i { font-size: 30px; color: var(--sm-accent); }
.sm-type-card b { font-size: 18px; font-weight: 800; }
.sm-type-card small { font-size: 13.5px; line-height: 1.4; color: var(--sm-muted); }

/* ---- home: what you've made ---- */
.sm-piece-list { display: flex; flex-direction: column; gap: 10px; }
.sm-piece {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sm-piece-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 14px;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
  color: var(--sm-text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}
.sm-piece-open:hover { border-color: var(--sm-accent); }
.sm-piece-open > i:first-child { font-size: 24px; color: var(--sm-accent); flex-shrink: 0; }
.sm-piece-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sm-piece-text b { font-size: 17px; font-weight: 700; }
.sm-piece-text small { font-size: 14px; color: var(--sm-muted); }
.sm-piece-go { color: var(--sm-muted); font-size: 18px; }
.sm-piece-delete {
  width: 56px;
  flex-shrink: 0;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
  color: var(--sm-muted);
  font-size: 19px;
  cursor: pointer;
}
.sm-piece-delete:hover { border-color: var(--sm-error); color: var(--sm-error); }
.sm-badge {
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font: 800 14px var(--font);
}
.sm-badge-error { background: var(--sm-error); color: #2A0B07; }

/* ---- wizard progress ---- */
.sm-progress { display: flex; gap: 6px; margin-bottom: 10px; }
.sm-progress-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--sm-line);
}
.sm-progress-dot.done { background: #35618F; }
.sm-progress-dot.active { background: var(--sm-accent); }
.sm-step-count {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sm-muted);
}

/* ---- controls ---- */
.sm-controls { display: flex; flex-direction: column; gap: 26px; }
.sm-control { display: flex; flex-direction: column; gap: 10px; }
.sm-control-label { font-size: 18px; font-weight: 700; }

.sm-stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 10px;
  align-items: stretch;
}
.sm-step-btn {
  height: 56px;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
  color: var(--sm-text);
  font-size: 21px;
  cursor: pointer;
}
.sm-step-btn:hover,
.sm-step-btn:focus-visible { border-color: var(--sm-accent); color: var(--sm-accent); outline: none; }
.sm-step-btn:active { background: var(--sm-accent); color: #fff; }
.sm-readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: #10141A;
}
.sm-readout-value { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.sm-readout-unit { font-size: 13px; color: var(--sm-muted); min-height: 17px; }

.sm-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--sm-line);
  outline: none;
  cursor: pointer;
}
.sm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--sm-accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.sm-slider::-moz-range-thumb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--sm-accent);
  cursor: pointer;
}
.sm-range {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--sm-muted);
}

.sm-choices { display: flex; flex-direction: column; gap: 9px; }
.sm-choices-row { flex-direction: row; }
.sm-choices-row .sm-choice { flex: 1; justify-content: center; }
.sm-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 58px;
  padding: 12px 16px;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
  color: var(--sm-text);
  font: 600 17px var(--font);
  text-align: left;
  cursor: pointer;
}
.sm-choice i { font-size: 22px; color: var(--sm-muted); flex-shrink: 0; }
.sm-choice:hover { border-color: #5B6A7C; }
.sm-choice.selected {
  border-color: var(--sm-accent);
  background: rgba(76, 147, 255, .14);
}
.sm-choice.selected i { color: var(--sm-accent); }

.sm-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sm-swatch {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
  color: var(--sm-text);
  font: 600 15px var(--font);
  text-align: left;
  cursor: pointer;
}
.sm-swatch.selected { border-color: var(--sm-accent); background: rgba(76, 147, 255, .14); }
.sm-swatch-chip {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .25);
}
.sm-swatch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---- navigation ---- */
.sm-nav { display: flex; gap: 11px; margin-top: 30px; }
.sm-nav .sm-btn { flex: 1; }
.sm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  padding: 12px 20px;
  border: 2px solid transparent;
  border-radius: 11px;
  font: 700 17px var(--font);
  cursor: pointer;
}
.sm-btn-wide { width: 100%; }
.sm-btn-primary { background: var(--sm-accent); color: #fff; }
.sm-btn-primary:hover { filter: brightness(1.1); }
.sm-btn-quiet {
  background: var(--sm-raised);
  border-color: var(--sm-line);
  color: var(--sm-text);
}
.sm-btn-quiet:hover { border-color: var(--sm-accent); }
.sm-btn-send { background: var(--sm-ok); color: #05261A; }
.sm-btn-send:hover { filter: brightness(1.07); }
.sm-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---- summary ---- */
.sm-summary-head { margin-bottom: 20px; }
.sm-summary-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sm-muted);
}
.sm-summary-kind i { color: var(--sm-accent); font-size: 17px; }
.sm-name {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 2px solid var(--sm-line);
  border-radius: 11px;
  background: #10141A;
  color: var(--sm-text);
  font: 800 22px var(--font);
}
.sm-name:focus { outline: none; border-color: var(--sm-accent); }

.sm-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.sm-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--sm-line);
  border-radius: 11px;
  background: var(--sm-raised);
}
.sm-fact-label { font-size: 13.5px; color: var(--sm-muted); }
.sm-fact-value { font-size: 19px; font-weight: 800; }

.sm-price {
  padding: 18px;
  margin-bottom: 18px;
  border: 2px solid rgba(76, 147, 255, .45);
  border-radius: 12px;
  background: rgba(76, 147, 255, .09);
}
.sm-price > span:first-child {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sm-muted);
}
.sm-price > b { display: block; margin: 4px 0 14px; font-size: 36px; font-weight: 800; letter-spacing: -.5px; }
.sm-price-lines { display: flex; flex-direction: column; gap: 7px; }
.sm-price-line {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--sm-muted);
}
.sm-price-line span:last-child { color: var(--sm-text); font-weight: 700; }
.sm-price-note { display: block; margin-top: 14px; font-size: 13px; line-height: 1.45; color: var(--sm-muted); }

/* ---- messages ---- */
.sm-issue {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--sm-line);
  border-left-width: 5px;
  border-radius: 10px;
  background: var(--sm-raised);
  font-size: 15.5px;
  line-height: 1.45;
}
.sm-issue i { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.sm-issue-ok { border-left-color: var(--sm-ok); }
.sm-issue-ok i { color: var(--sm-ok); }
.sm-issue-error { border-left-color: var(--sm-error); }
.sm-issue-error i { color: var(--sm-error); }
.sm-issue-warning { border-left-color: var(--sm-warn); }
.sm-issue-warning i { color: var(--sm-warn); }
.sm-issue-info { border-left-color: var(--sm-accent); }
.sm-issue-info i { color: var(--sm-accent); }

.sm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* ---- narrow screens: the panel becomes a bottom sheet ---- */
@media (max-width: 900px) {
  .sm-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 66vh;
  }
  .sm-scroll { padding: 20px 16px 22px; }
  .sm-title { font-size: 24px; }
  .ui-mode-toggle button span { display: none; }
  .ui-mode-toggle button { padding: 0 11px; }
}
@media (max-width: 480px) {
  .sm-type-grid,
  .sm-swatches,
  .sm-facts { grid-template-columns: 1fr; }
}

/* Respect a reduced-motion preference: nothing here needs to move. */
@media (prefers-reduced-motion: reduce) {
  .sm-panel, .sm-btn, .sm-choice, .sm-type-card { transition: none !important; }
}
