:root {
  --page: #241f2a;
  --page-deep: #15131a;
  --card: #302b35;
  --card-dark: #211e27;
  --line: #61586a;
  --line-bright: #dfbd70;
  --text: #faf2de;
  --muted: #d2c8d8;
  --accent: #e2bf72;
  --purple: #4b3673;
  --green: #77a76a;
  --red: #b86f4f;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 50% 0, rgba(226, 191, 114, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 8%, rgba(143, 101, 216, 0.2), transparent 22rem),
    linear-gradient(180deg, var(--page) 0%, var(--page-deep) 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.tool-header {
  align-items: center;
  border-bottom: 1px solid rgba(226, 191, 114, 0.18);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 16px 20px;
}

.tool-brand,
.tool-header nav {
  align-items: center;
  display: flex;
}

.tool-brand {
  gap: 10px;
  font-weight: 900;
}

.tool-brand img {
  height: 38px;
  width: 38px;
}

.tool-header nav {
  background: rgba(24, 21, 30, 0.78);
  border: 1px solid rgba(226, 191, 114, 0.24);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
}

.tool-header nav a {
  border-radius: 6px;
  color: #dddddd;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
}

.tool-header nav a:hover {
  background: #3b3347;
  color: #ffffff;
}

.tool-header nav a.discord-button {
  background: #5865f2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

main {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px 20px 42px;
}

.town-hero,
.town-toolbar,
.quick-add-panel,
.summary-panel,
.summary-grid article,
.planner-panel,
.result-panel {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.town-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 145px;
  overflow: hidden;
  padding: 22px 26px;
}

.town-hero > div {
  max-width: 760px;
}

.town-hero img {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35));
  height: 112px;
  object-fit: contain;
  width: 112px;
}

.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

h1 {
  color: var(--accent);
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1;
  margin-bottom: 12px;
  text-shadow: 2px 2px 0 #171717;
}

h2 {
  color: var(--accent);
  font-size: 25px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.town-hero p,
.section-heading p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 0;
}

.town-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.mode-toggle {
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  margin-right: auto;
  padding: 3px;
}

.mode-toggle button,
.primary-button,
.quiet-button {
  border-radius: 6px;
  font-weight: 900;
  min-height: 40px;
  padding: 0 14px;
}

.mode-toggle button {
  background: transparent;
  border: 0;
  color: var(--muted);
}

.quick-add-panel {
  overflow: visible;
}

.quick-add-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  padding: 14px 14px 8px;
}

.quick-add-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 5px;
}

.quick-add-form select,
.quick-add-form input {
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 42px;
  min-width: 0;
  padding: 7px 9px;
  width: 100%;
}

.quick-add-form .primary-button {
  min-height: 42px;
}

.quick-add-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 0;
  padding: 0 14px 14px;
}

.mode-toggle button.active {
  background: var(--accent);
  color: #241f2a;
}

.primary-button {
  background: var(--purple);
  border: 1px solid rgba(226, 191, 114, 0.36);
  color: #ffffff;
}

.quiet-button {
  background: var(--card-dark);
  border: 1px solid var(--line);
  color: var(--muted);
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.summary-panel {
  overflow: hidden;
}

.summary-panel summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}

.summary-panel summary::-webkit-details-marker {
  display: none;
}

.summary-panel summary strong {
  color: var(--accent);
  font-size: 18px;
}

.summary-panel summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.summary-panel[open] summary span {
  font-size: 0;
}

.summary-panel[open] summary span::after {
  content: "Close";
  font-size: 12px;
}

.summary-grid article {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-grid strong {
  color: var(--accent);
  font-size: 28px;
}

.planner-panel,
.result-panel {
  overflow: hidden;
}

.planner-panel {
  overflow: visible;
}

.section-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 18px;
}

.section-heading small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.sort-control {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  white-space: nowrap;
}

.sort-control select {
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 36px;
  padding: 0 9px;
}

.townie-head,
.townie-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 72px minmax(420px, 2fr) 72px;
}

