.place-head,
.history-place,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-link {
  flex: 0 0 auto;
  color: #c84e4e;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: #fff0eb;
  border-radius: 10px;
  padding: 5px 9px;
}

.history-head h1 { margin-bottom: 0; }
.history-head .muted { margin-top: 4px; }

.mini-btn {
  border: 1px solid #dfd1cc;
  background: #fff;
  color: #6d6260;
  border-radius: 10px;
  padding: 8px 12px;
}

.history-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.history-card summary::-webkit-details-marker { display: none; }
.history-card summary small {
  display: block;
  color: #7c7471;
  margin-top: 4px;
}

.history-card .history-head small {
  display: block;
  color: #7c7471;
  margin-top: 4px;
}

.history-status {
  font-size: 12px;
  color: #267444;
  background: #e4f6e9;
  padding: 5px 8px;
  border-radius: 9px;
  white-space: nowrap;
}

.history-plan {
  border-top: 1px solid #f1e4de;
  margin-top: 14px;
  padding-top: 14px;
}

.history-plan.picked {
  border-left: 3px solid #45a66c;
  padding-left: 10px;
}

.history-place { font-size: 14px; margin-top: 9px; }
.empty-history { text-align: center; color: #7c7471; }

@media (max-width: 420px) {
  .history-head { align-items: flex-start; }
}

/* Visual system */
:root {
  --ink: #1f2928;
  --muted: #66706d;
  --surface: #ffffff;
  --canvas: #f4f5f2;
  --line: #dfe3df;
  --primary: #ed5d61;
  --primary-dark: #c9444d;
  --sage: #2f725d;
  --sage-soft: #e7f0ec;
  --blue: #356b8c;
}

html { background: var(--canvas); }
body {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--ink);
  background: var(--canvas);
  border-top: 4px solid var(--primary);
}

.shell {
  --shell-side-padding: 24px;
  width: min(100%, 760px);
  max-width: 760px;
  padding: 24px 24px 80px;
}

html.native-app body { padding-top: 0; }
html.native-app .shell { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 54px;
  margin-right: calc(-1 * var(--shell-side-padding));
  margin-left: calc(-1 * var(--shell-side-padding));
  padding-right: var(--shell-side-padding);
  padding-bottom: 18px;
  padding-left: var(--shell-side-padding);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}

html.native-app .shell { padding-top: 0; }
html.native-app .top {
  top: 0;
  padding-top: calc(24px + max(env(safe-area-inset-top, 0px), 24px));
}

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand-lockup img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(31, 41, 40, .12);
}
.brand-lockup .brand { color: var(--ink); font-size: 16px; white-space: nowrap; }
.brand-lockup .brand i {
  margin-left: 5px;
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.mode-label {
  flex-shrink: 0;
  color: var(--sage);
  background: var(--sage-soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hero { max-width: 650px; padding: 64px 0 30px; }
.eyebrow {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  word-break: keep-all;
}
.hero h1 {
  max-width: 620px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0;
}
.hero p { max-width: 520px; margin: 0; font-size: 16px; }
.muted { color: var(--muted); }

.home-actions { max-width: 650px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-row .btn { margin-top: 10px; }

.btn {
  min-height: 50px;
  border-radius: 8px;
  padding: 13px 18px;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(201, 68, 77, .16);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { color: var(--sage); background: var(--sage-soft); box-shadow: none; }
.btn.secondary:hover { color: #fff; background: var(--sage); }
.btn.ghost { color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: #ecefeb; }

.page-intro { padding: 42px 0 18px; }
.page-intro h1 { margin: 0; font-size: 32px; line-height: 1.2; word-break: keep-all; }
.form-panel {
  width: 100%;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(31, 41, 40, .07);
}
.field { margin: 13px 0; }
.field label { margin-bottom: 6px; color: #37413f; font-size: 14px; }
.field-error {
  display: none;
  margin-top: 7px;
  color: #b5323c;
  font-size: 13px;
  font-weight: 700;
}
.field-invalid .tags {
  margin: -6px;
  padding: 6px;
  border: 1px solid #d6545d;
  border-radius: 8px;
  background: #fff4f4;
}
.field-invalid .field-error { display: block; }
input, select {
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid #cfd5d1;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus {
  background: #fff;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(47, 114, 93, .12);
}
.input-prefix { position: relative; }
.input-prefix span {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  transform: translateY(-50%);
}
.input-prefix input { padding-left: 30px; }

.card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 7px 24px rgba(31, 41, 40, .06);
}
.confirmed { border-color: #56a481; background: #f5fbf8; }
.match { color: #225b49; background: var(--sage-soft); border-radius: 8px; }
.confirm-btn { background: var(--sage); }
.price { color: var(--ink); }
.timeline { border-color: #d2ddd8; }
.place { padding: 2px 0; }
.map-link { color: var(--blue); background: #eaf1f5; border-radius: 6px; }
.vote-btn { min-height: 42px; border-radius: 8px; cursor: pointer; }
.vote-btn.on { color: var(--primary-dark); border-color: var(--primary); background: #fff0f0; }
.tag { border-color: var(--line); background: var(--surface); }
.tag.on { color: var(--sage); border-color: var(--sage); background: var(--sage-soft); }
.history-status { color: #225b49; background: var(--sage-soft); border-radius: 6px; }
.mini-btn { cursor: pointer; border-radius: 7px; }
.error { border: 1px solid #efc5c5; border-radius: 8px; }

@media (max-width: 600px) {
  body { border-top-width: 3px; }
  .shell {
    --shell-side-padding: 16px;
    padding: 16px 16px 56px;
  }
  html.native-app .shell {
    padding-top: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .top { min-height: 48px; padding-bottom: 14px; }
  html.native-app .top {
    padding-top: calc(16px + max(env(safe-area-inset-top, 0px), 24px));
  }
  .brand-lockup img { width: 34px; height: 34px; }
  .hero { padding: 44px 0 24px; }
  .hero h1 { font-size: 37px; }
  .action-row { grid-template-columns: 1fr; gap: 0; }
  .page-intro { padding: 32px 0 14px; }
  .page-intro h1 { font-size: 28px; }
  .form-panel { padding: 16px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .vote-row { gap: 6px; }
  .vote-btn { font-size: 13px; }
}
