/* planner.css — same palette and type as css/style.css, kept separate so the planner cannot
   restyle the marketing site and vice versa. */
:root {
  --ink: #0d0b0a; --ink-2: #171411; --ink-3: #221e1a;
  --bone: #ede2d0; --bone-dim: #a99e8d; --bone-faint: #948a7c;
  --terracotta: #c9704a; --brass: #b8914a; --ok: #7fae7a;
  --line: rgba(237, 226, 208, 0.14);
  --serif: "Bodoni 72", "Didot", "Playfair Display", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --side: 360px; --bar: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* a class that sets display must not un-hide an element */
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--bone); font: 14px/1.45 var(--sans); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.bar {
  height: calc(var(--bar) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0;
  display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: var(--ink);
  position: sticky; top: 0; z-index: 20;
}
.bar__brand { font: 600 1.25rem/1 var(--serif); color: var(--bone); text-decoration: none; white-space: nowrap; }
.bar__brand span { color: var(--terracotta); font-style: italic; font-weight: 400; }
.bar__plan { color: var(--bone-dim); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 14px; font-size: 0.8rem; color: var(--bone-dim); }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.ghost { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; }
.ghost:hover, .ghost[aria-pressed="true"] { border-color: var(--bone-dim); }
.pill { background: var(--terracotta); border: 0; border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; font-weight: 600; color: #1a0f09; white-space: nowrap; }

.app { display: grid; grid-template-columns: 1fr var(--side); height: calc(100dvh - var(--bar) - env(safe-area-inset-top, 0px)); }
.stage { position: relative; overflow: hidden; background: #15120f; }
#view { width: 100%; height: 100%; display: block; touch-action: none; }

.map {
  position: absolute; top: 12px; left: 12px; width: min(260px, 34%);
  background: rgba(13, 11, 10, 0.86); border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  backdrop-filter: blur(6px);
}
#plan { width: 100%; height: auto; display: block; touch-action: none; aspect-ratio: 1 / 1.05; }
.map__here { font-size: 0.72rem; color: var(--bone-dim); padding: 4px 2px 0; }
.map__here b { color: var(--bone); }
.map__acts { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; }
.mini { background: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 0.72rem; }
.mini--accent { background: var(--terracotta); border-color: var(--terracotta); color: #1a0f09; font-weight: 700; }
.upload-status { margin-top: 8px; font-size: 0.74rem; padding: 8px 10px; border-radius: 8px; background: var(--ink-3); border-left: 3px solid var(--bone-faint); display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.upload-status[data-state="ok"] { border-color: var(--ok); }
.upload-status[data-state="warn"] { border-color: var(--brass); }
.upload-status[data-state="err"] { border-color: var(--terracotta); }

/* SVG plan */
.room__fill { fill: #2a241f; stroke: none; transition: fill .2s; }
.room--bedroom .room__fill { fill: #2e2721; }
.room--toilet .room__fill, .room--utility .room__fill, .room--kitchen .room__fill { fill: #25231f; }
.room--pooja .room__fill { fill: #332a1d; }
.room--here .room__fill { fill: #4a3326; }
.room__name { fill: var(--bone); text-anchor: middle; font-family: var(--sans); font-weight: 600; pointer-events: none; }
.room__size { fill: var(--bone-faint); text-anchor: middle; font-family: var(--sans); pointer-events: none; }
.wall { stroke: #d9cfbf; stroke-linecap: square; }
.wall--ext { stroke: #efe6d8; }
.win { stroke: #2a241f; }
.win__glass { stroke: #8fb7c9; }
.door { fill: none; stroke: var(--bone-faint); stroke-width: 2; stroke-dasharray: 5 4; }
.door--main { stroke: var(--terracotta); stroke-width: 3; stroke-dasharray: none; }
.north path { fill: var(--terracotta); }
.north text { fill: var(--bone); text-anchor: middle; font-weight: 700; }
.north__disc { fill: rgba(13, 11, 10, 0.75); stroke: var(--line); stroke-width: 2; }
.north--unknown { opacity: 0.3; }
.item rect { fill: rgba(237, 226, 208, 0.22); stroke: rgba(237, 226, 208, 0.7); stroke-width: 2; cursor: grab; }
.item__front { stroke: var(--brass); stroke-width: 4; pointer-events: none; }
.item--rug rect { fill: rgba(184, 145, 74, 0.12); stroke-dasharray: 6 5; }
.item--sel rect { stroke: var(--terracotta); stroke-width: 5; fill: rgba(201, 112, 74, 0.3); }
.me__cone { fill: rgba(201, 112, 74, 0.25); stroke: none; pointer-events: none; }
.me__dot { fill: var(--terracotta); stroke: var(--ink); stroke-width: 5; pointer-events: none; }

.hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 0.72rem; color: var(--bone-dim); background: rgba(13, 11, 10, 0.7); padding: 6px 12px; border-radius: 999px;
  pointer-events: none; white-space: nowrap;
}
body[data-mode="orbit"] .only-walk, body[data-mode="walk"] .only-orbit { display: none; }
.stick {
  position: absolute; left: 22px; bottom: 56px; width: 116px; height: 116px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(13, 11, 10, 0.45); touch-action: none; display: grid; place-items: center;
}
.stick i { width: 46px; height: 46px; border-radius: 50%; background: rgba(237, 226, 208, 0.75); display: block; pointer-events: none; }

.sel {
  position: absolute; right: 12px; bottom: 12px; width: min(380px, calc(100% - 24px));
  background: rgba(13, 11, 10, 0.94); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.sel__head { display: flex; justify-content: space-between; gap: 8px; }
.sel__name { font-weight: 600; }
.sel__meta { color: var(--bone-dim); font-size: 0.8rem; }
.sel__row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sel__acts button { background: var(--ink-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 0.78rem; }
.sel__acts .danger { color: #e79a80; }
.buy { margin-left: auto; color: var(--terracotta); font-size: 0.8rem; font-weight: 600; text-decoration: none; }
.lbl { color: var(--bone-faint); font-size: 0.75rem; }
.icon { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--bone-dim); }
.vastu { margin: 10px 0 0; font-size: 0.78rem; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--brass); background: rgba(184, 145, 74, 0.1); color: var(--bone); }
.vastu[data-ok="yes"] { border-color: var(--ok); background: rgba(127, 174, 122, 0.1); }
.vastu[data-ok="no"] { border-color: var(--terracotta); background: rgba(201, 112, 74, 0.12); }
.sw { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sw button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); outline: 1px solid var(--line); padding: 0; }
.sw button[aria-pressed="true"] { outline: 2px solid var(--terracotta); }
.card .sw button { width: 12px; height: 12px; border-width: 1px; }

.toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--bone); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }

.side { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--ink-2); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 12px; color: var(--bone-dim); border-bottom: 2px solid transparent; font-size: 0.85rem; }
.tabs button[aria-selected="true"] { color: var(--bone); border-color: var(--terracotta); }
.count { color: var(--bone-faint); font-size: 0.75rem; }
[data-panel] { overflow-y: auto; padding: 12px 14px 20px; min-height: 0; flex: 1; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters input { grid-column: 1 / -1; }
.filters input, .filters select { background: var(--ink-3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem; min-width: 0; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--ink); }
.card__top { display: flex; gap: 8px; align-items: center; font-size: 0.7rem; }
.card__brand { color: var(--terracotta); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.card__cat { color: var(--bone-faint); }
.card__top .sw { margin-left: auto; }
.card__name { font-weight: 600; margin: 4px 0 2px; }
.card__dims { color: var(--bone-dim); font-size: 0.75rem; }
.card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.card__price { font-weight: 700; }
.btn-add { background: var(--bone); color: var(--ink); border: 0; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 0.8rem; }
.btn-add:hover { background: var(--terracotta); }
.note { color: var(--bone-faint); font-size: 0.72rem; margin: 12px 0 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.li__name { font-weight: 600; font-size: 0.85rem; }
.li__meta { color: var(--bone-dim); font-size: 0.75rem; }
.li__right { text-align: right; white-space: nowrap; }
.li__price { font-weight: 700; }
.li__buy { color: var(--terracotta); font-size: 0.75rem; text-decoration: none; }
.total { display: flex; justify-content: space-between; padding: 14px 0 0; font-size: 1rem; }
.total b { font-family: var(--serif); font-size: 1.5rem; }
.list__acts { display: flex; gap: 8px; margin-top: 14px; }

@media (min-width: 861px) { .narrow { display: none; } }
@media (max-width: 860px) {
  .wide { display: none; }
  .seg button, .pill { white-space: nowrap; }
  .bar { gap: 10px; }
  .bar__plan, #walls { display: none; }
  .seg button { padding: 6px 10px; }
  .ghost, .pill { padding: 6px 10px; }
  .app { display: block; height: auto; }
  .stage { height: 62dvh; }
  .map { width: 40%; min-width: 132px; top: 8px; left: 8px; padding: 5px; }
  .map__here { display: none; }
  .map__acts .mini { font-size: 0.64rem; padding: 4px 8px; }
  .hint { display: none !important; }
  .stick { width: 100px; height: 100px; left: 14px; bottom: 14px; }
  .sel { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px 12px; }
  body[data-mode="walk"] .sel:not([hidden]) ~ .stick { display: none; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  [data-panel] { overflow: visible; }
}
@media (max-width: 420px) { .bar__brand span { display: none; } }