.townie-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 12px 14px 5px;
  text-transform: uppercase;
}

.state-legend {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
}

.state-legend > strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.state-legend > span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  gap: 5px;
}

.legend-building {
  align-items: center;
  background: rgba(250, 242, 222, 0.05);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  position: relative;
  width: 28px;
}

.legend-building img {
  filter: grayscale(1);
  height: 22px;
  object-fit: contain;
  opacity: 0.28;
  width: 22px;
}

.legend-building.state-selected {
  border-color: rgba(226, 191, 114, 0.6);
}

.legend-building.state-selected img {
  filter: none;
  opacity: 1;
}

.legend-building.state-completed {
  border-color: rgba(119, 167, 106, 0.58);
}

.legend-building.state-ready {
  border-color: var(--accent);
}

.legend-building.state-claimed {
  border-color: rgba(143, 159, 178, 0.35);
}

.legend-building b {
  align-items: center;
  border-radius: 50%;
  bottom: -3px;
  display: flex;
  font-size: 9px;
  height: 14px;
  justify-content: center;
  position: absolute;
  right: -3px;
  width: 14px;
}

.legend-building.state-completed b {
  background: var(--green);
  color: #ffffff;
}

.legend-building.state-ready b {
  background: var(--accent);
  color: #4a3511;
}

.legend-building.state-claimed b {
  background: #667482;
  color: #dce3e8;
}

.townie-list {
  display: grid;
  gap: 8px;
  padding: 8px 14px 14px;
}

.townie-row {
  align-items: stretch;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.visitor-picker-button {
  align-items: center;
  background: #19171d;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  gap: 8px;
  justify-content: flex-start;
  min-height: 42px;
  min-width: 0;
  padding: 7px 9px;
  width: 100%;
}

.visitor-picker-button img {
  height: 30px;
  object-fit: contain;
  width: 30px;
}

.visitor-picker-button span {
  font-weight: 900;
}

.visitor-picker-button.compact {
  justify-content: center;
  min-height: 64px;
  padding: 4px;
}

.visitor-picker-button.compact img {
  height: 56px;
  width: 56px;
}

.visitor-picker-button.compact span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.visitor-field {
  align-items: center;
  display: flex;
  position: relative;
}

.visitor-picker-menu {
  background: var(--card);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(5, 58px);
  left: 0;
  padding: 7px;
  position: absolute;
  top: calc(100% + 5px);
  z-index: 30;
}

.visitor-picker-menu[hidden] {
  display: none;
}

.visitor-picker-menu.quick {
  top: calc(100% + 4px);
}

.quick-add-form label:first-child {
  position: relative;
}

.visitor-picker-menu button {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  font-size: 9px;
  font-weight: 900;
  gap: 2px;
  justify-items: center;
  min-height: 55px;
  padding: 4px 2px;
}

.visitor-picker-menu button.active,
.visitor-picker-menu button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.visitor-picker-menu img {
  height: 30px;
  object-fit: contain;
  width: 30px;
}

.building-choices {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
}

.building-choice {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(250, 242, 222, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 5px;
  position: relative;
}

.building-choice img {
  filter: grayscale(1);
  height: 100%;
  max-height: 42px;
  max-width: 42px;
  object-fit: contain;
  opacity: 0.28;
  width: 100%;
}

.building-choice.state-selected {
  background: rgba(143, 101, 216, 0.13);
  border-color: rgba(226, 191, 114, 0.6);
}

.building-choice.state-selected img {
  filter: none;
  opacity: 1;
}

.building-choice.state-completed {
  background: rgba(119, 167, 106, 0.1);
  border-color: rgba(119, 167, 106, 0.58);
}

.building-choice.state-claimed {
  background: rgba(143, 159, 178, 0.08);
  border-color: rgba(143, 159, 178, 0.35);
}

.building-choice.state-ready {
  background: rgba(226, 191, 114, 0.12);
  border-color: var(--accent);
}

.building-choice.state-completed img,
.building-choice.state-claimed img,
.building-choice.state-ready img {
  filter: grayscale(1);
  opacity: 0.38;
}

.building-marker {
  align-items: center;
  border-radius: 50%;
  bottom: 2px;
  display: flex;
  font-size: 15px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  position: absolute;
  right: 2px;
  text-shadow: 0 1px 2px #000000;
  width: 22px;
}

.state-completed .building-marker {
  background: var(--green);
  color: #ffffff;
}

.state-claimed .building-marker {
  background: #667482;
  color: #dce3e8;
  font-size: 13px;
}

.state-ready .building-marker {
  background: var(--accent);
  color: #4a3511;
  text-shadow: none;
}

.townie-actions {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, 1fr);
}

.remove-townie,
.duplicate-townie {
  background: rgba(184, 111, 79, 0.12);
  border: 1px solid rgba(184, 111, 79, 0.45);
  border-radius: 6px;
  color: #efb39a;
  font-size: 18px;
  font-weight: 900;
}

.duplicate-townie {
  background: rgba(143, 101, 216, 0.15);
  border-color: rgba(143, 101, 216, 0.5);
  color: #d7c5f5;
  font-size: 16px;
}


.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 34px 18px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state img {
  height: 68px;
  object-fit: contain;
  width: 68px;
}

.empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.empty-state .primary-button {
  margin-top: 8px;
}

.add-townie-bottom {
  background: var(--card-dark);
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-weight: 900;
  margin: 0 14px 14px;
  min-height: 42px;
}

.add-townie-bottom[hidden] {
  display: none;
}

.add-townie-bottom:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.save-bubble {
  background: rgba(33, 30, 39, 0.96);
  border: 1px solid rgba(119, 167, 106, 0.58);
  border-radius: 999px;
  bottom: 18px;
  color: #c8efb7;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  padding: 9px 14px;
  pointer-events: none;
  position: fixed;
  right: 18px;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 100;
}

.save-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.results-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.15fr 0.85fr;
}

