/* Ginger 1.0.3 — CAD chrome. Stark paper default. Dream off. */
:root,
[data-theme="paper"] {
  --aw-bg: #ffffff;
  --aw-surface: #f3f3f5;
  --aw-accent: #6e72f5;
  --aw-cyan: #8b8dff;
  --aw-fg: #0a0a0a;
  --aw-muted: #55555c;
  --aw-border: #d9d9e0;
  --aw-grid: #ececf1;
  --aw-wall: #12141a;
  --aw-door: #1f6b45;
  --aw-win: #1d5f86;
  --aw-room: rgba(110, 114, 245, 0.12);
  --aw-chip: #12141a;
  --aw-chip-ink: #ffffff;
  --aw-chrome: #ececf1;
}
[data-theme="night"] {
  --aw-bg: #12141a;
  --aw-surface: #1b1e27;
  --aw-accent: #8b8dff;
  --aw-cyan: #8b8dff;
  --aw-fg: #f4f4f6;
  --aw-muted: #b7b7c4;
  --aw-border: #2e3340;
  --aw-grid: #242833;
  --aw-wall: #f4f4f6;
  --aw-door: #8fdfb5;
  --aw-win: #9fd4ee;
  --aw-room: rgba(139, 141, 255, 0.18);
  --aw-chip: #f4f4f6;
  --aw-chip-ink: #12141a;
  --aw-chrome: #16181f;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--kp-font, "IBM Plex Sans", "Segoe UI", system-ui, sans-serif);
  background: var(--aw-surface);
  color: var(--aw-fg);
  line-height: 1.35;
}
button, input, select { font: inherit; color: inherit; }
button, [role="button"] { cursor: pointer; }
.app { display: grid; grid-template-rows: auto 1fr auto; height: 100%; min-height: 100dvh; }
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--aw-chrome);
  border-bottom: 1px solid var(--aw-border);
}
.mark { width: 28px; height: 28px; flex: none; color: var(--aw-fg); }
.brand { font-weight: 700; letter-spacing: 0.12em; font-size: 12px; }
.chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 2px;
  background: var(--aw-chip);
  color: var(--aw-chip-ink);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tools, .items { display: flex; flex-wrap: wrap; gap: 4px; }
