/* The office planner, on tools/office-planner/ and the home page. Loaded only where a page asks for it. */

.planner { position: relative; }
.planner__fallback { margin: 0; padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
.planner.is-ready .planner__fallback { display: none; }

.planner__app {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: 0 40px 80px -56px rgba(1, 44, 85, 0.45), 0 2px 6px -4px rgba(1, 44, 85, 0.12);
  overflow: clip;
}
.planner__app[hidden] { display: none; }

/* ---- controls */

.planner__controls { border-right: 1px solid var(--line); background: #f8fafc; }
.pl-block { min-width: 0; margin: 0; padding: 20px 24px 22px; border: 0; border-bottom: 1px solid var(--line); }
.pl-block:last-child { border-bottom: 0; }
.pl-block__title {
  display: flex; align-items: center; gap: 9px;
  float: left; width: 100%; margin: 0 0 14px; padding: 0;
  color: var(--navy); font-size: 0.7188rem; font-weight: 600; letter-spacing: 0.1em; line-height: 1.3; text-transform: uppercase;
}
.pl-block__title::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--accent); }
.pl-block__title + * { clear: both; }

.pl-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-preset {
  display: grid; gap: 2px; padding: 10px 12px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); text-align: left; line-height: 1.25;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pl-preset strong { color: var(--navy); font-size: 0.8438rem; font-weight: 600; }
.pl-preset span { color: var(--muted); font-size: 0.75rem; }
.pl-preset:hover { border-color: var(--line-strong); box-shadow: 0 6px 16px -12px rgba(1, 44, 85, 0.5); }
.pl-preset.is-on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }

.pl-seats { display: flex; align-items: center; gap: 12px; }
.pl-seats__value {
  min-width: 2.1ch; color: var(--navy); text-align: center;
  font-size: 2.75rem; font-weight: 400; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums;
}
.pl-seats__unit { color: var(--muted); font-size: 0.9375rem; }

.pl-step {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--white); color: var(--navy);
  font-size: 1.125rem; line-height: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pl-step--big { width: 40px; height: 40px; font-size: 1.25rem; }
.pl-step:hover:not(:disabled) { border-color: var(--navy); background: var(--navy); color: var(--white); }
.pl-step:disabled { opacity: 0.35; cursor: not-allowed; }

.pl-range {
  --pct: 24%;
  display: block; width: 100%; height: 30px; margin: 14px 0 2px; padding: 0;
  background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.pl-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--sea) var(--pct));
}
.pl-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -9px;
  border: 4px solid var(--white); border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 8px rgba(1, 44, 85, 0.35);
}
.pl-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--sea); }
.pl-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.pl-range::-moz-range-thumb {
  width: 16px; height: 16px;
  border: 4px solid var(--white); border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 8px rgba(1, 44, 85, 0.35);
}
.pl-range:focus-visible { outline: none; }
.pl-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-range__ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.pl-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pl-layout { position: relative; display: block; }
.pl-layout input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pl-layout__card {
  display: grid; justify-items: center; align-content: start; gap: 7px; height: 100%;
  padding: 12px 6px 11px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); color: var(--muted);
  font-size: 0.7813rem; font-weight: 600; line-height: 1.2; text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.pl-layout__card svg { width: 46px; height: 32px; }
.pl-layout__card rect { fill: #e2cba6; }
.pl-layout__card circle { fill: var(--navy); opacity: 0.55; }
.pl-layout__card path { fill: none; stroke: #9fb0c2; stroke-width: 1.4; }
.pl-layout:hover .pl-layout__card { border-color: var(--line-strong); }
.pl-layout input:checked + .pl-layout__card { border-color: var(--accent); color: var(--navy); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.pl-layout input:checked + .pl-layout__card circle { opacity: 1; }
.pl-layout input:focus-visible + .pl-layout__card { outline: 2px solid var(--accent); outline-offset: 2px; }

.pl-list { display: grid; gap: 2px; }
.pl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; }
.pl-row__label { color: var(--body); font-size: 0.9063rem; }
.pl-stepper { display: inline-flex; align-items: center; gap: 10px; }
.pl-stepper output { min-width: 1.4ch; color: var(--navy); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.pl-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-toggle { position: relative; display: inline-block; }
.pl-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pl-toggle span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--white); color: var(--body);
  font-size: 0.8125rem; font-weight: 500; line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pl-toggle span::before {
  content: ""; width: 14px; height: 14px; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--white) center / 10px 10px no-repeat;
}
.pl-toggle:hover span { border-color: var(--navy); }
.pl-toggle input:checked + span { border-color: var(--navy); background: var(--navy); color: var(--white); }
.pl-toggle input:checked + span::before {
  border-color: var(--accent-bright);
  background-color: var(--accent-bright);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='%23012c55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.pl-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the view */

.planner__main { display: flex; flex-direction: column; min-width: 0; }
.planner__view { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 0; background: var(--white); }
.planner__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }

.pl-views { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--mist); }
.pl-view {
  min-width: 64px; padding: 7px 16px;
  border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--muted);
  font-size: 0.8438rem; font-weight: 600; line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.pl-view:hover { color: var(--navy); }
