* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  background: #f9f9f9;
  color: #222;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  flex-shrink: 0;
  background: #1557b0;
  padding: 8px 10px;
  gap: 6px;
  align-items: center;
}

.tab-btn {
  flex: 1;
  padding: 6px 4px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.tab-btn.active {
  background: #fff;
  color: #1a73e8;
}

.tab-settings {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  opacity: 0.75;
  flex-shrink: 0;
  transition: opacity 0.15s;
  margin-left: auto;
  line-height: 1;
}

.tab-settings:hover { opacity: 1; }

/* ── Section visibility ── */
.section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Rationale section scrolls as a whole so nothing is hidden on small screens */
#section-rationale {
  overflow-y: auto;
  display: block;
}

.hidden { display: none !important; }

/* ── Rationale: phrase list ── */
.phrase-list {
  /* No longer needs to be a flex-growing scroll area — parent scrolls instead */
  overflow-y: visible;
  padding: 6px 0;
  border-bottom: 1px solid #e0e0e0;
}

.phrase-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 4px;
  margin: 0 4px;
  transition: background 0.1s;
}

.phrase-item:hover { background: #e8f0fe; }

/* Key decision rows/sections the surveyor must actively choose on every
   valuation — leasehold terms, GR & SC, EWS1, plus the quick-fill, opinion of
   value and market direction. Light-blue background to draw the eye. */
.phrase-item--key { background: #d3e8ff; }
.phrase-item--key:hover { background: #c2ddff; }
.rf-panel.key-highlight,
.mv-bar.key-highlight { background: #d3e8ff; }

.phrase-quick-insert {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  background: #fff;
  color: #666;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.phrase-quick-insert:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

.phrase-item input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: #1a73e8;
  cursor: pointer;
}

.phrase-item label {
  line-height: 1.4;
  cursor: pointer;
  word-break: break-word;
}

/* ── Shared: preview ── */
.preview-section {
  flex-shrink: 0;
  padding: 8px 14px 6px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
}

.preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.clear-btn {
  font-size: 11px;
  color: #1a73e8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.clear-btn:hover { text-decoration: underline; }

.reset-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 500;
  color: #c0392b;
  background: none;
  border: 1px solid #c0392b;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.reset-btn:hover { background: #fdf0ee; }

.preview-box {
  min-height: 48px;
  max-height: 100px;
  overflow-y: auto;
  background: #f1f3f4;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-box:empty::before {
  content: "Fill in fields above to preview…";
  color: #aaa;
  font-style: italic;
}

/* ── Shared: buttons ── */
.insert-btn {
  flex-shrink: 0;
  margin: 8px 14px;
  padding: 9px 0;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.insert-btn:hover:not(:disabled) { background: #1557b0; }

.insert-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Shared: status ── */
.status {
  flex-shrink: 0;
  min-height: 18px;
  padding: 0 14px 6px;
  font-size: 11px;
  text-align: center;
}

.status.success { color: #1e8e3e; }
.status.error   { color: #d93025; }

/* ── Market value bar (Rationale) ── */
.mv-bar {
  flex-shrink: 0;
  padding: 8px 14px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mv-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  flex-shrink: 0;
}

.mv-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mv-prefix {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.mv-input {
  width: 100px;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  text-align: right;
  transition: border-color 0.15s;
}

.mv-input:focus { border-color: #1a73e8; }

.dir-bar { padding: 6px 14px; }

.dir-btn-group {
  display: flex;
  gap: 5px;
}

.dir-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f5f5f5;
  color: #555;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.dir-btn:hover { background: #e8e8e8; border-color: #bbb; }

.dir-btn.active {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

/* ── Comparable Phrases ── */
.comp-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comp-field-group {
  padding: 10px 14px 6px;
  border-bottom: 1px solid #f0f0f0;
}

.comp-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 5px;
}

.comp-text-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}

.comp-text-input:focus { border-color: #1a73e8; }

/* Free-text input inside adj blocks */
.adj-custom-input {
  margin-top: 7px;
  font-size: 12px;
}

/* Adj blocks (Better / Worse) */
.comp-adj-block {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.comp-adj-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.similar-header { color: #888; }
.better-header  { color: #1e8e3e; }
.worse-header   { color: #d93025; }

.size-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.size-source-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fafafa;
  color: #333;
  cursor: pointer;
  margin-left: auto;
}

.comp-adj-header::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.similar-header::before { background: #aaa; }
.better-header::before  { background: #1e8e3e; }
.worse-header::before   { background: #d93025; }

.comp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 4px 10px;
  border-radius: 14px;
  border: 1.5px solid #ddd;
  background: #fff;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  color: #444;
  line-height: 1.3;
}

.chip:hover { border-color: #aaa; background: #f5f5f5; }

.chip.active[data-group="similar"] {
  background: #f0f0f0;
  border-color: #888;
  color: #444;
  font-weight: 600;
}

.chip.active[data-group="better"] {
  background: #e6f4ea;
  border-color: #1e8e3e;
  color: #1e8e3e;
  font-weight: 600;
}

.chip.active[data-group="worse"] {
  background: #fce8e6;
  border-color: #d93025;
  color: #d93025;
  font-weight: 600;
}

/* Range row */
.range-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-prefix, .range-sep {
  font-size: 12px;
  color: #555;
  flex-shrink: 0;
}

.range-input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}

.range-input:focus { border-color: #1a73e8; }

/* Add-ons */
.addon-block {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.addon-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 6px;
}

.addon-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
  color: #333;
}

.addon-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: #1a73e8;
  cursor: pointer;
}

/* ── Lease calculator ── */
.calc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Help section ── */
.help-block { display: flex; flex-direction: column; gap: 8px; }
.help-block + .help-block { margin-top: 4px; padding-top: 14px; border-top: 1px solid #e6e6e6; }
.help-title { font-size: 13px; font-weight: 800; color: #1557b0; }
.help-sub { font-size: 11px; color: #666; margin-top: -4px; }
.help-action {
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #1557b0;
  background: #eaf1fd;
  border: 1px solid #cfe0fb;
  border-radius: 7px;
  cursor: pointer;
}
.help-action:hover { background: #dce8fc; }
.help-note { font-size: 11px; color: #888; line-height: 1.5; }
.help-guide,
.help-contact {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px;
  background: #fff; text-decoration: none; color: #222;
  transition: background 0.12s, border-color 0.12s;
}
.help-guide:hover,
.help-contact:hover { background: #f2f7ff; border-color: #bcd6f7; }
.help-guide__icon,
.help-contact__icon {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #1a73e8; color: #fff; font-size: 13px;
}
.help-guide__text,
.help-contact__text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.help-guide__text b,
.help-contact__text b { font-size: 12.5px; font-weight: 700; }
.help-guide__text small,
.help-contact__text small { font-size: 11px; color: #666; }
.help-guide__badge {
  flex-shrink: 0; font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: #8a6d1a; background: #fdf1d6;
  border-radius: 999px; padding: 3px 8px;
}
.help-guide.coming-soon { cursor: default; }
.help-guide.coming-soon:hover { background: #fff; border-color: #e0e0e0; }
.help-guide.coming-soon .help-guide__icon { background: #b9c6d6; }
.help-contact--wa .help-contact__icon { background: #25d366; }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
}

.field-group input {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}

.field-group input:focus { border-color: #1a73e8; }

.hmlr-paste-row {
  padding: 8px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Process this comp ── */
#comp-process-block {
  margin-bottom: 12px;
}
.comp-process-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: #1a73e8;
  border: none;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.comp-process-btn:hover:not(:disabled) { background: #1666cc; }
.comp-process-btn:disabled {
  background: #c6d4e8;
  color: #f0f4fb;
  cursor: default;
}
.comp-process-btn.running {
  background: #8ab0ec;
  cursor: progress;
}
.comp-process-log {
  margin-top: 6px;
  max-height: 52px;   /* ~3 lines — newest at the bottom, scroll up for the rest */
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.45;
}
.comp-process-log:empty { margin-top: 0; }
.comp-progress { margin-top: 8px; }
.comp-progress[hidden] { display: none; }
.comp-progress-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #3c4a5e; margin-bottom: 3px; }
.comp-progress-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#comp-progress-pct { font-weight: 700; flex-shrink: 0; }
.comp-progress-track { height: 6px; border-radius: 3px; background: #c9d8f2; overflow: hidden; }
.comp-progress-fill { height: 100%; width: 0; border-radius: 3px; background: #1a73e8; transition: width 0.4s ease; }
.comp-progress.running .comp-progress-fill {
  background-image: linear-gradient(45deg, rgba(255,255,255,.3) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.3) 75%, transparent 75%);
  background-size: 12px 12px;
  animation: lookup-stripes 0.8s linear infinite;
}
.comp-progress.done .comp-progress-fill { background: #1e8e3e; }
.comp-progress.stopped .comp-progress-fill { background: #e08a2b; }
.proc-line { color: #555; padding: 1px 0; }
.proc-line--ok   { color: #1e8e3e; }
.proc-line--warn { color: #d93025; }

/* ── Licence gate ── */
.licence-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(240, 243, 248, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.licence-gate.hidden { display: none; }
.licence-card {
  position: relative;
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  padding: 24px 22px;
  text-align: center;
}
/* Close button — only shown when the gate is opened as a preview (Help tab) */
.licence-gate-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #9aa4b2;
  cursor: pointer;
  border-radius: 6px;
}
.licence-gate-close:hover { background: #f0f2f5; color: #555; }
.licence-gate-close.hidden { display: none; }
.licence-logo {
  font-size: 15px;
  font-weight: 800;
  color: #1a73e8;
  letter-spacing: 0.01em;
}
.licence-title {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #10304f;
}
.licence-blurb {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}
.licence-input {
  width: 100%;
  margin-top: 16px;
  padding: 9px 11px;
  border: 1px solid #ccd3dd;
  border-radius: 7px;
  font-size: 13px;
  font-family: monospace;
  outline: none;
  transition: border-color 0.15s;
}
.licence-input:focus { border-color: #1a73e8; }
.licence-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #1a73e8;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.licence-btn:hover:not(:disabled) { background: #1666cc; }
.licence-btn:disabled { background: #9cc0f2; cursor: progress; }
.licence-status {
  margin-top: 10px;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.4;
}
.licence-status.ok   { color: #1e8e3e; }
.licence-status.err  { color: #d93025; }
.licence-foot {
  margin-top: 14px;
  font-size: 11px;
  color: #888;
}
.licence-foot a { color: #1a73e8; text-decoration: none; }
.licence-foot a:hover { text-decoration: underline; }
/* "New to SCTAssist?" free-trial CTA on the gate */
.licence-alt {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eceff3;
}
.licence-alt-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}
.licence-cta {
  display: block;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #1a73e8;
  background: #eaf1fd;
  border: 1px solid #cfe0fb;
  border-radius: 7px;
  text-decoration: none;
}
.licence-cta:hover { background: #dce8fc; }
.licence-contact {
  margin-top: 14px;
  font-size: 11px;
  color: #888;
}
.licence-contact a { color: #1a73e8; text-decoration: none; }
.licence-contact a:hover { text-decoration: underline; }

.addon-header-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a73e8;
  background: none;
  border: 1px solid #1a73e8;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  align-self: flex-start;
}
.addon-header-btn:hover { background: #e8f0fe; }

.hmlr-paste-result {
  font-size: 11px;
  color: #1e8e3e;
  min-height: 14px;
}

.hmlr-paste-result.warn { color: #d93025; }

.hmlr-banner {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  background: #fff3cd;
  border: 1px solid #f0ad4e;
  color: #7a5800;
}

.hmlr-banner.mismatch {
  background: #fdecea;
  border-color: #e53935;
  color: #b71c1c;
}

.hmlr-banner.match {
  background: #e6f4ea;
  border-color: #34a853;
  color: #1e5c2e;
}

.lease-result {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}

.result-row:last-child { border-bottom: none; }

.result-label { font-size: 12px; color: #666; flex-shrink: 0; }

.result-value { font-size: 13px; font-weight: 600; color: #222; text-align: right; }

.result-value.highlight { color: #1a73e8; font-size: 15px; }

/* ── Footer ── */
.app-footer {
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  color: #aaa;
  padding: 5px 14px 6px;
  border-top: 1px solid #ececec;
  background: #fafafa;
  letter-spacing: 0.01em;
}

/* ── Rationale quick-fill ── */
.rf-panel {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px 6px;
  margin: 6px 0 8px;
  background: #fafafa;
}

.rf-header {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.rf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.rf-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  width: 54px;
  flex-shrink: 0;
}

.rf-select,
.rf-input {
  flex: 1;
  font-size: 12px;
  padding: 4px 7px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
}

.rf-select:focus,
.rf-input:focus {
  outline: none;
  border-color: #1a73e8;
}

/* ── Comp addon detail panels ── */
.addon-item-wrap {
  margin-bottom: 2px;
}

.addon-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.addon-label-row .addon-item {
  flex: 1;
}

.addon-quick-insert {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  background: #fff;
  color: #666;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 4px;
  padding: 0;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.addon-quick-insert:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

.addon-detail {
  margin: 3px 0 6px 22px;
  padding: 7px 9px;
  background: #f4f6fb;
  border-left: 3px solid #1a73e8;
  border-radius: 0 6px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.detail-label {
  font-size: 11px;
  color: #555;
  width: 82px;
  flex-shrink: 0;
}

.detail-num {
  width: 80px;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.detail-num:focus {
  outline: none;
  border-color: #1a73e8;
}

.detail-half {
  width: 90px;
}

.detail-date {
  flex: 1;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.detail-date:focus {
  outline: none;
  border-color: #1a73e8;
}

/* ── EPC auto-detect ── */
.epc-rating-input {
  width: 48px;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.epc-detect-btn {
  margin-left: 8px;
  padding: 3px 9px;
  font-size: 11px;
  background: #f0f0f0;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}

.epc-detect-btn:hover {
  background: #e0eaff;
  border-color: #1a73e8;
  color: #1a73e8;
}

.epc-detect-status {
  font-size: 11px;
  color: #888;
  padding: 2px 0 0 0;
  min-height: 16px;
}

.detail-select {
  flex: 1;
  min-width: 0;      /* allow the select to shrink to the pane so the arrow stays visible */
  max-width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fff;
}

.detail-select:focus {
  outline: none;
  border-color: #1a73e8;
}

.detail-or {
  font-size: 10px;
  color: #999;
  font-style: italic;
}

/* ── Route Calculator ── */
.route-hint {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
  line-height: 1.4;
}

.route-postcode-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.route-postcode-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-postcode-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.route-postcode-input:focus {
  outline: none;
  border-color: #1a73e8;
}

.btn-add-postcode {
  background: none;
  border: 1px dashed #bbb;
  border-radius: 6px;
  color: #666;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  width: 100%;
  margin-top: 2px;
  margin-bottom: 10px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-add-postcode:hover {
  border-color: #1a73e8;
  color: #1a73e8;
}

.route-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.route-results {
  border-top: 1px solid #ececec;
  padding-top: 10px;
  margin-top: 4px;
}

.route-leg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}

.route-leg-label {
  color: #444;
}

.route-leg-miles {
  font-weight: 600;
  color: #1a73e8;
  white-space: nowrap;
  margin-left: 8px;
}

.route-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 2px;
  font-size: 13px;
}

.route-total-label {
  font-weight: 600;
  color: #222;
}

.route-total-value {
  font-size: 15px;
  font-weight: 700;
  color: #1a73e8;
}

.route-postcode-summary-label {
  font-size: 10px;
  color: #999;
  margin-top: 10px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.route-postcode-summary {
  font-size: 11px;
  color: #444;
  background: #f4f6fb;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 5px 8px;
  cursor: pointer;
  word-break: break-all;
  transition: background 0.12s;
}

.route-postcode-summary:hover {
  background: #e8f0fe;
  color: #1a73e8;
}

/* ── Cladding Tab ── */
.cladding-warning {
  background: #fff3cd;
  border: 1px solid #f0c040;
  color: #7a5c00;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.cladding-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cladding-file-label {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.cladding-file-btn {
  background: #4a6fa5;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.cladding-file-btn:hover { background: #3a5a8a; }

.cladding-file-name {
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.cladding-search-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.cladding-postcode-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
}
.cladding-postcode-input:focus { outline: none; border-color: #4a6fa5; }

/* Result card */
.cladding-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.cladding-card-header {
  background: #4a6fa5;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
}

.cladding-card-body {
  padding: 8px 12px;
}

.cladding-row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  align-items: start;
}
.cladding-row:last-child { border-bottom: none; }

/* Most recent HMLR (Land Registry) sale — the strongest comp evidence. */
.cladding-row--hmlr {
  margin: 0 -12px;
  padding: 4px 12px 4px 9px;
  background: #e8f1fb;
  border-left: 3px solid #2f6fb0;
  border-bottom-color: #d3e4f5;
}
.cladding-row--hmlr .cladding-key { color: #1c4e80; }

.cladding-key {
  font-weight: 600;
  color: #555;
  word-break: break-word;
}

.cladding-val {
  color: #222;
  word-break: break-word;
}

.cladding-val.lend-yes  { color: #2a7a2a; font-weight: 600; }
.cladding-val.lend-no   { color: #c0392b; font-weight: 600; }
.cladding-val.lend-cond { color: #b07000; font-weight: 600; }

.cladding-section-divider {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4a6fa5;
  padding: 6px 0 2px;
}

.cladding-no-result {
  text-align: center;
  color: #888;
  font-size: 12px;
  padding: 16px 0;
}

/* ── Subject Lookup: Look up card + progress bar ── */
.lookup-card {
  border: 1px solid #c5d9f7;
  border-radius: 8px;
  background: #e8f0fe;
  padding: 10px;
  margin: 2px 0 12px;
}
.lookup-card-title { font-size: 13px; font-weight: 700; color: #1a3a6b; margin-bottom: 4px; }
.lookup-card-hint { font-size: 11px; color: #3c4a5e; margin: 0 0 8px; line-height: 1.4; }
.lookup-progress { margin-top: 10px; }
.lookup-progress-track { height: 6px; border-radius: 3px; background: #c9d8f2; overflow: hidden; }
.lookup-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: #1a73e8;
  transition: width 0.4s ease;
}
.lookup-progress.running .lookup-progress-fill {
  background-image: linear-gradient(45deg, rgba(255,255,255,.3) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.3) 75%, transparent 75%);
  background-size: 12px 12px;
  animation: lookup-stripes 0.8s linear infinite;
}
.lookup-progress.done .lookup-progress-fill { background: #1e8e3e; }
.lookup-progress.error .lookup-progress-fill { background: #d93025; }
@keyframes lookup-stripes { to { background-position: 12px 0; } }
#epc-lookup-status { font-size: 12px; font-weight: 600; min-height: 0; }

/* ── Today board launcher (today.html / today-runner.js) ── */
.today-open-btn { width: 100%; margin: 0 0 8px; padding: 7px 0; background: #fff; color: #1a73e8; border: 1px solid #1a73e8; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.today-open-btn:hover { background: #e8f0fe; }
.today-run-status { font-size: 11px; color: #1a56c4; background: #e8f0fe; border-radius: 5px; padding: 4px 6px; margin: -4px 0 8px; }
