:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #12141a;
  --muted: #5b6170;
  --brand: #ffb400;
  --border: #e2e5ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.member-only-control.member-only-locked {
  opacity: 0.6;
}

.member-only-locked[data-member-only="job-details"] textarea {
  background: #f1f3f7;
  cursor: not-allowed;
}

.member-only-lock-note {
  margin-top: 4px;
  color: #7a5a00;
  font-size: 0.78rem;
  font-weight: 600;
}

body.modal-open {
  overflow: hidden;
}

.tool-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.tool-header h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a6d00;
  font-weight: 700;
}

.subhead {
  margin: 6px 0 0;
  color: var(--muted);
}

.toolbar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.toolbar-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.toggle {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.toggle select {
  border: 1px solid #cfd4de;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}

#job-select {
  min-width: 220px;
}

.toggle input {
  border: 1px solid #cfd4de;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  min-width: 180px;
}

.toggle textarea {
  border: 1px solid #cfd4de;
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  font: inherit;
  resize: vertical;
  min-height: 72px;
  width: 100%;
  max-width: 100%;
  line-height: 1.35;
}

.toggle--job-details {
  flex: 1 1 100%;
  min-width: 220px;
}

.toggle--fixture-picker {
  flex: 1 1 100%;
  min-width: 280px;
}

.fixture-picker__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fixture-picker__row select {
  min-width: 160px;
  flex: 1 1 auto;
}

#fixture-product {
  min-width: 260px;
  flex: 2 1 280px;
}

.fixture-pick-summary {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfdff;
  max-width: 100%;
}

.fixture-pick-summary__img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.fixture-pick-summary__body {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.fixture-pick-summary__title {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.3;
}

.fixture-pick-summary__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fixture-pick-summary__links a {
  font-weight: 600;
  color: #0b5cab;
}

.fixture-pick-detail-list {
  margin: 6px 0 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}

.fixture-pick-detail-list li {
  margin-bottom: 4px;
}

.fixture-pick-detail-list li strong {
  font-weight: 700;
  color: var(--muted);
  margin-right: 6px;
}

.meta-field {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.meta-field textarea {
  border: 1px solid #cfd4de;
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  resize: vertical;
  min-height: 74px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

/* ── Connected tab chrome (rails + pane share one framed card) ── */

.tabbed {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(18, 20, 28, 0.05);
}

.tabbed__tabs {
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #eaedf5 0%, #dfe5f1 100%);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 4px 0;
  margin: 0;
}

.tab {
  flex: 0 1 auto;
  position: relative;
  padding: 10px 18px calc(11px + 1px);
  margin: 0 2px -1px 0;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 11px 11px 0 0;
  background: rgba(255, 255, 255, 0.22);
  color: #3d4a61;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
  z-index: 0;
}

.tab:hover:not(.is-active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(226, 229, 238, 0.9);
}

.tab:focus-visible {
  outline: none;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(255, 180, 0, 0.42);
}

.tab.is-active {
  z-index: 1;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  border-bottom: 1px solid var(--surface);
  padding-bottom: 11px;
  box-shadow: 0 -2px 0 var(--brand) inset;
}

.tabbed__body {
  padding: 16px;
  background: var(--surface);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
  gap: 14px;
}

.designer-shell {
  display: none;
}

.designer-shell--active {
  display: block;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

input {
  border: 1px solid #cfd4de;
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
}

input:focus-visible {
  outline: 2px solid rgba(255, 180, 0, 0.45);
  outline-offset: 1px;
}

small {
  color: var(--muted);
  font-weight: 500;
}

.ies-upload {
  align-content: start;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#share-view-url {
  flex: 1 1 260px;
  min-width: 0;
}

#copy-share-url-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

button {
  border: 1px solid #d19100;
  background: var(--brand);
  color: #201500;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.ghost {
  border-color: #c9ced8;
  background: #f2f4f8;
  color: #2f3440;
}

button.ghost,
label.ghost {
  border: 1px solid #c9ced8;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.error {
  margin-top: 10px;
  color: #a32d2d;
  font-size: 0.9rem;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
}

.results div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.ies-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ies-summary > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.ies-plot {
  width: 100%;
  max-width: 760px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbff;
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  font-weight: 700;
}

.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.card--interior-results .note--results-hint {
  margin: 0 0 12px;
  max-width: 44em;
  line-height: 1.42;
}

#input-safety-warning {
  margin-top: 6px;
  font-weight: 600;
}

.room3d {
  width: 100%;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f9fbff;
  overflow: hidden;
}

.room3d__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.room3d__inner canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 760px) {
  .room3d {
    height: 320px;
  }

  .meta-field .actions {
    flex-wrap: wrap;
  }

  #share-view-url {
    flex: 1 1 100%;
  }

  #copy-share-url-btn {
    align-self: flex-start;
  }
}

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.5);
  z-index: 9999;
  display: block;
  padding: 16px;
}

.modal__panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 100%);
  max-height: 85vh;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.modal__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--brand);
  cursor: move;
  user-select: none;
}

.modal__titlebar h2 {
  margin: 0;
  font-size: 1.02rem;
  color: #1f1600;
}

.modal__titlebar .ghost {
  border-color: #b88400;
  background: #ffe39a;
  color: #2f2100;
}

.modal__body {
  padding: 14px;
  overflow-y: auto;
  max-height: calc(85vh - 52px);
}

.guidelines {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}
