:root {
  color-scheme: light;
  --bg: #eef8f7;
  --surface: #f8fffe;
  --surface-strong: #ffffff;
  --ink: #001615;
  --muted: #526866;
  --line: #c8e3df;
  --accent: #f04a16;
  --accent-strong: #c4340a;
  --teal: #49d1cb;
  --teal-strong: #128e88;
  --shadow: 0 18px 50px rgba(0, 22, 21, .12);
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #001615;
  --surface: #061f1e;
  --surface-strong: #0d2a29;
  --ink: #f7ffff;
  --muted: #a9cac6;
  --line: #21413f;
  --accent: #ff5a20;
  --accent-strong: #ff8b63;
  --teal: #55d5cf;
  --teal-strong: #7ce8e2;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  filter: drop-shadow(0 8px 16px rgba(0, 22, 21, .15));
}

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

.brand h1 {
  font-size: 1.34rem;
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 950;
}

.brand p,
.sidebar-card p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.region-list {
  display: grid;
  gap: 8px;
}

.region-button {
  min-height: 44px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.region-button:hover,
.region-button.is-active {
  background: var(--surface-strong);
  border-color: var(--line);
}

.region-button strong {
  color: var(--teal-strong);
  font-size: .86rem;
}

.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.topbar h2 {
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: .95;
  letter-spacing: 0;
}

.topbar-actions,
.panel-heading,
.modal-heading,
.meta-row,
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions,
.panel-heading,
.modal-heading {
  justify-content: space-between;
}

.icon-button,
.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: var(--surface-strong);
  color: var(--ink);
}

.primary-button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.ghost-button {
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.full {
  width: 100%;
}

svg {
  width: 18px;
  height: 18px;
}

button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 270px;
  margin-bottom: 24px;
  border-radius: 8px;
  background: #001615;
  box-shadow: var(--shadow);
}

.route-art {
  position: relative;
  min-height: 270px;
}

.route-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-logo {
  position: absolute;
  left: clamp(20px, 4vw, 42px);
  top: 50%;
  width: min(34vw, 230px);
  height: min(34vw, 230px);
  min-width: 150px;
  min-height: 150px;
  transform: translateY(-50%);
  border: 5px solid #f7ffff;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .3));
}

.hero-copy {
  padding: 28px;
  background: color-mix(in srgb, #001615 88%, transparent);
  color: #f7ffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats-grid {
  display: grid;
  gap: 14px;
}

.stats-grid div {
  border-bottom: 1px solid rgba(247, 255, 255, .18);
  padding-bottom: 12px;
}

.stats-grid strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stats-grid span {
  color: rgba(247, 255, 255, .72);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 24px;
}

.recommends-panel {
  margin-bottom: 24px;
}

.phase-panel {
  margin-bottom: 24px;
}

.panel {
  min-width: 0;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading h3 {
  font-size: 1.28rem;
}

.meetup-list,
.thread-list,
.recommend-list {
  display: grid;
  gap: 12px;
}

.meetup-card,
.thread-card,
.recommend-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-strong);
}

.meetup-card h4,
.thread-card h4,
.recommend-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.meetup-card p,
.thread-card p,
.recommend-card p {
  color: var(--muted);
  line-height: 1.45;
}

.recommend-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}

.recommend-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.recommend-tab:hover,
.recommend-tab.is-active {
  border-color: color-mix(in srgb, var(--teal) 68%, var(--line));
  background: color-mix(in srgb, var(--teal) 18%, var(--surface-strong));
}

.recommend-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recommend-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.recommend-card footer {
  margin-top: auto;
}

.recommend-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  float: right;
  margin-left: 12px;
  background: var(--ink);
  color: var(--surface);
  font-size: .92rem;
  font-weight: 950;
}

.phase-grid {
  display: grid;
  grid-template-columns: minmax(300px, .86fr) minmax(0, 1.14fr);
  gap: 14px;
}

.map-card,
.phase-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.map-card {
  overflow: hidden;
}

.map-canvas {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--teal) 10%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--teal) 10%, transparent) 1px, transparent 1px),
    radial-gradient(circle at 74% 22%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 26%),
    #001615;
  background-size: 42px 42px, 42px 42px, auto;
}

.map-road {
  position: absolute;
  width: 120%;
  height: 18px;
  left: -10%;
  border-radius: 999px;
  background: rgba(247, 255, 255, .9);
}

.road-one {
  top: 42%;
  transform: rotate(-18deg);
}

.road-two {
  top: 63%;
  transform: rotate(24deg);
  opacity: .72;
}

.map-pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #f7ffff;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 14px 24px rgba(0, 0, 0, .3);
}

.pin-workshop {
  top: 28%;
  left: 24%;
}

.pin-business {
  top: 46%;
  right: 22%;
  background: var(--teal-strong);
}

.pin-route {
  bottom: 18%;
  left: 43%;
}

.pin-rider {
  top: 17%;
  right: 36%;
  background: #f7ffff;
  color: var(--ink);
}

.map-copy {
  padding: 16px;
}

.map-copy h4,
.phase-card h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.map-copy p,
.phase-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.phase-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phase-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 186px;
  padding: 16px;
}

.meta-row {
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 18%, transparent);
  color: var(--teal-strong);
  font-size: .78rem;
  font-weight: 800;
}

.date-block {
  float: right;
  width: 58px;
  height: 58px;
  margin-left: 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
}

.date-block span {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
}

.thread-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .86rem;
}

.reply-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
}

.modal {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(9, 10, 10, .62);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-strong);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
}

@media (max-width: 940px) {
  .app-shell,
  .workspace,
  .recommend-list,
  .phase-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .hero-copy {
    order: -1;
  }
}

@media (max-width: 620px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 2.35rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .primary-button {
    flex: 1;
  }

  .region-list,
  .phase-feature-list,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
