:root {
  --canvas: #f1f5ef;
  --ink: #18211f;
  --muted: #5e6c68;
  --line: #c4d0c9;
  --surface: #ffffff;
  --leaf: #167560;
  --leaf-dark: #075142;
  --leaf-pale: #d7f1df;
  --sun: #e8b655;
  --coral: #c95a49;
  --shadow: rgba(15, 34, 28, 0.1);
}

* { box-sizing: border-box; }

html { background: var(--canvas); scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(22, 117, 96, 0.06) 1px, transparent 1px), var(--canvas);
  background-size: 32px 32px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.site-header, main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.wordmark { color: var(--ink); font-size: 1rem; font-weight: 800; letter-spacing: 0; text-decoration: none; }
.header-date { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }

.intro { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: clamp(36px, 8vw, 120px); align-items: end; padding: clamp(64px, 10vw, 128px) 0 72px; }
.eyebrow { margin: 0 0 10px; color: var(--leaf); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 12ch; margin-bottom: 24px; font-size: clamp(3rem, 7vw, 5.7rem); line-height: 0.96; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.08; letter-spacing: 0; }
h3 { margin: 0; font-size: 1rem; line-height: 1.25; }
.intro-copy { max-width: 52ch; margin-bottom: 0; color: var(--muted); font-size: 1.08rem; }

.duration-panel { padding: 28px; border: 1px solid var(--ink); border-radius: 8px; background: var(--leaf-pale); box-shadow: 8px 8px 0 var(--ink); }
.duration-total { display: block; margin: 6px 0; font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1; }
.duration-detail { min-height: 48px; margin-bottom: 18px; color: var(--muted); font-size: 0.9rem; }
.duration-scale { height: 8px; overflow: hidden; border-radius: 99px; background: #b2d4bd; }
.duration-scale span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--leaf); transition: width 200ms ease, background 200ms ease; }
.duration-scale span.is-over { background: var(--coral); }
.duration-range { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 0.73rem; font-weight: 750; }

.builder-section { padding: 48px 0 56px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 12px; }
.section-note, .section-copy { color: var(--muted); }
.section-note { max-width: 30ch; margin: 0; font-size: 0.86rem; font-weight: 700; text-align: right; }
.section-copy { max-width: 66ch; margin-bottom: 28px; }
.catalog-status { margin: 0 0 20px; padding: 12px 14px; border-left: 3px solid var(--sun); color: var(--muted); background: #fff7df; font-size: 0.9rem; }
.is-hidden { display: none; }

.course-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.course-option { display: flex; min-height: 178px; flex-direction: column; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.course-option:hover { border-color: var(--leaf); box-shadow: 3px 3px 0 var(--leaf); transform: translate(-1px, -1px); }
.course-option.is-selected { border-color: var(--leaf); background: #ecfaf1; }
.course-day { margin-bottom: 9px; color: var(--leaf); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.course-meta { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; }
.course-button, .request-button { min-height: 42px; border: 1px solid var(--ink); border-radius: 5px; font-weight: 800; transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.course-button { width: max-content; padding: 0 13px; color: var(--ink); background: transparent; }
.course-option.is-selected .course-button, .request-button { color: #fff; background: var(--leaf-dark); }
.course-button:hover:not(:disabled), .request-button:hover:not(:disabled) { box-shadow: 3px 3px 0 var(--sun); transform: translate(-1px, -1px); }

.source-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr); gap: clamp(32px, 6vw, 84px); }
.workspace-label { margin-bottom: 16px; color: var(--muted); font-size: 0.77rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.source-library { display: grid; gap: 22px; }
.source-group h3 { margin-bottom: 9px; color: var(--muted); font-size: 0.85rem; }
.available-sources { display: flex; flex-wrap: wrap; gap: 8px; }
.available-source { display: flex; align-items: center; gap: 14px; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 0.86rem; font-weight: 700; transition: background 150ms ease, border-color 150ms ease; }
.available-source span:last-child { color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.available-source:hover, .available-source.is-selected { border-color: var(--leaf); background: var(--leaf-pale); }
.available-source.is-selected::before { content: "✓"; color: var(--leaf-dark); font-weight: 900; }

.selected-column { position: sticky; top: 20px; align-self: start; min-width: 0; padding: 22px; border: 1px solid var(--ink); border-radius: 8px; background: var(--surface); }
.selected-sources { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.selected-source { display: grid; grid-template-columns: 17px 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; min-height: 48px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 0.87rem; }
.selected-source.is-dragging { opacity: 0.45; }
.drag-handle { color: var(--muted); cursor: grab; font-size: 1rem; transform: rotate(90deg); }
.source-order { color: var(--leaf); font-size: 0.74rem; font-weight: 850; }
.selected-source-title { overflow: hidden; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.selected-source-duration { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }
.source-actions { display: flex; gap: 3px; }
.source-actions button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; border: 0; border-radius: 3px; color: var(--muted); background: transparent; }
.source-actions button:hover:not(:disabled) { color: var(--ink); background: var(--leaf-pale); }
.empty-order { margin: 28px 0 8px; color: var(--muted); font-size: 0.9rem; text-align: center; }

.delivery-section { padding-bottom: 100px; }
.delivery-grid { display: grid; grid-template-columns: minmax(190px, 0.65fr) minmax(260px, 1fr) auto; gap: 14px; align-items: end; }
.field-label { display: grid; gap: 7px; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.field-label input, .field-label select { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); }
.request-button { padding: 0 18px; white-space: nowrap; }
.form-message { min-height: 24px; margin: 16px 0 0; color: var(--leaf-dark); font-size: 0.9rem; font-weight: 700; }

@media (max-width: 840px) {
  .intro, .source-workspace { grid-template-columns: 1fr; }
  .intro { gap: 40px; padding-bottom: 56px; }
  .duration-panel { max-width: 480px; }
  .course-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delivery-grid { grid-template-columns: 1fr 1fr; }
  .request-button { grid-column: 1 / -1; }
  .selected-column { position: static; }
}

@media (max-width: 560px) {
  .site-header, main { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 70px; }
  .header-date { font-size: 0.76rem; }
  h1 { font-size: clamp(2.7rem, 16vw, 4rem); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-note { text-align: left; }
  .course-options, .delivery-grid { grid-template-columns: 1fr; }
  .course-option { min-height: 150px; }
  .selected-source { grid-template-columns: 15px 24px minmax(0, 1fr) auto; }
  .selected-source-duration { display: none; }
  .source-actions { grid-column: 4; }
}