/* =========================================================
   Calendar entry — friendly, rounded, light, contractor-ready
   ========================================================= */

:root {
  /* Palette — warm cream + sage with a coral accent */
  --bg: #F6F1E8;
  --bg-deep: #EFE7D6;
  --paper: #FFFFFF;
  --paper-tint: #FBF8F1;
  --ink: #1F2A26;
  --ink-soft: #4A5752;
  --ink-mute: #8A958F;
  --line: #E5DFD0;
  --line-soft: #EFEADC;

  /* Accents (overridable by Tweaks) */
  --accent: #2F6F5C;        /* sage */
  --accent-deep: #1F4A3D;
  --accent-tint: #E3EFE9;
  --accent-ink: #FFFFFF;

  --warn: #C24E2E;          /* terracotta */
  --warn-tint: #FBE6DD;

  --amber: #D9A23B;
  --amber-tint: #F8ECCF;

  /* Type */
  --f-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Density */
  --pad-card: 28px;
  --pad-field: 14px 16px;
  --field-h: 52px;
  --gap-row: 14px;
  --gap-section: 28px;
  --label-size: 13px;
  --field-size: 16px;
}

[data-density="compact"] {
  --pad-card: 20px;
  --pad-field: 10px 14px;
  --field-h: 44px;
  --gap-row: 10px;
  --gap-section: 20px;
  --field-size: 15px;
}
[data-density="comfy"] {
  --pad-card: 36px;
  --pad-field: 18px 18px;
  --field-h: 60px;
  --gap-row: 18px;
  --gap-section: 36px;
  --field-size: 17px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(47,111,92,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(217,162,59,.08), transparent 60%),
    var(--bg);
}

button { font-family: inherit; }

/* ---------- App shell ---------- */

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 6px 18px -8px rgba(31,74,61,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
}
.brand-name em {
  font-style: italic;
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 18px;
  margin-left: 2px;
  color: var(--ink-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gcal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.gcal-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34a853;
  box-shadow: 0 0 0 3px rgba(52,168,83,.18);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:hover { background: var(--paper-tint); }
.icon-btn:active { transform: scale(.96); }

/* ---------- Page heading ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 4px 22px;
  flex-wrap: wrap;
}

.h-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}
.h-title em {
  font-style: italic;
  color: var(--accent);
}
.h-sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 56ch;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--paper); color: var(--ink); }

/* ---------- Layout grid ---------- */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--pad-card);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 12px 30px -22px rgba(31,42,38,.18);
}

.card + .card { margin-top: 18px; }

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.section-step {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

/* ---------- Form rows ---------- */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-row);
}
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.row + .row { margin-top: var(--gap-row); }
@media (max-width: 560px) {
  .row.cols-2, .row.cols-3 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  min-width: 0;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--label-size);
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.field-label .req {
  color: var(--warn);
  margin-left: 2px;
}
.field-label .hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-mute);
}

.input,
.textarea,
.select {
  appearance: none;
  width: 100%;
  min-width: 0;
  padding: var(--pad-field);
  height: var(--field-h);
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--field-size);
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.input:hover, .textarea:hover, .select:hover { border-color: #D6CFBE; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(47,111,92,.12);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.5;
}
.input.has-prefix { padding-left: 32px; }
.field-prefix {
  position: absolute;
  left: 14px;
  bottom: 0;
  height: var(--field-h);
  display: flex;
  align-items: center;
  color: var(--ink-mute);
  font-size: var(--field-size);
  pointer-events: none;
}

.select-wrap {
  position: relative;
}
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238A958F' d='M0 0h12L6 8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* ---------- Pill / chip groups ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper-tint);
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .12s ease;
}
.chip:hover { background: var(--paper); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 6px 16px -10px rgba(47,111,92,.6);
}
.chip .swatch {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--c, #ccc);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* segmented control */
.segmented {
  display: inline-flex;
  background: var(--bg-deep);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
  width: fit-content;
}
.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s ease;
}
.segmented button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* color swatch row (event color) */
.swatches {
  display: flex;
  gap: 8px;
}
.sw {
  appearance: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: transform .12s ease;
}
.sw:hover { transform: scale(1.08); }
.sw[aria-pressed="true"] {
  border-color: var(--ink);
}
.sw[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid var(--paper);
}

/* ---------- Date / time picker faces ---------- */
.dt-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) { .dt-row { grid-template-columns: 1fr; } }