.pl-view.is-on { background: var(--white); color: var(--navy); box-shadow: 0 1px 4px rgba(1, 44, 85, 0.16); }

.pl-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--white); color: var(--navy);
  font-size: 0.8438rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pl-tool[hidden] { display: none; }
.pl-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-tool:hover { border-color: var(--navy); }
.pl-tool--quiet { border-color: transparent; color: var(--muted); }
.pl-tool--quiet:hover { border-color: var(--line-strong); color: var(--navy); }
.pl-tool--icon { width: 38px; padding: 0; }

.planner__area { margin: 0 0 0 auto; color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.planner__stage {
  position: relative; flex: 1 0 auto; min-height: 0;
  height: clamp(420px, 46vw, 620px);
  padding: clamp(10px, 1.6vw, 22px);
  background-color: #fbfcfd;
  background-image: radial-gradient(circle, rgba(1, 44, 85, 0.1) 1px, transparent 1.3px);
  background-size: 18px 18px;
  touch-action: manipulation;
}
.planner__svg {
  width: 100%; height: 100%; max-width: none;
  font-family: var(--font);
  transition: opacity 0.15s ease;
  user-select: none; -webkit-user-select: none;
}
.planner__stage.is-fading .planner__svg { opacity: 0; }
.planner__svg [data-name] { cursor: default; }
.planner__svg .pl-room:hover > rect:first-child,
.planner__svg .pl-desk:hover { filter: brightness(0.96); }

.planner__tip {
  position: absolute; z-index: 3;
  padding: 6px 10px; border-radius: 8px;
  background: var(--navy); color: var(--white);
  font-size: 0.7813rem; font-weight: 500; line-height: 1.3; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(1, 44, 85, 0.7);
  pointer-events: none;
}
.planner__tip[hidden] { display: none; }

.pl-new { animation: pl-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes pl-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---- summary and actions */

.planner__foot { padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.planner__summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.planner__summary div { position: relative; padding: 12px 14px 13px; border-radius: var(--r-sm); background: var(--mist); }
.planner__summary div:first-child::before { content: ""; position: absolute; left: 14px; top: 0; width: 22px; height: 2px; background: var(--accent); }
.planner__summary dt { color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.planner__summary dd { margin: 5px 0 0; color: var(--navy); font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.planner__rooms { margin-bottom: 6px; color: var(--body); font-size: 0.9063rem; }
.planner__note { margin-bottom: 0; color: var(--muted); font-size: 0.8125rem; }
.planner__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.planner__book { background: var(--accent); }
.planner__book:hover { background: #5f1a2a; }
html[data-accent="teal"] .planner__book:hover { background: var(--accent-ink); }
.planner__status { color: var(--accent-ink); font-size: 0.8125rem; font-weight: 500; }

/* ---- full screen */

.planner__view:fullscreen { background: var(--white); }
.planner__view:fullscreen .planner__stage { flex: 1 1 0; height: auto; }

/* ---- smaller screens: the view first and kept in sight while the settings scroll */

@media (max-width: 1080px) {
  .planner__app { grid-template-columns: 300px minmax(0, 1fr); }
  .pl-block { padding: 18px 18px 20px; }
  .planner__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .planner__app { display: flex; flex-direction: column; border-radius: var(--r-md); }
  .planner__main { display: contents; }
  .planner__view {
    order: 1;
    position: sticky; top: var(--header-h-compact); z-index: 5;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 22px -20px rgba(1, 44, 85, 0.6);
  }
  .planner__view:fullscreen { position: static; }
  .planner__toolbar { padding: 10px 12px; gap: 8px; }
  .planner__stage { flex: none; height: min(78vw, 360px); padding: 8px; }
  .planner__controls { order: 2; border-right: 0; }
  .planner__foot { order: 3; }
  .pl-presets { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .planner__area { display: none; }
  .pl-view { min-width: 54px; padding: 7px 13px; }
  .planner__summary dd { font-size: 1.1875rem; }
  .planner__actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-new { animation: none; }
  .planner__svg { transition: none; }
}
