.queue-planner-section {
  --qp-ink: #243b31;
  --qp-accent: #9b481d;
  --qp-line: #d8dfd3;
  --qp-muted: #52665a;
  padding: clamp(44px, 6vw, 80px) 0;
  border-bottom: 1px solid var(--qp-line);
  background: #f7f8f4;
}
.queue-planner-section [hidden] { display: none !important; }
.queue-planner-heading { margin-bottom: clamp(20px, 3vw, 32px); }
.queue-planner-heading h2 {
  margin: 0;
  color: var(--qp-ink);
  font-family: var(--font-serif);
  font-size: clamp(29px, 4vw, 49px);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -.025em;
}
.queue-planner-heading p { margin: 9px 0 0; color: var(--qp-muted); font-size: 14px; }

.queue-planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 2vw, 25px);
}
.queue-planner-form {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--qp-line);
  border-radius: 18px;
  background: #fff;
}
.queue-planner-field { min-width: 0; display: grid; align-content: start; gap: 7px; }
.queue-planner-field > label,
.queue-planner-field > span:not(.queue-field-hint,.queue-field-error),
.queue-fulfillment legend { color: var(--qp-ink); font-size: 13px; font-weight: 650; }
.queue-planner-field input:not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 9px 13px;
  border: 1px solid var(--qp-line);
  border-radius: 8px;
  background: #fff;
  color: var(--qp-ink);
  font: 16px var(--font-body);
  font-variant-numeric: tabular-nums;
}
.queue-planner-field input::placeholder { color: #68796e; }
.queue-planner-section :focus-visible { outline: 2px solid #ac5a2c; outline-offset: 3px; }
.queue-planner-section [aria-invalid="true"] { border-color: #ad4437; }
.queue-field-hint, .queue-field-error { display: block; margin: 0; font-size: 12px; line-height: 1.5; }
.queue-field-hint { color: var(--qp-muted); }
.queue-field-error { color: #a63c35; }

.queue-quantity-field, .queue-planner-group-fulfillment, .queue-planner-footer { grid-column: 1 / -1; }
.queue-quantity-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.queue-unit-options {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--qp-line);
  border-radius: 9px;
  background: #f3f5ef;
}
.queue-unit-options button {
  min-height: 41px;
  padding-inline: 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--qp-muted);
  cursor: pointer;
  font: 650 12px var(--font-body);
  white-space: nowrap;
}
.queue-unit-options button[aria-pressed="true"] {
  background: #e2ebdf;
  color: #203c2e;
  box-shadow: inset 0 0 0 1px #bbccba;
}
.queue-unit-options button:disabled { color: #68716b; background: #edf0eb; opacity: .66; cursor: default; }

.queue-planner-group-fulfillment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px 20px;
  padding-top: 16px;
  border-top: 1px solid #e7ebe4;
}
.queue-planner-group-fulfillment:has(.queue-delivery-fields[hidden]) { grid-template-columns: 1fr; }
.queue-fulfillment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.queue-fulfillment legend { padding: 0; margin-bottom: 7px; }
.queue-fulfillment label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 47px;
  padding: 7px 5px;
  border: 1px solid var(--qp-line);
  border-radius: 8px;
  color: var(--qp-ink);
  cursor: pointer;
  text-align: center;
}
.queue-fulfillment input { position: absolute; opacity: 0; }
.queue-fulfillment label span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.queue-fulfillment label i { color: #627b68; font-size: 12px; }
.queue-fulfillment label:has(input:checked) { border-color: #8aab90; background: #edf4e9; }
.queue-fulfillment label:has(input:checked) i { color: #326343; }
.queue-fulfillment label:has(input:focus-visible) { outline: 2px solid #ac5a2c; outline-offset: 3px; }

.queue-planner-footer { display: grid; gap: 8px; }
.queue-planner-submit.button {
  width: 100%;
  min-height: 51px;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--qp-accent);
  border-radius: 9px;
  background: var(--qp-accent);
  color: white;
  font: 650 14px var(--font-body);
  letter-spacing: 0;
}
.queue-planner-submit.button:hover { background: #803914; border-color: #803914; }
.queue-planner-submit:disabled { opacity: .7; cursor: wait; }
.queue-planner-disclaimer { margin: 0; color: var(--qp-muted); font-size: 12px; }

.queue-planner-result {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 370px;
  padding: clamp(21px, 3vw, 34px);
  border-radius: 18px;
  background: #223a30;
  color: #f9faf7;
  scroll-margin-top: calc(var(--masthead-height, 70px) + 60px);
}
.queue-planner-result > h3 { margin: 0; font-size: 15px; font-weight: 650; }
.queue-result-placeholder {
  flex: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  align-content: center;
  gap: 13px;
  min-height: 83px;
  margin-top: 12px;
}
.queue-result-placeholder > i {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #678376;
  border-radius: 10px;
  color: #f3bf91;
  font-size: 18px;
}
.queue-result-placeholder p { display: grid; gap: 3px; margin: 0; }
.queue-result-placeholder strong { font-size: 16px; font-weight: 650; }
.queue-result-placeholder span { color: #cad9ce; font-size: 13px; }
.queue-result-content { margin-top: 17px; }
.queue-result-status {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 15px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #dcebda;
  color: #213d2d;
  font-size: 12px;
  font-weight: 700;
}
.queue-planner-result[data-state="tight"] .queue-result-status { background: #ffe7bb; color: #684310; }
.queue-planner-result:is([data-state="urgent"],[data-state="unavailable"]) .queue-result-status { background: #ffd9cd; color: #792c20; }
.queue-result-deadline > p:first-child, .queue-result-target { margin: 0 0 5px; color: #cad9ce; font-size: 12px; }
.queue-result-target strong { color: white; }
.queue-result-date {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(25px, 3.2vw, 43px);
  font-weight: 600;
  line-height: 1.23;
  font-variant-numeric: tabular-nums;
}
.queue-result-cutoff { display: flex; align-items: baseline; gap: 7px; margin: 8px 0 0; color: #f5c397; font-size: 13px; }
.queue-result-message { margin: 12px 0 0; color: #dce7de; font-size: 13px; line-height: 1.65; }
.queue-result-timeline { margin: 17px 0 0; padding: 0; list-style: none; }
.queue-result-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  gap: 6px 10px;
  padding: 10px 0 10px 14px;
  border-bottom: 1px solid #496155;
  font-size: 13px;
}
.queue-result-timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f0b98a;
}
.queue-result-timeline li > span, .queue-result-timeline small { color: #c4d5c9; }
.queue-result-timeline li > div { display: grid; gap: 2px; text-align: right; }
.queue-result-timeline strong { font-weight: 650; }
.queue-result-timeline small { font-size: 11px; }

.queue-result-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 18px; }
.queue-result-actions a, .queue-result-actions button, .queue-result-error button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid #87a393;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font: 600 12px var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.queue-result-actions button, .queue-result-error button { background: #ecf4e9; border-color: #ecf4e9; color: var(--qp-ink); }
.queue-result-actions a:hover { background: #344f41; }
.queue-planner-result :focus-visible { outline-color: #f4c098; }
.queue-result-error { align-self: start; margin-top: 16px; font-size: 14px; }
.queue-result-error p { margin: 0 0 8px; }

@media (max-width: 760px) {
  .queue-planner-layout { grid-template-columns: 1fr; }
  .queue-planner-result { min-height: 0; }
  .queue-planner-result[data-state="idle"] { min-height: 132px; }
}
@media (max-width: 540px) {
  .queue-planner-form, .queue-planner-group-fulfillment { grid-template-columns: 1fr; }
  .queue-planner-form { gap: 14px; padding: 17px; }
  .queue-planner-group-fulfillment { gap: 12px; padding-top: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .queue-fulfillment label, .queue-unit-options button, .queue-planner-submit.button { transition: background-color .14s, border-color .14s; }
  .queue-result-content:not([hidden]) { animation: queue-result-enter .16s ease-out both; }
  @keyframes queue-result-enter { from { opacity: .82; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
