:root {
  /* Sampled straight out of the Elasto wordmark, letter by letter. */
  --elasto-purple: #903483;
  --elasto-green: #a6cf38;
  --elasto-pink: #ec008c;
  --elasto-blue: #00aeef;
  --elasto-teal: #3d949d;
  --elasto-ink: #231f20;

  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e2e2e6;
  --text: #1c1c1f;
  --muted: #6b6b74;

  /* The purple carries the brand and still clears contrast on white at 8:1,
     which the logo's blue and teal do not. Those stay decorative. */
  --accent: var(--elasto-purple);

  /* Available and booked have to read instantly, so they stay green and red
     rather than being bent to fit the palette. */
  --good: #1a8a5f;
  --warn: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 { font-size: 18px; margin: 0; white-space: nowrap; }

nav { display: flex; gap: 6px; flex-wrap: wrap; }

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* An owner's console on a desk, not an article to read: 1040px left a third of a
   normal screen empty while the bookings table squeezed nine columns into what was
   left and wrapped every one of them. It still stops short of edge-to-edge, which
   is unreadable on a wide monitor. */
main { max-width: 1480px; margin: 0 auto; padding: 20px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 { font-size: 16px; margin: 22px 0 10px; }
h2:first-child { margin-top: 0; }
h4 { font-size: 14px; margin: 18px 0 8px; }

.muted-line { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* ---- Empty state ---- */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.empty-state h2 { margin-top: 0; font-size: 18px; }
.empty-state p { color: var(--muted); font-size: 14px; max-width: 460px; margin: 0 auto 18px; line-height: 1.5; }

/* ---- Stats ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-value { font-size: 23px; font-weight: 600; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-card.highlight .stat-value { color: var(--good); }
.stat-card.warn .stat-value { color: var(--warn); }

/* ---- Forms ---- */
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 6px;
}

.inline-form.tight { padding: 0; border: none; background: none; }

.inline-form input, .inline-form select {
  flex: 1 1 140px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 0;
  background: var(--surface);
  color: var(--text);
}

button {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

button:hover { background: var(--bg); }

button.primary, .inline-form button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.primary:hover, .inline-form button[type="submit"]:hover { opacity: 0.9; background: var(--accent); }

button.danger { background: var(--warn); color: #fff; border-color: var(--warn); }
button.danger:hover { opacity: 0.9; background: var(--warn); }
button.danger-text { color: var(--warn); }

.error { color: var(--warn); font-size: 13px; min-height: 18px; margin: 4px 2px 12px; }

/* ---- Tables ---- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* nowrap above keeps most columns tidy, but a booking can cover every bay in the
   basement, and an eleven-name list that cannot wrap drags the table past its own
   container and pushes the action buttons off the edge. These two columns hold
   lists and prose, so they wrap and are capped. */
td.cell-spaces, td.cell-goods { white-space: normal; max-width: 240px; }
td.cell-spaces .cell-note { line-height: 1.45; }

/* The three row buttons are the other half of the same problem: nowrap kept them
   on one line and claimed 235px of a table that had none to give. They wrap now,
   and the dates stack rather than running on. */
.row-actions { white-space: normal; }
.row-actions button { margin: 0 4px 4px 0; }
td.cell-dates { white-space: normal; max-width: 160px; line-height: 1.4; }

th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }

tr:last-child td { border-bottom: none; }
tr.row-ended td { color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.vacant { background: #eaf3ea; color: var(--good); }
.badge.occupied { background: #fdeeea; color: var(--warn); }

.balance-positive { color: var(--warn); font-weight: 600; }
.balance-zero { color: var(--good); }
.balance-credit { color: var(--accent); font-weight: 600; }

.row-actions { white-space: nowrap; }
.row-actions button { padding: 4px 10px; font-size: 12px; margin-right: 4px; }

.empty-row td { color: var(--muted); text-align: center; padding: 20px; }

/* ---- Demo bar ---- */
.demo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.demo-bar span { font-size: 13px; color: var(--muted); margin-right: 4px; }
.demo-bar button { padding: 6px 12px; font-size: 13px; }

/* ---- Modal ---- */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 50;
}

#modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 520px;
}

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header h3 { margin: 0; font-size: 16px; }

#modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
  color: var(--muted);
  cursor: pointer;
}

#modal label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }

#modal label input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---- Calculation breakdown ---- */
.calc-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 14px;
}

.calc-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; }
.calc-row > span:first-child { color: var(--muted); }
.calc-row em { color: var(--muted); font-style: normal; font-size: 12px; }
.calc-sum { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.calc-total {
  border-top: 2px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 600;
}

.table-wrap.compact table { font-size: 13px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 8px 10px; }

/* ---- Space calculator ---- */
.intro-line {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
  max-width: 620px;
}

.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.field-group { margin-bottom: 16px; }
.group-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}

.field-row:last-child { margin-bottom: 0; }

.field-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  flex: 0 1 132px;
}

