:root {
  --panel-w: min(392px, 38vw);
  --scene: #ebe4d9;
  --paper: #fbfbfa;
  --ink: #1f2b40;
  --muted: #5f6b7d;
  --line: #d8dde3;
  --cap: #2b3a55;
  --cap-soft: #e7ebf2;
  --door: #d68a3e;
  --window: #5ca0cd;
  --focus: #3d6fe0;
  --radius-panel: 14px;
  --radius-ctl: 8px;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--scene);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- stage */

.stage { position: fixed; inset: 0; }
#view { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#view:focus-visible { outline-offset: -4px; }
#view.is-dragging { cursor: grabbing; }
#view.is-pick:not(.is-dragging) { cursor: pointer; }

.empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 24px 16px 24px calc(max(var(--panel-w), 330px) + 32px);
}
.empty__inner { max-width: 30rem; }
.empty__glyph { width: 120px; height: auto; display: block; margin-bottom: 24px; }
.empty h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 14px;
  max-width: 16ch;
}
.empty p { color: var(--muted); margin: 0 0 24px; max-width: 38ch; }
.lede { font-size: 17px; line-height: 1.45; }
/* reassurance badge under the button */
.empty .local {
  display: flex; width: fit-content; align-items: center; gap: 7px; margin: 18px 0 0; padding: 5px 12px 5px 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.2;
}
.local svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* footer of the landing page, and of the panel once a drawing is open */
.empty__foot {
  position: absolute; bottom: 20px; left: calc(max(var(--panel-w), 330px) + 32px); right: 16px;
  display: flex; justify-content: center; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted);
}
.empty__foot a, .panel__foot a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.empty__foot a:hover, .panel__foot a:hover { color: var(--ink); text-decoration-thickness: 2px; }
.empty__foot .link, .panel__foot .link { color: inherit; font-size: inherit; }
.panel__foot {
  display: flex; justify-content: space-between; gap: 12px; flex: none;
  padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
body.is-empty .panel__foot { display: none; }
.credits {
  width: min(440px, calc(100vw - 32px)); padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius-panel);
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px -24px rgba(31, 43, 64, .45); font-size: 14px;
}
.credits::backdrop { background: rgba(31, 43, 64, .25); backdrop-filter: blur(2px); }
.credits[open] { animation: credits-in .18s ease-out; }
@keyframes credits-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.credits__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.credits h2 { margin: 0; font-size: 17px; font-weight: 600; }
.credits p { margin: 0 0 10px; }
.credits a { color: var(--cap); text-underline-offset: 3px; }
.credits__sub { color: var(--muted); }
.credits__list { margin: 0; display: grid; gap: 12px; }
.credits__list > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.credits dt { font-weight: 600; }
.credits dt span { font-weight: 400; color: var(--muted); font-size: 13px; }
.credits dd { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.samples { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; color: var(--muted); font-size: 14px; }

.dropveil {
  position: fixed; inset: 10px; z-index: 30;
  border: 2px dashed var(--cap); border-radius: 18px;
  background: color-mix(in srgb, var(--scene) 70%, transparent);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.dropveil span { background: var(--cap); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 500; }
body.is-dropping .dropveil { opacity: 1; }

.busy {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%);
  z-index: 4;
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; z-index: 5;
}
.busy__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cap); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
/* once the view's buttons are up, the status sits below them */
body:not(.is-empty) .busy { top: 76px; }

