:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #738079;
  --line: #e8eee9;
  --paper: #f4f7f4;
  --green: #197a51;
  --green-dark: #126341;
  --mint: #e5f5ed;
  --amber: #9b6417;
  --red: #a34039;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 4%, rgba(198, 232, 211, .48), transparent 35rem),
    var(--paper);
}

.shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  margin-bottom: 34px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: #173c2b;
  display: grid;
  place-content: center;
  gap: 4px;
  transform: rotate(-5deg);
}

.brand-mark span {
  display: block;
  width: 16px;
  height: 5px;
  border: 1.5px solid #dbf4e6;
  border-radius: 99px;
  transform: rotate(5deg);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 24px; letter-spacing: -.045em; }
h3 { margin-bottom: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.025em; }

.demo-badge {
  margin-left: auto;
  padding: 7px 10px;
  color: #8b5918;
  background: #fff2d9;
  border: 1px solid #f0d7a8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(225, 235, 228, .9);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 55px rgba(29, 61, 43, .07);
}

.access-panel { padding: 22px 20px; }
.access-status { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.access-status.error { color: var(--red); }
.panel-icon {
  width: 47px;
  height: 47px;
  margin-bottom: 23px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--mint);
  border-radius: 16px;
  font-size: 27px;
}

button { border: 0; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .58; cursor: wait; }

.primary, .secondary {
  min-height: 49px;
  padding: 0 20px;
  border-radius: 15px;
  font-weight: 750;
  font-size: 14px;
  transition: transform .12s, background .12s;
}

.primary { color: white; background: var(--green); box-shadow: 0 7px 16px rgba(25, 122, 81, .18); }
.primary:hover { background: var(--green-dark); }
.secondary { color: var(--green-dark); background: #eaf5ee; }
.primary:active, .secondary:active { transform: scale(.985); }
.error { color: var(--red); }

.door-panel { flex: 1; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 19px; }
.section-heading h2 { font-size: 25px; }
.page-status { min-height: 0; margin: 0; color: var(--muted); font-size: 13px; }
.page-status:not(:empty) { margin: 0 0 12px; }

.door-list { display: grid; gap: 12px; }
.door-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 22px rgba(30, 61, 43, .035);
}
.door-card.featured {
  padding: 20px 18px 17px;
  border-color: #b8dfc8;
  background: linear-gradient(135deg, #f5fcf7, #fff 78%);
  box-shadow: 0 11px 30px rgba(26, 110, 70, .08);
}
.door-summary { display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.door-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.door-summary .door-head { flex: 1; min-width: 0; }
.door-head h3 { flex: 1; }
.door-map {
  flex: 0 0 clamp(108px, 36vw, 132px);
  width: clamp(108px, 36vw, 132px);
  max-width: 44%;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e5ece6;
  border-radius: 12px;
  background: #f3f7f2;
}
.door-map svg { display: block; width: 100%; height: auto; }
.door-map figcaption {
  overflow: hidden;
  padding: 4px 7px 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, .78);
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
}
.map-road-label { fill: #59675f; font-size: 6px; font-weight: 700; }
.map-landmark-label { fill: #617468; font-size: 4.8px; font-weight: 650; }
.map-building-label { fill: #52665a; font-size: 5.2px; font-weight: 750; }
.featured-tag {
  flex: none;
  padding: 5px 8px;
  color: var(--green-dark);
  background: #e4f4ea;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}
.door-status { min-height: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.door-status:not(:empty) { margin: 9px 0 0; }
.door-status.success { color: var(--green-dark); }
.door-status.error { color: var(--red); }
.door-status.warning { color: var(--amber); }
.door-actions { display: flex; align-items: center; gap: 12px; margin-top: 15px; }
.open-button { min-width: 116px; min-height: 43px; padding: 0 18px; border-radius: 13px; }
.text-button { padding: 8px 3px; color: var(--amber); background: transparent; font-size: 12px; font-weight: 700; text-align: left; }
.text-button[hidden] { display: none; }

@media (min-width: 600px) {
  .shell { padding-top: 42px; }
  .topbar { margin-bottom: 40px; }
}

@media (max-width: 360px) {
  .door-summary { gap: 8px; }
  .door-map { flex-basis: 108px; width: 108px; }
  .door-head h3 { font-size: 15px; }
}