.tools button, .bar > button, .items button, .props button, .name-pick {
  min-height: 44px;
  min-width: 44px;
  padding: 0 11px;
  border: 1px solid var(--aw-border);
  background: var(--aw-bg);
  border-radius: 2px;
}
.tools button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tool-ico { width: 18px; height: 18px; flex: none; }
.tools button[aria-pressed="true"],
.items button[aria-pressed="true"] {
  outline: 2px solid var(--aw-accent);
  background: var(--aw-room);
}
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--aw-cyan);
  outline-offset: 2px;
}
.help { position: relative; }
.help summary {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--aw-border);
  background: var(--aw-bg);
  list-style: none;
}
.help summary::-webkit-details-marker { display: none; }
details.help:not([open]) .help-panel { display: none; }
.help-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 4;
  width: min(420px, 92vw);
  margin: 0;
  padding: 10px 12px;
  background: var(--aw-bg);
  border: 1px solid var(--aw-border);
  font-size: 1rem;
  line-height: 1.4;
}
.help-steps { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 8px; }
.help-steps li { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.help-steps svg { width: 48px; height: 32px; flex: none; }
.help-ar { display: none; }
#read-help { min-height: 44px; min-width: 44px; margin-top: 8px; }
.stage { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; min-height: 0; direction: ltr; }
canvas#plan { width: 100%; height: 100%; display: block; background: var(--aw-bg); touch-action: none; direction: ltr; }
.side {
  border-right: 1px solid var(--aw-border);
  border-left: 0;
  background: var(--aw-bg);
  overflow: auto;
  padding: 12px;
  min-height: 0;
}
h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 16px 0 8px;
  color: var(--aw-muted);
}
h2:first-child { margin-top: 0; }
.props label, .side label { display: block; font-size: 13px; margin: 8px 0 4px; }
.props input, .props select, .side input, .side select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--aw-border);
  border-radius: 2px;
  background: var(--aw-bg);
}
.props button { width: 100%; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--aw-border); }
th { color: var(--aw-muted); font-weight: 650; }
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 6px 10px;
  min-height: 36px;
  font-size: 13px;
  color: var(--aw-muted);
  border-top: 1px solid var(--aw-border);
  background: var(--aw-chrome);
}
.whats { color: var(--aw-fg); }
.quiet { color: var(--aw-muted); opacity: 1; }
.peek-wrap {
  height: 168px;
  border: 1px solid var(--aw-border);
  overflow: hidden;
  display: none;
  background: var(--aw-bg);
}
.peek-wrap.on { display: block; }
canvas#peek { width: 100%; height: 100%; display: block; }
.hint { font-size: 13px; color: var(--aw-muted); line-height: 1.4; }
.name-picks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
@media (max-width: 900px) {
  body:not(.kb-on) .bar { padding-top: 52px; }
  html.kb-framed .bar { padding-top: 6px; }
  .stage { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .side {
    display: none;
    border-left: 0;
  }
  .side.is-open {
    display: block;
    position: fixed;
    z-index: 40;
    top: 52px;
    bottom: 8px;
    left: 8px;
    right: auto;
    width: min(320px, calc(100vw - 16px));
    overflow: auto;
    border: 1px solid var(--aw-border);
    box-shadow: 0 12px 32px #0a0a0a33;
  }
  .help-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 52px;
    width: auto;
    max-height: calc(100dvh - 64px);
    overflow: auto;
  }
}
@media (min-width: 901px) {
  #props-toggle { display: none; }
}
/* Root font-size is the only scale. Shared prefs also sets body to 1.25rem / 1.5rem !important. */
html[data-kp-size="S"] { font-size: 90%; }
html[data-kp-size="M"] { font-size: 100%; }
html[data-kp-size="L"] { font-size: 125%; }
html[data-kp-size="XL"] { font-size: 150%; }
html[data-kp-size="S"] body[data-theme],
html[data-kp-size="M"] body[data-theme],
html[data-kp-size="L"] body[data-theme],
html[data-kp-size="XL"] body[data-theme] {
  font-size: 1rem !important;
}
html[dir="rtl"] .bar,
html[dir="rtl"] .tools,
html[dir="rtl"] .menu-btn { direction: ltr; }
html[dir="rtl"] .stage,
html[dir="rtl"] canvas#plan { direction: ltr; }
html[dir="rtl"] .side,
html[dir="rtl"] .foot,
html[dir="rtl"] .menu-drawer,
html[dir="rtl"] .props { direction: rtl; text-align: start; }
html[dir="rtl"] .menu-drawer,
html[dir="rtl"] .side.is-open { left: 0; right: auto; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; }
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0a0a0a40;
}
.menu-backdrop[hidden],
.menu-drawer[hidden] { display: none !important; }
.menu-drawer {
  position: fixed;
  z-index: 61;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 92vw);
  overflow: auto;
  padding: 12px;
  background: var(--aw-bg);
  border-right: 1px solid var(--aw-border);
  box-shadow: 8px 0 28px #0a0a0a33;
}
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-head h2 { margin: 0; }
.menu-drawer h2 { margin-top: 18px; }
.menu-drawer button,
#menu-close,
#read-help {
  min-height: 44px;
  min-width: 44px;
}
.menu-actions { display: grid; gap: 8px; margin-top: 12px; }
.lang-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-picks button[aria-pressed="true"] {
  outline: 2px solid var(--aw-accent);
  background: var(--aw-room);
}
.help-steps { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 8px; }
.help-steps li { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.help-steps svg { width: 48px; height: 32px; flex: none; }
#read-help { margin-top: 8px; }
.menu-news { margin: 4px 0 8px; }
.menu-news h2 { margin-top: 4px; }
.drawer-plate {
  margin: 8px 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.menu-news p {
  margin: 0;
  color: var(--aw-fg);
  font-size: 1rem;
  line-height: 1.45;
}
body.kb-on .kb-bar { z-index: 70; }
body.kb-on .app {
  height: calc(100dvh - var(--kb-h, 48px));
  min-height: 0;
}
body.kb-on .menu-drawer,
body.kb-on .menu-backdrop { top: var(--kb-h, 48px); }
@media (max-width: 399px) {
  .kb-bar { flex-wrap: wrap; height: auto; min-height: 48px; }
  .kb-bar .kb-plate {
    flex: 0 0 auto;
    overflow: visible;
    text-overflow: clip;
    min-width: max-content;
  }
}

html[data-kp-lang="ar"] body,
html[data-kp-lang="fa-AF"] body,
html[data-kp-lang="ti"] body { line-height: 1.5; }
.help-ar { display: none; }
html, body { overflow-x: hidden; }
html[data-kp-contrast="1"] body[data-theme] {
  --aw-bg: #fff;
  --aw-surface: #fff;
  --aw-fg: #000;
  --aw-muted: #000;
  --aw-border: #000;
  --aw-grid: #000;
  --aw-wall: #000;
  --aw-door: #000;
  --aw-win: #000;
  --aw-room: transparent;
  --aw-accent: #ffe14a;
  --aw-chrome: #fff;
  --aw-chip: #000;
  --aw-chip-ink: #ffe14a;
  background: #fff !important;
  color: #000 !important;
}
html[data-kp-contrast="1"] body[data-theme] .bar,
html[data-kp-contrast="1"] body[data-theme] .side,
html[data-kp-contrast="1"] body[data-theme] .foot,
html[data-kp-contrast="1"] body[data-theme] .help-panel,
html[data-kp-contrast="1"] body[data-theme] canvas#plan {
  background: #fff !important;
  color: #000 !important;
}
html[data-kp-contrast="1"] body[data-theme] button,
html[data-kp-contrast="1"] body[data-theme] a,
html[data-kp-contrast="1"] body[data-theme] input,
html[data-kp-contrast="1"] body[data-theme] select,
html[data-kp-contrast="1"] body[data-theme] summary {
  background: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
html[data-kp-contrast="1"] body[data-theme] button[aria-pressed="true"] {
  background: #ffe14a !important;
  color: #000 !important;
  outline: 3px solid #000 !important;
}
html[data-kp-contrast="1"] body[data-theme] .quiet,
html[data-kp-contrast="1"] body[data-theme] .foot,
html[data-kp-contrast="1"] body[data-theme] h2,
html[data-kp-contrast="1"] body[data-theme] .hint { color: #000 !important; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