.viewbar {
  position: absolute; right: 20px; bottom: 20px;
  display: flex; gap: 2px; padding: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
}
/* export actions, top of the view */
.exportbar {
  position: absolute; top: 20px; right: 92px;
  display: flex; gap: 8px; align-items: center;
}
.btn--float {
  gap: 8px; padding: 10px 16px; border-radius: 10px;
  background: var(--paper); border-color: var(--line);
  box-shadow: 0 1px 2px rgb(31 43 64 / 0.06), 0 4px 16px rgb(31 43 64 / 0.08);
}
.btn--float svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn--float.btn--primary { padding: 10px 16px; font-size: 14px; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- motion */

.btn, .iconbtn { transition: background-color .15s, border-color .15s, box-shadow .2s, transform .1s; }
.btn:active, .iconbtn:active { transform: scale(.97); }
.btn--float:hover { box-shadow: 0 2px 4px rgb(31 43 64 / 0.08), 0 8px 22px rgb(31 43 64 / 0.12); }

/* the export options pop open from the button */
.exportpop:not([hidden]) { animation: pop-in .2s cubic-bezier(.3, .7, .2, 1); transform-origin: top right; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* the view's controls arrive with the first model */
.exportbar:not([hidden]), .viewbar:not([hidden]) { animation: rise-in .45s .15s cubic-bezier(.3, .7, .2, 1) both; }
.compass:not([hidden]), .floors:not([hidden]) { animation: fade-in .45s .25s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
#view { transition: opacity .5s ease; }
body.is-empty #view { opacity: 0; }
.empty { transition: opacity .25s; }

/* sections that fold open */
.block--details[open] > :not(summary) { animation: fold-in .28s cubic-bezier(.3, .7, .2, 1); }
@keyframes fold-in { from { opacity: 0; transform: translateY(-4px); } }
.exportpop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 290px; z-index: 6;
  display: grid; gap: 10px; padding: 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 4px rgb(31 43 64 / 0.06), 0 12px 32px rgb(31 43 64 / 0.14);
}
.exportpop[hidden] { display: none; }
.exportpop__title { margin: 0 0 2px; font-weight: 600; font-size: 15px; }
.exportpop__cuts { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.exportpop__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.exportpop__quick .link { font-size: 13px; }
#xCuts { display: grid; gap: 4px; padding-left: 2px; }
#xCuts .check { font-size: 14px; margin-top: 0; }
.exportpop > .check { margin-top: 0; }
#xPartsRow { margin-top: 4px; }
.exportpop .note { margin: 0; font-size: 13px; color: var(--muted); }
.exportpop .help { margin: 2px 0 4px; }
.exportpop .btn--primary { gap: 8px; padding: 10px 16px; font-size: 14px; }
.exportpop .btn--primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: none; border-radius: 8px; cursor: pointer;
}
.iconbtn:hover { background: var(--cap-soft); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.hint {
  position: absolute; left: calc(max(var(--panel-w), 330px) + 32px); right: 220px; bottom: 26px; margin: 0;
  color: var(--muted); font-size: 13px; transition: opacity .6s;
}
.hint.is-faded { opacity: 0; }

/* ---------------------------------------------------------------- panel */

.panel {
  position: fixed; left: 16px; top: 16px; bottom: 16px; z-index: 10;
  width: var(--panel-w); min-width: 330px;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius-panel);
  box-shadow: 0 1px 0 rgba(31, 43, 64, .04), 0 12px 32px -18px rgba(31, 43, 64, .35);
  overflow: hidden;
}
body.is-empty .panel { bottom: auto; }
/* nothing to draw yet: the (opaque) 3D canvas would cover the page in black */
body.is-empty #view { visibility: hidden; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
body.is-empty .panel__head { border-bottom: 0; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 22px; height: 22px; }
/* body: a rail of section tabs, and the open section */
.panel__body { display: flex; flex: 1; min-height: 0; }
.rail {
  position: relative; flex: none; width: 70px; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--scene) 35%, transparent);
}
.rail__tab {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 2px 7px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-size: 11px; font-weight: 500; letter-spacing: .01em; color: var(--muted);
  transition: color .25s, background-color .15s;
}
.rail__tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail__tab:hover:not([aria-selected="true"]) { background: var(--cap-soft); color: var(--ink); }
.rail__tab[aria-selected="true"] { color: #fff; }
.rail__tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rail__pill {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 10px; background: var(--cap); pointer-events: none;
  transition: transform .32s cubic-bezier(.3, .7, .2, 1), width .32s, height .32s;
}
.rail.no-anim .rail__pill { transition: none; }
.panes { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
.pane:not([hidden]) { animation: pane-in .28s cubic-bezier(.3, .7, .2, 1); }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } }

.block { padding: 16px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.005em; }
.block--details summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.block--details summary::-webkit-details-marker { display: none; }
.block--details summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.block--details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.block--details summary h2 { margin: 0; }
.block--details[open] summary { margin-bottom: 8px; }
.block--actions { display: flex; flex-wrap: wrap; gap: 8px; }

.thumb { position: relative; border-radius: 10px; overflow: hidden; background: #eef0f2; border: 1px solid var(--line); }
#thumb { display: block; width: 100%; height: auto; }
.seg { position: absolute; left: 8px; bottom: 8px; display: flex; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg__btn { border: 0; background: none; padding: 3px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg__btn[aria-pressed="true"] { background: var(--cap); color: #fff; }
/* with a sliding pill, the pressed button is see-through and the pill moves */
.seg.has-pill { isolation: isolate; }
.seg.has-pill .seg__btn { position: relative; z-index: 1; transition: color .25s; }
.seg.has-pill .seg__btn[aria-pressed="true"] { background: transparent; }
.seg__pill {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 6px; background: var(--cap); pointer-events: none;
  transition: transform .3s cubic-bezier(.3, .7, .2, 1), width .3s cubic-bezier(.3, .7, .2, 1);
}
.seg.no-anim .seg__pill, .seg.no-anim .seg__btn { transition: none; }
.summary { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.summary strong { color: var(--ink); font-weight: 600; }
.legend { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 1px; vertical-align: 0; }

.field { margin-bottom: 14px; }
.field label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.field output { color: var(--muted); font-variant-numeric: tabular-nums; }
.field--row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.field--row label { margin: 0; }
.unit { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
input[type="number"] {
  width: 84px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-ctl);
  background: #fff; text-align: right; font-variant-numeric: tabular-nums;
}
.help { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.block > .help { margin-bottom: 12px; }

input[type="range"] { width: 100%; margin: 6px 0 0; accent-color: var(--cap); height: 18px; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-top: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--cap); margin: 0; }

.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rooms li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }
.rooms .sw { width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(31, 43, 64, .12); }
.rooms .area { color: var(--muted); font-variant-numeric: tabular-nums; }
.rooms .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 500; }
.rooms li.room { display: block; padding: 0; }
/* a floor's heading in the Rooms list (click: go to that floor) */
.rooms li.rgroup { display: block; padding: 0; margin-top: 14px; }
.rooms li.rgroup:first-child { margin-top: 0; }
.rgroup__head {
  display: flex; align-items: baseline; gap: 8px; width: calc(100% + 8px); margin: 0 -4px 2px; padding: 6px 4px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color .2s;
}
.rgroup__head:hover { background: var(--cap-soft); }
.rgroup__head:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rgroup__name { font-size: 14px; font-weight: 600; white-space: nowrap; }
.rgroup__sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rgroup__head .area { margin-left: auto; font-size: 13px; }
.rgroup__tag {
  display: none; align-self: center; flex: none; padding: 1px 7px; border-radius: 999px;
  background: var(--cap); color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}
.rgroup.is-current .rgroup__tag { display: inline-block; }
.rooms li.rnone { display: block; padding: 6px 0 2px; font-size: 13px; color: var(--muted); }
.room__head {
  display: grid; grid-template-columns: 14px 1fr auto 14px; gap: 10px; align-items: center; width: 100%;
  padding: 5px 4px; margin: 0 -4px; width: calc(100% + 8px); border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: 14px; color: inherit; text-align: left; cursor: pointer;
}
.room__head:hover { background: var(--cap-soft); }
.room__head:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.room__chev { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform .15s; }
.room.is-open .room__chev { transform: rotate(180deg); }
.room--all { border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 4px; }
.room--all .room__head > span:nth-child(2) { font-weight: 500; }
/* room editors fold open and shut */
.floored-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.3, .7, .2, 1); }
.room.is-open .floored-wrap { grid-template-rows: 1fr; }
.floored-clip { overflow: hidden; min-height: 0; }
.floored { display: grid; gap: 8px; padding: 8px 0 12px 24px; opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .28s; }
.room.is-open .floored { opacity: 1; transform: none; transition-delay: .06s; }
.room__head { transition: background-color .2s; }
.floored__row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.floored__row select { grid-column: 2 / 4; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-ctl); background: #fff; font: inherit; color: var(--ink); }
.floored__row output { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; color: var(--ink); }
.floored__color { grid-column: 2 / 4; display: flex; align-items: center; gap: 10px; }
.floored__color input[type="color"] { width: 44px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.floored__acts { padding-left: 74px; }
.floored .link { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; border-radius: var(--radius-ctl);
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: #b8c0cb; }
.btn--primary { background: var(--cap); border-color: var(--cap); color: #fff; padding: 12px 20px; font-size: 15px; }
.btn--primary:hover { background: #1f2c45; border-color: #1f2c45; }
.btn--quiet { background: none; }
.link { border: 0; background: none; padding: 0; color: var(--cap); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; font-size: inherit; }
.link:hover { text-decoration-thickness: 2px; }
#resetDetect { font-size: 14px; margin-top: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--cap); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; margin: 0; opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #9b2c2c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 760px) {
  .panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; min-width: 0;
    max-height: 46vh; border-radius: var(--radius-panel) var(--radius-panel) 0 0; border-width: 1px 0 0;
  }
  body.is-empty .panel { top: 0; bottom: auto; max-height: none; border-radius: 0 0 var(--radius-panel) var(--radius-panel); border-width: 0 0 1px; }
  .empty { padding: 72px 16px 56px; }
  .empty__foot { left: 16px; justify-content: flex-start; }
  .viewbar { right: 12px; top: 12px; bottom: auto; }
  .exportbar { top: auto; right: auto; left: 12px; bottom: calc(46vh + 12px); }
  .exportpop { top: auto; bottom: calc(100% + 8px); right: auto; left: 0; }
  .btn--float { padding: 8px 12px; }
  .hint { display: none; }
  .busy { top: 70px; }
  .panel__body { flex-direction: column; }
  /* the sheet keeps its height whichever tab is open */
  body:not(.is-empty) .panel { height: 46vh; }
  .rail { width: auto; flex-direction: row; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail__tab { flex: 1; padding: 6px 2px 5px; gap: 2px; font-size: 10.5px; }
  .rail__tab svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- drawings list */

.block__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.block__head h2 { margin: 0; }
.seg--inline { position: relative; }

.plans { list-style: none; margin: 0 -6px; padding: 0; display: grid; gap: 2px; position: relative; z-index: 1; }
/* the selected drawing's frame, sliding between rows */
.plans__pill {
  position: absolute; left: 0; right: 0; height: 0; z-index: 0; pointer-events: none;
  margin: 0 -6px; border-radius: 10px;
  background: var(--cap-soft); box-shadow: inset 0 0 0 1.5px var(--cap);
  transition: transform .3s cubic-bezier(.3, .7, .2, 1), height .3s;
}
.plans__pill.no-anim { transition: none; }
.plan {
  display: grid; grid-template-columns: 20px 44px 1fr auto; align-items: center; gap: 8px;
  padding: 6px; border-radius: 10px; cursor: pointer;
}
.plan { transition: background-color .2s; }
.plan.is-new { animation: row-in .4s calc(var(--i, 0) * 60ms) cubic-bezier(.3, .7, .2, 1) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
.plan:hover { background: color-mix(in srgb, var(--cap-soft) 70%, transparent); }
.plan[aria-current="true"], .plan[aria-current="true"]:hover { background: transparent; }
.plan input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cap); margin: 0 0 0 2px; }
.plan__thumb { width: 44px; height: 44px; border-radius: 6px; background: #eef0f2 center / contain no-repeat; border: 1px solid var(--line); }
.plan__text { min-width: 0; }
.plan__name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan__meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan__meta strong { color: var(--ink); font-weight: 500; }
.plan__tools { display: flex; gap: 0; opacity: .0; transition: opacity .15s; }
.plan:hover .plan__tools, .plan[aria-current="true"] .plan__tools, .plan:focus-within .plan__tools { opacity: 1; }
.plan.is-pending { cursor: default; }
.plan.is-pending .plan__name { color: var(--muted); }

.iconbtn--small { width: 28px; height: 28px; border-radius: 6px; }
.iconbtn--small svg { width: 16px; height: 16px; }
.iconbtn:disabled { opacity: .3; cursor: default; background: none; }

.plan-name {
  width: 100%; margin: 0 0 10px; padding: 4px 6px; margin-left: -6px; width: calc(100% + 12px);
  border: 1px solid transparent; border-radius: 6px; background: none;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
}
.plan-name:hover { border-color: var(--line); }
.plan-name:focus { border-color: var(--cap); outline: none; background: #fff; }

.nudge { display: flex; align-items: center; gap: 2px; margin-top: 6px; }
.nudge .iconbtn { border: 1px solid var(--line); background: #fff; }
.nudge .link { margin-left: 10px; font-size: 14px; }

@media (hover: none) { .plan__tools { opacity: 1; } }

/* ---------------------------------------------------------------- light & orientation */

.compass {
  position: absolute; right: 20px; top: 20px; width: 56px; height: 56px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 50%;
}
.compass svg { width: 100%; height: 100%; display: block; }
.compass__ring { fill: none; stroke: var(--line); stroke-width: 1; }
.compass__n { fill: #c44536; }
.compass__s { fill: #9aa3b0; }
#compassN { font: 700 9px var(--font); fill: var(--ink); }

.timerow { display: flex; align-items: center; gap: 8px; }
.timerow input { flex: 1; }
#play { border: 1px solid var(--line); background: #fff; flex: none; }
#play svg { fill: var(--ink); stroke: none; }
#play .icon-pause { display: none; }
#play.is-playing .icon-play { display: none; }
#play.is-playing .icon-pause { display: block; }
input[type="date"] { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-ctl); background: #fff; font-size: 14px; }
#lat, #lon { width: 78px; }

.orient { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; margin-top: 14px; }
.orient__label { display: block; font-size: 14px; margin-bottom: 6px; }
.orient #north { width: 64px; }
.dial { width: 72px; height: 72px; cursor: grab; touch-action: none; border-radius: 50%; }
.dial:active { cursor: grabbing; }
.dial svg { width: 100%; height: 100%; display: block; }
.dial__ring { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.dial__ticks { stroke: #b8c0cb; stroke-width: 1.5; }

/* ---------------------------------------------------------------- floor picker */

.floors {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgb(31 43 64 / 0.06), 0 4px 16px rgb(31 43 64 / 0.06);
}
/* the dark highlight under the floor shown on top; slides between floors */
.floors__pill {
  position: absolute; left: 6px; top: 0; width: 0; height: 0; z-index: 0;
  background: var(--cap); border-radius: 7px; pointer-events: none;
  transition: transform .32s cubic-bezier(.3, .7, .2, 1), height .32s, width .32s;
}
.floors.no-anim .floors__pill { transition: none; }
.floors button {
  position: relative; z-index: 1;
  display: block; min-width: 64px; padding: 6px 10px; text-align: left;
  font: 500 13px/1.2 var(--font); color: var(--ink); cursor: pointer;
  background: var(--cap-soft); border: 1px solid transparent; border-radius: 7px;
  transition: background-color .25s, color .25s, border-color .15s, transform .1s;
}
.floors button:hover { border-color: var(--line); }
.floors button:active { transform: scale(.96); }
.floors button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.floors button.is-hidden { background: transparent; color: var(--muted); }
.floors button.is-top { background: transparent; color: #fff; }

@media (max-width: 760px) {
  .floors { right: 12px; top: 72px; transform: none; }
  .floors button { min-width: 0; padding: 6px 9px; }
  .compass { left: 12px; right: auto; top: 12px; width: 48px; height: 48px; }
}