.field-row label.grow { flex: 1 1 230px; }
.field-row label.wide { flex: 0 1 175px; }

.field-row input, .field-row select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  min-width: 0;
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.warn-notice { background: #fdeeea; color: #8c2c1f; border: 1px solid #f3cfc7; }
.warn-notice button { margin-left: 6px; padding: 4px 10px; font-size: 13px; }

.fit-name { font-weight: 600; }
.cell-note { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: normal; }

/* ---- Picking spaces when the owner takes a booking ---- */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.pick-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--good);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.pick-cell.on {
  border-color: var(--accent);
  border-left-color: var(--accent);
  border-width: 2px;
  border-left-width: 4px;
  padding: 8px 10px;
  background: #f5f8ff;
}

.pick-cell.gone {
  border-left-color: var(--warn);
  opacity: 0.55;
  cursor: not-allowed;
}

.pick-name { font-weight: 600; font-size: 14px; }
.pick-sub { font-size: 12px; color: var(--muted); }

/* ---- The floor plan tab: drawing on the left, the spaces on the right ---- */
.plan-split {
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  gap: 24px;
  align-items: start;
}

/* The drawing stays put while the list scrolls, so the row you pressed and the
   box you are about to drag are on screen together. The basement is close to
   1:2, so the height is what runs out first — cap it and let the width follow. */
.plan-split #plan-stage {
  position: sticky;
  top: 84px;
  display: flex;
  justify-content: center;
}

.plan-split #plan-frame { max-height: calc(100vh - 150px); }
.plan-split #plan-img { max-height: calc(100vh - 152px); width: auto; }

@media (max-width: 960px) {
  .plan-split { grid-template-columns: 1fr; gap: 18px; }
  .plan-split #plan-stage { position: static; }
  .plan-split #plan-frame, .plan-split #plan-img { max-height: none; }
  .plan-split #plan-img { width: 100%; }
}

/* ---- Layout drawing and hotspots ---- */
#plan-frame, #book-frame, #booking-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  user-select: none;
}

/* The owner drags a box across the drawing to map a space, so the browser must
   not read that drag as a scroll. The customer only taps, so on their page a
   thumb landing on the plan has to scroll the page like anywhere else —
   `manipulation` keeps pinch-zoom and drops only the double-tap zoom delay. */
#plan-frame { touch-action: none; }
#book-frame { touch-action: manipulation; }

#plan-frame.drawing { cursor: crosshair; }
#plan-img, #book-frame img { display: block; max-width: 100%; height: auto; }
#booking-frame { touch-action: manipulation; }
#booking-frame img { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; pointer-events: none; }

.hot-box {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(47, 111, 237, 0.14);
  border-radius: 3px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  line-height: 1.2;
  padding: 3px;
}

.hot-box span {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 20, 28, 0.78);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-box.selected { border-width: 3px; }
.hot-box.pickable { cursor: pointer; }

/* The three states a customer sees: free, their own pick, and gone. */
.hot-box.is-free { border-color: var(--good); background: rgba(26, 138, 95, 0.18); }
.hot-box.is-taken { border-color: var(--warn); background: rgba(192, 57, 43, 0.18); cursor: not-allowed; }
.hot-box.is-chosen {
  border-color: var(--accent);
  border-width: 4px;
  background: rgba(47, 111, 237, 0.26);
}

.plan-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.plan-legend span { display: flex; align-items: center; gap: 6px; }

.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid; }
.swatch.is-free { background: #eaf3ea; border-color: var(--good); }
.swatch.is-taken { background: #fdeeea; border-color: var(--warn); }
.swatch.is-chosen { background: #e3ecfd; border-color: var(--accent); }

#draw-box {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(47, 111, 237, 0.12);
  pointer-events: none;
}

.file-button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  background: var(--surface);
}

.file-button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

.link-button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.map-list { list-style: none; padding: 0; margin: 0; }

.map-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 14px;
}