.building-results,
.path-results,
.visitor-results,
.combo-results {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.building-row {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) minmax(260px, auto);
  padding: 9px;
}

.building-row.status-ready {
  border-color: rgba(119, 167, 106, 0.7);
}

.building-row.status-prepare {
  border-color: rgba(226, 191, 114, 0.48);
}

.building-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.building-title-line em {
  background: rgba(250, 242, 222, 0.08);
  border: 1px solid rgba(250, 242, 222, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  padding: 3px 7px;
  text-transform: uppercase;
}

.status-ready .building-title-line em {
  background: rgba(119, 167, 106, 0.18);
  border-color: rgba(119, 167, 106, 0.48);
  color: #c8efb7;
}

.status-prepare .building-title-line em {
  background: rgba(226, 191, 114, 0.12);
  border-color: rgba(226, 191, 114, 0.36);
  color: var(--accent);
}

.building-row img,
.visitor-task img {
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.building-copy,
.visitor-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.building-copy strong,
.visitor-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.building-copy small,
.visitor-copy small {
  color: var(--muted);
  font-weight: 800;
}

.count-pill {
  background: rgba(250, 242, 222, 0.07);
  border: 1px solid rgba(250, 242, 222, 0.12);
  border-radius: 6px;
  display: grid;
  font-size: 11px;
  gap: 2px;
  min-width: 72px;
  padding: 5px 8px;
  text-align: center;
  text-transform: uppercase;
}

.count-pill strong {
  color: var(--accent);
  font-size: 16px;
}

.count-pill.ready {
  background: rgba(119, 167, 106, 0.18);
  border-color: rgba(119, 167, 106, 0.58);
}

.count-pill.potential {
  background: rgba(226, 191, 114, 0.12);
  border-color: rgba(226, 191, 114, 0.42);
}

.metric-strip {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
}

.metric-strip.compact {
  grid-template-columns: repeat(4, minmax(54px, 1fr));
}

.path-step {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 26px 42px minmax(0, 1fr);
  padding: 9px;
  position: relative;
}

.path-step:not(:last-of-type)::after {
  background: var(--line-bright);
  bottom: -9px;
  content: "";
  height: 9px;
  left: 21px;
  position: absolute;
  width: 2px;
}

.path-step.path-forecast {
  border-color: rgba(143, 101, 216, 0.46);
}

.path-step.path-forecast .path-number {
  background: var(--purple);
  color: #ffffff;
}

.path-building-icon {
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.path-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.path-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.path-title b {
  background: rgba(143, 101, 216, 0.16);
  border: 1px solid rgba(143, 101, 216, 0.42);
  border-radius: 999px;
  color: #d9cbef;
  font-size: 9px;
  padding: 2px 6px;
  text-transform: uppercase;
}

.path-prepare .path-title b {
  background: rgba(226, 191, 114, 0.12);
  border-color: rgba(226, 191, 114, 0.4);
  color: var(--accent);
}

.path-claim .path-title b {
  background: rgba(119, 167, 106, 0.16);
  border-color: rgba(119, 167, 106, 0.5);
  color: #c8efb7;
}

.path-main small {
  color: var(--muted);
  font-weight: 900;
}

.path-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  grid-column: 2 / -1;
  padding-left: 2px;
}

.path-metrics span {
  background: rgba(250, 242, 222, 0.06);
  border: 1px solid rgba(250, 242, 222, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
}

.path-metrics strong {
  color: var(--accent);
}

.path-metrics .route-next,
.path-metrics .route-overlap {
  border-color: rgba(143, 101, 216, 0.38);
  color: #d9cbef;
}

.path-metrics .route-leave {
  border-color: rgba(226, 191, 114, 0.38);
  color: var(--accent);
}

.path-metrics .route-reserved {
  border-color: rgba(119, 167, 106, 0.4);
  color: #c8efb7;
}

.route-alternatives {
  display: grid;
  gap: 7px;
}

.route-alternatives > strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.route-option {
  align-items: center;
  background: rgba(250, 242, 222, 0.05);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: 30px minmax(0, 1fr);
  padding: 7px 8px;
}

.route-option img {
  height: 30px;
  object-fit: contain;
  width: 30px;
}

.route-option div {
  display: grid;
  gap: 2px;
}

.route-option small {
  color: var(--muted);
  font-weight: 800;
}

.path-strategy-note {
  background: rgba(143, 101, 216, 0.12);
  border: 1px solid rgba(143, 101, 216, 0.38);
  border-radius: 7px;
  color: #d9cbef;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
  padding: 7px 9px;
}

.path-alternatives {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding-top: 12px;
}

.path-alternatives > strong {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.alternate-task {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  padding: 8px;
}

.alternate-task.is-ready {
  border-color: rgba(119, 167, 106, 0.62);
}

.alternate-task.is-near {
  border-color: rgba(226, 191, 114, 0.44);
}

.alternate-task > img {
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.alternate-task > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.alternate-task small,
.alternate-task em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.alternate-task > span {
  color: var(--accent);
  font-weight: 900;
}

.alternate-combo {
  grid-template-columns: 32px minmax(0, 1fr);
}

.path-step.path-prepare {
  border-color: rgba(226, 191, 114, 0.42);
}

.path-step.path-claim {
  border-color: rgba(119, 167, 106, 0.58);
}

.path-step.path-claim .path-number {
  background: var(--green);
  color: #172317;
}

.path-number {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #241f2a;
  display: flex;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.result-empty {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.pickup-note {
  background: rgba(226, 191, 114, 0.1);
  border: 1px solid rgba(226, 191, 114, 0.3);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
  padding: 11px;
}

.pickup-note strong {
  color: var(--accent);
}

.pickup-note span {
  display: block;
  margin-top: 4px;
}

.path-options {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
}

.path-options > strong {
  color: var(--muted);
  flex-basis: 100%;
  font-size: 11px;
  text-transform: uppercase;
}

.path-options label {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
}

.path-options label:has(input:checked) {
  background: rgba(226, 191, 114, 0.12);
  border-color: rgba(226, 191, 114, 0.48);
  color: var(--accent);
}

.path-options input {
  accent-color: var(--accent);
  margin: 0;
}

.visitor-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visitor-task {
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 9px;
}

.visitor-task .metric-strip {
  grid-column: 1 / -1;
}

.visitor-task.is-ready {
  border-color: rgba(119, 167, 106, 0.72);
}

.combo-results {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.combo-task {
  background: var(--card-dark);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.combo-task.is-ready {
  border-color: rgba(119, 167, 106, 0.72);
}

.combo-task.is-near {
  border-color: rgba(226, 191, 114, 0.48);
}

.combo-task-heading {
  align-items: center;
  display: flex;
  gap: 10px;
}

.combo-task-heading > img {
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.combo-task-heading > div {
  display: grid;
  gap: 3px;
}

.combo-task-heading strong {
  color: var(--accent);
  font-size: 18px;
}

.combo-task-heading small {
  color: var(--muted);
  font-weight: 800;
}

.combo-ingredients {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.combo-ingredients > span {
  align-items: center;
  background: rgba(250, 242, 222, 0.05);
  border: 1px solid rgba(250, 242, 222, 0.1);
  border-radius: 7px;
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: 900;
  gap: 2px;
  justify-items: center;
  min-width: 0;
  padding: 7px 4px;
  text-align: center;
}

.combo-ingredients b {
  color: var(--text);
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-ingredients > span.ready {
  background: rgba(119, 167, 106, 0.14);
  border-color: rgba(119, 167, 106, 0.42);
}

.combo-ingredients img {
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.combo-ingredients strong {
  color: var(--accent);
  font-size: 14px;
}

.combo-ingredients small {
  color: var(--muted);
}

footer {
  color: #a9a9a9;
  font-size: 13px;
  font-weight: 700;
  margin: 0 auto;
  max-width: 1120px;
  padding: 0 20px 30px;
}

@media (max-width: 900px) {
  .tool-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .results-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-layout {
    grid-template-columns: 1fr;
  }

  .townie-head {
    display: none;
  }

  .townie-row {
    grid-template-columns: 68px minmax(360px, 2fr) 72px;
  }

  .planner-panel {
    overflow-x: auto;
  }

  .remove-townie {
    min-height: 40px;
  }
}

@media (max-width: 620px) {
  .town-hero img {
    height: 90px;
    width: 90px;
  }

  .summary-grid,
  .visitor-results,
  .combo-results,
  .quick-add-form {
    grid-template-columns: 1fr;
  }

  .townie-row {
    grid-template-columns: 1fr;
  }

  .visitor-picker-button.compact {
    justify-content: flex-start;
    min-height: 52px;
    padding: 5px 9px;
  }

  .visitor-picker-button.compact img {
    height: 44px;
    width: 44px;
  }

  .visitor-picker-button.compact span {
    clip: auto;
    clip-path: none;
    height: auto;
    overflow: visible;
    position: static;
    width: auto;
  }

  .building-choices {
    grid-template-columns: repeat(7, minmax(38px, 1fr));
  }

  .townie-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visitor-picker-menu {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
    max-width: calc(100vw - 48px);
  }

  .building-row {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 9px;
  }

  .building-copy small {
    font-size: 12px;
    line-height: 1.35;
  }

  .building-row .metric-strip {
    grid-column: 1 / -1;
  }

  .building-row .count-pill {
    font-size: 9px;
    min-height: 48px;
    min-width: 0;
    padding: 5px 3px;
    width: 100%;
  }

  .state-legend > strong {
    flex-basis: 100%;
  }

  .section-heading {
    flex-direction: column;
  }

  .sort-control {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .sort-control select {
    width: 100%;
  }

  .path-step {
    grid-template-columns: 24px 38px minmax(0, 1fr);
  }

  .path-building-icon {
    height: 36px;
    width: 36px;
  }

  .path-metrics {
    grid-column: 2 / -1;
  }
}