.dt-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--field-h);
  padding: 0 14px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .12s ease;
}
.dt-field:hover { border-color: #D6CFBE; }
.dt-field svg { flex: 0 0 auto; color: var(--accent); }
.dt-field .dt-val { font-size: var(--field-size); font-weight: 500; color: var(--ink); }
.dt-field .dt-sub { font-size: 12px; color: var(--ink-mute); }
.dt-field input {
  appearance: none; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: var(--field-size); font-weight: 500; color: var(--ink);
  width: 100%; padding: 0; min-width: 0;
}

/* ---------- Reminder chips ---------- */
.rem-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rem-add {
  appearance: none;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-mute);
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-size: 13px;
  cursor: pointer;
}
.rem-add:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Attachments ---------- */
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  text-align: center;
  color: var(--ink-mute);
  cursor: pointer;
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(47,111,92,.02) 8px 16px),
    var(--paper-tint);
  transition: border-color .12s ease, color .12s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent);
  color: var(--accent);
}
.dropzone strong {
  color: var(--ink);
  font-weight: 600;
}

.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
}
.file-row .fname { font-weight: 500; }
.file-row .fsize { margin-left: auto; color: var(--ink-mute); font-size: 12px; }
.file-row .frm {
  appearance: none; border: 0; background: transparent;
  color: var(--ink-mute); cursor: pointer; padding: 4px;
  border-radius: 6px;
}
.file-row .frm:hover { background: var(--bg-deep); color: var(--ink); }

/* ---------- Submit row ---------- */
.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-primary {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: var(--accent-ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 16px 22px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 24px -10px rgba(31,74,61,.55), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .12s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(31,74,61,.6), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.save-meta {
  font-size: 13px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Right column: live preview ---------- */
.preview-col {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 960px) {
  .preview-col { position: static; }
}

.cal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 12px 30px -22px rgba(31,42,38,.2);
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-tint);
}
.cal-head .left { display: flex; align-items: center; gap: 10px; }
.cal-head .glogo {
  width: 22px; height: 22px;
  background:
    conic-gradient(from 0deg, #ea4335 0 25%, #fbbc04 25% 50%, #34a853 50% 75%, #4285f4 75% 100%);
  border-radius: 6px;
  position: relative;
}
.cal-head .glogo::after {
  content: "";
  position: absolute; inset: 5px;
  background: var(--paper-tint); border-radius: 3px;
}
.cal-head .left b { font-size: 13px; font-weight: 600; }
.cal-head .right { font-size: 12px; color: var(--ink-mute); }

.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
}
.cal-day {
  border-left: 1px solid var(--line-soft);
  padding: 10px 8px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
}
.cal-day .num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  margin-top: 2px;
}
.cal-day.is-today .num {
  background: var(--accent);
  color: var(--accent-ink);
}

.cal-body {
  position: relative;
  display: grid;
  grid-template-columns: 56px repeat(3, 1fr);
  height: 280px;
}
.cal-times, .cal-col {
  position: relative;
  border-left: 1px solid var(--line-soft);
}
.cal-times { border-left: 0; }
.cal-time {
  position: absolute;
  left: 0; right: 0;
  top: var(--y);
  font-size: 11px;
  color: var(--ink-mute);
  padding: 0 8px;
  text-align: right;
  transform: translateY(-50%);
}
.cal-line {
  position: absolute;
  left: 56px; right: 0;
  top: var(--y);
  height: 1px;
  background: var(--line-soft);
}
.cal-now {
  position: absolute;
  left: 0; right: 0;
  top: var(--y);
  height: 2px;
  background: var(--warn);
  z-index: 2;
}
.cal-now::before {
  content: "";
  position: absolute; left: -4px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
}

.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  top: var(--top); height: var(--h);
  background: var(--ev-bg, var(--accent-tint));
  border-left: 3px solid var(--ev, var(--accent));
  border-radius: 8px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  color: var(--ev-deep, var(--accent-deep));
  z-index: 3;
  box-shadow: 0 4px 14px -8px rgba(31,42,38,.25);
}
.cal-event.is-new {
  outline: 2px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ev, var(--accent)), 0 8px 18px -8px rgba(31,42,38,.3);
  animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cal-event b { font-weight: 600; }
.cal-event .ev-time { font-size: 11px; opacity: .8; }

.summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
}
.summary h3 {
  margin: 0 0 12px;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
}
.summary .row-pair {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  border-top: 1px dashed var(--line-soft);
  gap: 12px;
}
.summary .row-pair:first-of-type { border-top: 0; }
.summary .row-pair .k { color: var(--ink-mute); font-size: 13px; }
.summary .row-pair .v {
  font-weight: 500;
  font-size: 14px;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary .row-pair .v.mono { font-family: var(--f-mono); font-weight: 500; }
.summary .row-pair .v.empty { color: var(--ink-mute); font-style: italic; font-weight: 400; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px 14px 16px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 24px 40px -16px rgba(0,0,0,.4);
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast .check {
  width: 22px; height: 22px; border-radius: 50%;
  background: #34a853; display: grid; place-items: center;
  color: #fff;
}

/* settings drawer */
.settings-overlay {
  position: fixed; inset: 0; background: rgba(31,42,38,.45);
  display: grid; place-items: center; z-index: 60; padding: 24px;
}
.settings-card {
  background: var(--paper); border-radius: var(--r-xl); padding: 28px;
  width: min(560px, 100%); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.3);
}
.settings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.settings-head h3 {
  margin: 0; font-family: var(--f-serif); font-style: italic; font-weight: 400;
  font-size: 28px; color: var(--ink);
}
.settings-p { color: var(--ink-soft); font-size: 14px; margin: 4px 0 16px; }
.settings-p code, .settings-help code {
  font-family: var(--f-mono); font-size: 12px;
  background: var(--bg-deep); padding: 2px 6px; border-radius: 5px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px;
}
.settings-status { font-size: 13px; color: var(--accent); }
.settings-status[data-on="0"] { color: var(--warn); }
.settings-help { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-soft); }

.toast.is-err { background: var(--warn); }
.toast.is-err .check { background: rgba(0,0,0,.25); }

/* ---------- Misc ---------- */
.kbd {
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink-soft);
}

.hr {
  height: 1px;
  background: var(--line-soft);
  border: 0;
  margin: 22px 0;
}

.field-help {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}

/* address w/ map preview */
/* address grid responsive */
.barrier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px;
  background: var(--paper-tint);
}
.barrier-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, background .15s ease;
}
.barrier-row.is-on { border-color: rgba(47,111,92,.35); background: var(--accent-tint); }
.barrier-check {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  display: grid; place-items: center;
  color: var(--accent);
  cursor: pointer; padding: 0;
}
.barrier-check.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.barrier-label { font-weight: 500; font-size: 14px; color: var(--ink); }
.barrier-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.barrier-form-q { font-size: 12px; color: var(--ink-soft); }
.segmented.sm { padding: 3px; }
.segmented.sm button { padding: 5px 12px; font-size: 12px; }
@media (max-width: 560px) {
  .barrier-row { grid-template-columns: 24px 1fr; }
  .barrier-form { grid-column: 1 / -1; padding-left: 36px; }
}
@media (max-width: 560px) {
  .addr-grid { grid-template-columns: 1fr 1fr !important; }
  .addr-grid > :first-child { grid-column: 1 / -1; }
}
.map-thumb {
  height: var(--field-h);
  border-radius: var(--r-md);
  background:
    radial-gradient(circle at 50% 60%, rgba(47,111,92,.14), transparent 60%),
    linear-gradient(135deg, #E9E1CC 0%, #D9CFB4 100%);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.map-thumb::before {
  content:"";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 49%, rgba(255,255,255,.5) 50%, transparent 51%),
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.5) 50%, transparent 51%);
  background-size: 22px 22px;
  opacity: .6;
}
.map-thumb .pin {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-100%);
  color: var(--warn);
}
.map-thumb.empty .pin { display: none; }

/* roadblock */
.flag-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-tint);
}
.flag-row.on {
  background: var(--warn-tint);
  border-color: rgba(194,78,46,.3);
}
.flag-row .flag-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-deep);
  display: grid; place-items: center;
  color: var(--ink-mute);
  flex: 0 0 auto;
}
.flag-row.on .flag-icon { background: var(--warn); color: #fff; }
.flag-row .flag-text { flex: 1; font-size: 14px; }
.flag-row .flag-text b { display: block; font-weight: 600; }
.flag-row .flag-text span { color: var(--ink-mute); font-size: 12px; }
.flag-row.on-accent {
  background: var(--accent-tint);
  border-color: rgba(47,111,92,.3);
}
.flag-row.on-accent .flag-icon { background: var(--accent); color: #fff; }

/* contract amount big */
.amount-field {
  display: flex; align-items: baseline;
  height: var(--field-h);
  padding: 0 16px;
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  gap: 4px;
}
.amount-field:focus-within {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(47,111,92,.12);
}
.amount-field .currency {
  color: var(--ink-mute);
  font-size: 18px;
  font-family: var(--f-serif);
  font-style: italic;
}
.amount-field input {
  flex: 1; min-width: 0;
  appearance: none; border: 0; outline: none; background: transparent;
  font-family: var(--f-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 0;
}
.amount-field .cents {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink-mute);
}