.map-list li.mapped { border-left-color: var(--good); }
.map-list li.unmapped { border-left-color: var(--warn); }
.map-list .fit-name { flex: 0 0 auto; font-weight: 600; }
.map-list .map-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.map-list .map-actions em { font-size: 13px; color: var(--accent); font-style: normal; }
.map-list button { padding: 5px 11px; font-size: 13px; }

.muted-inline { color: var(--muted); font-size: 13px; }

/* ---- Customer booking page ---- */
.book-body { background: var(--bg); }

.book-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

.book-header h1 { margin: 0 0 12px; font-size: 19px; }

.steps {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  counter-reset: step;
}

.steps li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  counter-increment: step;
}

.steps li::before { content: counter(step) '. '; }
.steps li.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps li.done { color: var(--good); border-color: var(--good); }

.book-main { max-width: 760px; margin: 0 auto; padding: 20px; }
.book-step { display: none; }
.book-step.active { display: block; }

.chosen-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.space-card {
  margin-top: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.space-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.space-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.space-facts div { display: flex; flex-direction: column; gap: 2px; }
.space-facts span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.space-facts strong { font-size: 16px; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.checkbox-line input { width: auto; }

/* Each acknowledgement is its own act, so consecutive ones are ruled apart. The
   rule goes between them rather than on each, or the first draws a stray line
   across the top of the card. Aligned to the top because the label wraps to two
   lines on a phone. */
.consent-line {
  align-items: flex-start;
  padding: 4px 0;
}
.consent-line input { margin-top: 2px; }
.consent-line + .consent-line {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.book-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.book-actions button { flex: 0 1 auto; }

/* The confirmation carries a bill and a set of account details, which read as a
   document rather than as the short centred message this panel was built for. */
#stage-done .empty-state { text-align: left; }
#stage-done .empty-state h2 { text-align: center; }
#stage-done .empty-state p { max-width: none; text-align: center; }

/* The drawing is roughly 1:2, so above a grid of cards it left a half-empty strip
   down each side of itself. Beside them it takes the width it needs and the cards
   take the rest. */
.booking-pick {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}
.booking-pick .pick-grid { margin-bottom: 0; }
@media (max-width: 760px) {
  .booking-pick { grid-template-columns: 1fr; }
}

/* A sortable heading is a button, but it has to read as a heading. */
.th-sort {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.th-sort:hover { color: var(--text); }
.th-sort.on { color: var(--accent); font-weight: 600; }
/* The arrow only appears on the column actually in force, so the header row is not
   a line of competing triangles. */
.th-sort.on[data-dir="asc"]::after { content: '▲'; font-size: 9px; }
.th-sort.on[data-dir="desc"]::after { content: '▼'; font-size: 9px; }

td.cell-made { white-space: nowrap; color: var(--muted); }

/* Rows carry a value and up to four notes. At the old padding a booking covering
   the whole basement ran to five lines and the table read as a wall. */
#bookings-table th, #bookings-table td { padding: 8px 10px; }
#bookings-table .cell-note { line-height: 1.35; }
td.cell-money { white-space: nowrap; }
td.cell-money .cell-note { font-size: 12px; }
td.cell-made .cell-note { font-variant-numeric: tabular-nums; }

/* ---- Rates ---- */

/* Pricing the whole basement from one figure, before anything is typed row by row. */
.rate-bulk {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
}
.rate-bulk label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }

/* A rupee sign set inside the box, so the column reads as money without the sign
   being typed into the value. */
.rate-field, .rate-bulk-field {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.rate-field:focus-within, .rate-bulk-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(122, 58, 138, 0.12);
}
.rate-cur, .rate-bulk-cur {
  padding: 0 2px 0 9px;
  color: var(--muted);
  font-size: 14px;
}
.rate-field input, .rate-bulk-field input {
  border: none;
  background: none;
  padding: 7px 9px 7px 2px;
  width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rate-field input:focus, .rate-bulk-field input:focus { outline: none; box-shadow: none; }
.rate-field input:disabled { background: none; color: var(--muted); }

/* Figures line up for comparison down the column, which is the entire point of
   showing per sq ft and per cu ft beside each other. */
.rates-grid td.num, .rates-grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rates-grid td.num .rate-field { text-align: left; }
.rates-grid td.facts { font-size: 14px; }
.rates-grid tfoot td { padding-top: 12px; border-top: 2px solid var(--border); }

/* Set once and rarely opened again, so they sit under the table rather than
   between you and it. */
.rates-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.rates-settings .deposit-box, .rates-settings .pay-settings { margin: 0; }

/* The owner's side of the same thing. Wide form, two columns where there is room,
   one on a phone. */
.pay-settings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}
.pay-settings h3 { margin: 0 0 6px; font-size: 16px; }
.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px;
  margin: 14px 0;
}

/* The fixed details, shown back rather than offered for editing. */
.pay-fixed { margin: 14px 0 0; }
.pay-fixed > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.pay-fixed > div:last-child { border-bottom: none; }
.pay-fixed dt { color: var(--muted); font-size: 13px; margin: 0; }
.pay-fixed dd {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  text-align: right;
}

/* Label above its box. Inline, the caption and the field fight for the same line
   and an account number ends up in a sliver. */
.pay-settings label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.pay-settings label input[type="text"],
.pay-settings label input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text);
}
.pay-qr-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.pay-qr-row > div { flex: 1 1 280px; }

