@font-face { font-family: Figtree; src: url('fonts/Figtree.ttf') format('truetype'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono.ttf') format('truetype'); font-weight: 100 800; font-display: swap; }
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --line: #e3e6ea;
  --line-strong: #cfd4db;
  --ink: #16191d;
  --muted: #5e6570;
  --accent: #0c93e9;
  --accent-text: #076ba8;
  --accent-soft: #e1f1fd;
  --action: #066eaf;
  --action-hover: #055c93;
  --danger: #b4231c;
  --danger-hover: #922b25;
  --on-action: #ffffff;
  --focus: #076ba8;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: Figtree, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page-shell {
  margin: 0;
  max-width: none;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.workspace-root {
  min-height: 100vh;
}

.skip-link {
  left: 16px;
  position: fixed;
  top: 8px;
  transform: translateY(-150%);
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.theme-appbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  min-height: 74px;
  padding: 14px 30px;
}

.wordmark {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 25px;
  font-weight: 800;
  gap: 3px;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.wordmark-dot {
  align-self: flex-end;
  background: var(--accent);
  border-radius: 50%;
  height: 6px;
  margin: 0 0 8px 2px;
  width: 6px;
}

.vsep {
  border-left: 1px solid var(--line);
  height: 26px;
}

.crumb {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 12px;
}

.crumb b {
  color: var(--ink);
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted);
}

.session-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 0 auto;
  white-space: nowrap;
}

.subbar {
  align-items: center;
  background: var(--surface-2);
  display: flex;
  gap: 20px;
  padding: 10px 30px;
}

.stepper {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.step {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  gap: 7px;
  min-height: 34px;
  padding: 6px 14px;
  white-space: nowrap;
}

.step:hover {
  background: var(--surface);
  color: var(--ink);
}

.step.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.step-no {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.step-admin {
  margin-left: 18px;
}

.workspace-layout {
  margin: 0 auto;
  padding: 28px 0 64px;
  width: min(75vw, 1440px);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 20px;
  padding: 24px;
}

.load-panel {
  max-width: 920px;
}

.section-title {
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
}

.no-margin-bottom {
  margin-bottom: 0;
}

label {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}

button,
input,
textarea {
  min-height: 40px;
}

button {
  background: var(--action);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--on-action);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
}

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

button[data-variant="quiet"] {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

button[data-variant="quiet"]:hover {
  background: var(--surface-2);
}

button[data-variant="danger"] {
  background: var(--danger);
}

button[data-variant="danger"]:hover {
  background: var(--danger-hover);
}

button:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

input,
textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.grid {
  display: grid;
  gap: 1rem;
}

.load-form,
.compact-grid {
  gap: 0.7rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.panel > .actions {
  margin-top: 0.35rem;
}

.inline-form {
  margin: 0;
}

.line-items-summary {
  border-top: 1px solid var(--line);
  margin-top: 0.8rem;
  padding-top: 1rem;
}

.line-item-readonly-row,
.line-item-grid {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  padding: 0.8rem;
}

.line-item-title {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 0.4rem;
}

.line-item-readonly-row p {
  margin-bottom: 0.18rem;
}

.line-item-inputs {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.preview-html {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  max-height: 500px;
  overflow: auto;
  padding: 0.9rem;
}

.preview-html table {
  border-collapse: collapse;
  width: 100%;
}

.preview-html td,
.preview-html th {
  border: 1px solid var(--line-strong);
  padding: 0.35rem;
}

.navigation-dialog {
  max-width: 440px;
}

.dialog-title {
  margin-bottom: 0.4rem;
}

.dialog-copy {
  margin-bottom: 0.8rem;
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

@media (max-width: 1100px) {
  .workspace-layout {
    width: calc(100% - 64px);
  }

  .session-note {
    display: none;
  }
}

@media (max-width: 760px) {
  .theme-appbar {
    position: static;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    min-height: 66px;
    padding: 14px 16px;
  }

  .vsep {
    display: none;
  }

  .subbar {
    padding: 8px 16px;
  }

  .stepper {
    gap: 4px;
    overflow-x: auto;
  }

  .step {
    font-size: 12px;
    padding: 6px 9px;
  }

  .step-admin {
    margin-left: 0;
  }

  .workspace-layout {
    margin: 0 16px;
    padding: 24px 0 40px;
    width: auto;
  }

  .panel {
    border-radius: 16px;
    padding: 18px 16px;
  }

  .skip-link {
    left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* D-68: approved light header/tabs and grouped contract editor. */
#contract-read-only, #contract-edit { background: transparent; border: 0; padding: 0; }
#contract-heading, #edit-heading { font-size: 28px; letter-spacing: -.02em; }
.editor-context, #quote-summary { border-bottom: 1px solid var(--line); padding: 12px 0 20px; font-size: 20px; font-weight: 600; color: var(--ink); }
.product-group { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; margin: 20px 0; overflow: hidden; }
.product-group > h2 { font-size: 17px; padding: 21px 24px 15px; margin: 0; border-bottom: 1px solid var(--line); }
.product-line { padding: 18px 24px 20px; }
.product-line + .product-line { border-top: 1px solid var(--line); }
.product-line h3 { font-size: 14px; font-weight: 650; margin-bottom: 14px; }
.product-columns { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(90px, 1fr) minmax(180px, 1.6fr) minmax(95px, 1fr); gap: 14px; align-items: start; }
.product-columns > div, .budget-row > div, .event-row > div { min-width: 0; }
.product-columns p { margin: 4px 0; overflow-wrap: anywhere; font-size: 13px; }
.product-line label, .product-line .field-label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; font-weight: 650; color: var(--muted); display: block; margin: 0 0 5px; }
.product-line input, .product-line select, .product-line textarea { width: 100%; font: inherit; font-size: 13px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 10px; color: var(--ink); background: white; }
.product-line input + label { margin-top: 8px; }
.product-line small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.product-line input:focus-visible, .product-line select:focus-visible, .product-line textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.price-field { text-align: right; font-variant-numeric: tabular-nums; }
.price-field input { text-align: right; }
.budget-row { display: grid; grid-template-columns: 180px minmax(120px, 1fr); gap: 14px; margin-top: 16px; max-width: 500px; }
.budget-value { margin-top: 14px; font-size: 13px; }
.line-extras { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.line-extras summary { color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.line-bullets { margin: 14px 0; }
.line-bullets h4, .event-details h4 { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.line-bullets ul { padding-left: 20px; margin: 6px 0; }
.line-bullets li { margin: 5px 0; font-size: 13px; position: relative; }
.line-bullets li:has(textarea) { display: flex; gap: 6px; align-items: start; }
.line-bullets li:has(textarea)::before { content: '•'; position: absolute; left: -14px; top: 6px; color: var(--muted); }
.bullet-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.bullet-text textarea { flex: 1 1 140px; resize: vertical; background: var(--surface-2); border-color: var(--line); min-height: 34px; line-height: 1.4; }
.bound-value { background: var(--accent-soft); border-radius: 4px; padding: 6px 8px; font-size: 12px; color: var(--accent-text); }
.product-line .icon-button, .product-line .small-add { background: white; color: var(--accent-text); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; min-height: 34px; padding: 5px 9px; }
.product-line .icon-button { min-width: 34px; font-size: 18px; flex: 0 0 auto; }
.product-line .small-add { margin-top: 5px; }
.event-details { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.event-details p { font-size: 13px; }
.event-count { margin-left: 10px; font-weight: 400; }
.event-row { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr auto; gap: 10px; margin: 10px 0; align-items: end; }
.editor-total { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 16px 24px; margin: 4px 0 20px; border-radius: 16px; background: #1d3a5e; color: white; font-size: 14px; }
.editor-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.contract-details { padding: 20px 24px; background: white; border: 1px solid var(--line); border-radius: 20px; margin-top: 20px; }
.contract-details h3 { font-size: 17px; }
.contract-details p { font-size: 13px; }
.loaded-quote-data summary { cursor: pointer; font-weight: 600; }
.loaded-quote-data pre { max-height: 28rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 1050px) { .workspace-layout { width: calc(100% - 48px); } }
@media (max-width: 760px) {
  .workspace-layout { width: auto; margin: 0 16px; }
  .product-group > h2 { padding: 18px 16px 12px; }
  .product-line { padding: 14px 16px 18px; }
  .product-columns { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-columns > div:first-child { grid-column: 1 / -1; }
  .product-columns > div:nth-child(3) { grid-row: 3; grid-column: 1 / -1; }
  .budget-row { grid-template-columns: 1fr 1fr; }
  .event-row { grid-template-columns: 1fr 1fr; }
  .event-row > div:first-child { grid-column: 1 / -1; }
  .event-row > button { justify-self: end; }
  .editor-total, .contract-details { padding: 16px; }
}
@media (pointer: coarse) { .product-line button, .product-line input, .product-line select, .product-line textarea { min-height: 44px; } }

/* Guided hierarchy follows the captured block for this quote. */
.line-section.depth-1 { margin-inline-start: 12px; }
.line-section.depth-2 { margin-inline-start: 24px; }
.line-section.depth-3 { margin-inline-start: 36px; }
.line-section.depth-4 { margin-inline-start: 48px; }
.line-section h4 { margin: 12px 0 6px; }
.line-section p { white-space: pre-wrap; overflow-wrap: anywhere; }

#contract-contacts p { white-space: pre-line; overflow-wrap: anywhere; }