/* Where to send the money. Boxed rather than loose on the page, because it is the
   one thing on the confirmation someone will come back to and look for again. */
.pay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.pay-box h3 { margin: 0 0 6px; font-size: 16px; }

.pay-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.pay-line:last-child { border-bottom: none; }
.pay-line span { color: var(--muted); }
/* An account number gets read digit by digit off a screen and typed into a bank
   app, so it is spaced and monospaced rather than set in the body face. */
.pay-line b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* Tapping this opens the payer's own UPI app with the amount and reference already
   in it. It is a push the payer authorises with their own PIN, and the link carries
   nothing but the VPA printed under the QR — the dangerous direction in UPI is a
   collect request, and there isn't one here. */
.btn-upi {
  display: block;
  margin-top: 12px;
  /* 14px vertical clears a 44px tap target, which is the smallest a thumb finds
     reliably — and this is the button the whole page exists to get pressed. */
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.btn-upi:hover { filter: brightness(1.08); }
.upi-note { margin-top: 8px; font-size: 12px; }

.pay-upi { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.pay-upi > div { flex: 1 1 200px; }

/* On a phone the code is useless — you cannot scan the screen you are holding — so
   the QR steps aside and the button takes the full width instead of sharing a row
   with it. */
@media (max-width: 520px) {
  .pay-upi { flex-direction: column; align-items: stretch; }
  .pay-qr { align-self: center; }
}
.pay-qr {
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
}

.ok-notice { background: #eaf3ea; color: #14623f; border: 1px solid #c4e0d0; }
.info-notice { background: #eef3fd; color: #1d4894; border: 1px solid #ccdcf8; }
.payment-stub { text-align: left; margin-top: 16px; }

/* ---- Item picker ---- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.item-card img {
  width: 100%;
  max-width: 84px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 4px;
}

.item-card .item-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }
.item-card .item-size { font-size: 11px; color: var(--muted); line-height: 1.3; }

.item-card.selected {
  border-color: var(--accent);
  border-width: 2px;
  padding: 7px 5px 9px;
  background: #f5f8ff;
}

/* ---- Multiple picks ---- */
.selection-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
}

.selection-total { font-weight: 600; font-size: 16px; }
.fit-breakdown { margin-top: 6px; font-size: 13px; opacity: 0.85; }

.checkbox-field { justify-content: flex-end; }
.checkbox-field .checkbox-line { padding: 9px 0; }
.labour-notice { margin-top: 16px; }

button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Hold timer ---- */
.hold-timer:not(:empty) {
  display: block;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: #eef3fd;
  border: 1px solid #ccdcf8;
  color: #1d4894;
  font-size: 14px;
  text-align: center;
}

.hold-timer.urgent:not(:empty) {
  background: #fdeeea;
  border-color: #f3cfc7;
  color: #8c2c1f;
}

.hold-timer strong { font-variant-numeric: tabular-nums; font-size: 16px; }

.badge.held { background: #eef3fd; color: #1d4894; }
.badge.muted { background: var(--bg); color: var(--muted); }
.warn-note { color: var(--warn); }

.plan-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-tools-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Confirmation next to the button that caused it. */
.save-flag {
  font-size: 13px;
  font-weight: 600;
  color: #17694a;
  background: #eafaf0;
  border: 1px solid #bfe6cf;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

button:disabled { opacity: 0.65; cursor: progress; }

/* ---- Toast ---- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  color: #fff;
  z-index: 100;
  max-width: 90vw;
}

#toast.toast-ok { background: #24243a; }
#toast.toast-err { background: var(--warn); }

/* ---- Phone layout: tables become stacked cards ---- */
@media (max-width: 720px) {
  main { padding: 16px; }
  header { padding: 12px 16px; gap: 12px; }

  .table-wrap { overflow: visible; }

  table thead { display: none; }

  table tr {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }

  table tr:last-child { border-bottom: none; }

  table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 4px 0;
    border: none;
    white-space: normal;
    text-align: right;
  }

  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    flex-shrink: 0;
  }

  table td:empty { display: none; }

  /* The desktop caps exist to stop a wide table; stacked, each cell is already
     the width of the card and a max-width only fights the flex row. */
  td.cell-spaces, td.cell-goods, td.cell-dates { max-width: none; }

  /* A cell is a flex row here, so its value and each of its notes became
     side-by-side items that refused to narrow — one booking covering every bay
     needed 374px in a 358px card and pushed the whole page sideways. Let the row
     wrap, and give every note a line of its own. */
  table td { flex-wrap: wrap; }
  table td .cell-note { flex: 1 0 100%; text-align: right; margin-top: 2px; }

  .row-actions { justify-content: flex-end; padding-top: 8px !important; }
  .row-actions button { margin: 0 0 0 6px; }

  .empty-row td { justify-content: center; }
  .empty-row td::before { content: none; }

  .table-wrap.compact table tr { display: table-row; }
  .table-wrap.compact table thead { display: table-header-group; }
  .table-wrap.compact table td { display: table-cell; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .table-wrap.compact table td::before { content: none; }

  .calc-row { font-size: 13px; }
  .modal-actions button { flex: 1 1 auto; }

  .field-row label, .field-row label.grow { flex: 1 1 100%; }
  .field-row { gap: 10px; }
}

/* ---- Brand header and site footer ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand img { height: 38px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 12px; color: var(--muted); }

.head-links {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.head-call, .head-wa {
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.head-call { font-weight: 600; }
.head-wa { border-color: #25d366; color: #0b7a3b; }
.head-call:hover, .head-wa:hover { background: var(--bg); }

.site-foot {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.foot-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 26px;
}

.foot-col h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.foot-col p, .foot-col address {
  margin: 0 0 6px;
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
}

.foot-col a { color: var(--accent); text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-logo { height: 52px; width: auto; display: block; margin-bottom: 8px; }
.foot-note { color: var(--muted); font-size: 13px; }
.foot-tag {
  font-size: 12px;
  color: #0b7a3b;
  background: #eafaf0;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.foot-base {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* A gradient hairline lifted from the logo's own border. */
.brand-rule {
  height: 3px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, var(--elasto-blue), var(--elasto-teal),
    var(--elasto-green), var(--elasto-purple), var(--elasto-pink));
}

/* ---- Plain pages: About, Terms ---- */
.page-wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 40px; }
.page-wrap h1 { font-size: 24px; margin: 0 0 6px; }
.page-wrap .lede { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.page-wrap h2 { font-size: 17px; margin: 28px 0 8px; }
.page-wrap h3 { font-size: 15px; margin: 20px 0 6px; color: var(--muted); }
.page-wrap p, .page-wrap li { font-size: 15px; line-height: 1.65; }
.page-wrap ul { padding-left: 20px; }
.page-wrap li { margin-bottom: 6px; }
.page-wrap a { color: var(--accent); }

/* The date the terms took effect. Quiet, but it has to be visible: a clause with
   no date is a clause nobody can pin down. */
.terms-inforce {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.fact-list { list-style: none; padding: 0; margin: 0; }
.fact-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.fact-list li:last-child { border-bottom: none; }
.fact-list b { flex: 0 0 130px; color: var(--muted); font-weight: 500; }

@media (max-width: 720px) {
  .brand img { height: 32px; }
  .brand-text strong { font-size: 15px; }
  .brand-text small { display: none; }
  .foot-inner { padding: 22px 16px 14px; gap: 20px; }
}

/* The old booking page keeps its own header; give the brand row somewhere to sit. */
.book-header .head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#booking-plan { display: flex; justify-content: center; margin-bottom: 14px; }
#booking-plan .muted-line { margin: 0; }

/* The way out of an empty booking page: a phone number you can press. */
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.btn-call, .btn-wa {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-wa { background: var(--surface); border-color: #25d366; color: #0b7a3b; }
.btn-call:hover { filter: brightness(1.08); }
.btn-wa:hover { background: var(--bg); }

/* ---- Owner sign in ---- */
.signin-wrap { max-width: 460px; margin: 0 auto; padding: 56px 20px; }

.signin-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
}

.signin-box h1 { font-size: 20px; margin: 0 0 10px; }
.signin-box p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.signin-box code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.signin-box label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }

.signin-box input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 14px;
}
.signin-box input[type="password"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.signin-box button { width: 100%; padding: 12px; font-size: 15px; }
.signin-box .error { margin: 12px 0 0; }
.signin-box .error:empty { display: none; }
.signin-out { margin: 18px 0 0 !important; font-size: 13px; }
.signin-out a { color: var(--accent); }

.head-signout {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
}
.head-signout:hover { background: var(--bg); color: var(--text); }

/* The drawing is roughly 1:2, so above a grid of cards it left a half-empty strip
   down each side of itself. Beside them it takes the width it needs and the cards
   take the rest. */
.booking-pick {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}
.booking-pick .pick-grid { margin-bottom: 0; }
@media (max-width: 760px) {
  .booking-pick { grid-template-columns: 1fr; }
}

/* A sortable heading is a button, but it has to read as a heading. */
.th-sort {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.th-sort:hover { color: var(--text); }
.th-sort.on { color: var(--accent); font-weight: 600; }
/* The arrow only appears on the column actually in force, so the header row is not
   a line of competing triangles. */
.th-sort.on[data-dir="asc"]::after { content: '▲'; font-size: 9px; }
.th-sort.on[data-dir="desc"]::after { content: '▼'; font-size: 9px; }

td.cell-made { white-space: nowrap; color: var(--muted); }

/* Rows carry a value and up to four notes. At the old padding a booking covering
   the whole basement ran to five lines and the table read as a wall. */
#bookings-table th, #bookings-table td { padding: 8px 10px; }
#bookings-table .cell-note { line-height: 1.35; }
td.cell-money { white-space: nowrap; }
td.cell-money .cell-note { font-size: 12px; }
td.cell-made .cell-note { font-variant-numeric: tabular-nums; }

/* ---- Rates ---- */
.rates-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 28px;
  align-items: start;
  margin-bottom: 4px;
}

.deposit-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.deposit-box h3 { margin: 0 0 6px; font-size: 16px; }
.deposit-box p { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.deposit-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.deposit-box input {
  width: 100%;
  padding: 9px 11px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.deposit-box .deposit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.deposit-box .error:empty { display: none; }

@media (max-width: 900px) {
  .rates-head { grid-template-columns: 1fr; gap: 18px; }
}

.rate-input {
  width: 110px;
  padding: 7px 9px;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.rate-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rate-persqft { color: var(--muted); font-variant-numeric: tabular-nums; }

#rates-table tfoot td {
  border-top: 2px solid var(--border);
  padding-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* The no-lift warning sits under the item grid, so it needs a little air above it. */
.carry-note { margin-top: 16px; line-height: 1.55; }
.carry-note strong { display: block; margin-bottom: 2px; }

/* ---- Language switch ---- */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.lang-switch button {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.2;
}

.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { background: var(--bg); }
.lang-switch button.on { background: var(--accent); color: #fff; }

/* Devanagari sits taller than Latin, so give the interface a little more room
   rather than letting ि and ी clip. */
html[lang="hi"] .steps li,
html[lang="hi"] .head-call,
html[lang="hi"] .head-wa { line-height: 1.5; }
html[lang="hi"] .qty-label { line-height: 1.45; }

/* ---- Closed days ---- */
.closure-box { margin-bottom: 20px; }

/* A closure that has already been and gone is kept — it is a record of why the
   shutter was down that day — but it should not compete with the ones still to
   come. */
tr.row-past td { opacity: 0.55; }

/* ---- New-booking alerts ---- */
.alert-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.alert-box .intro-line { margin: 0; }
