:root {
  --ink: #17211d;
  --muted: #65736d;
  --line: #dbe3dd;
  --page: #f3f5f0;
  --panel: #ffffff;
  --accent: #136b5b;
  --danger: #a9443b;
  --shadow: 0 18px 48px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 5vw, 54px);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

nav a {
  margin-left: 14px;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 460px;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #ffffff;
}

.hero img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(18, 26, 23, 0.78), rgba(18, 26, 23, 0.16));
}

.hero-content {
  max-width: 760px;
  padding: 80px clamp(18px, 5vw, 54px);
}

.hero-content p,
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-content p {
  color: #dbeee6;
}

.hero-content h1 {
  margin: 0 0 14px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.98;
}

.hero-content span {
  display: block;
  max-width: 620px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.intro-band,
.location-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 5vw, 54px);
  padding: clamp(34px, 7vw, 82px) clamp(18px, 5vw, 54px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.intro-band h2,
.location-band h2,
.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.04;
}

.intro-band p,
.location-band p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.location-band {
  grid-template-columns: 1fr;
}

.location-copy {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 5vw, 54px);
}

.environment-strip {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr 1.1fr;
  gap: 8px;
  margin-top: 30px;
}

.environment-strip img {
  display: block;
  width: 100%;
  height: clamp(160px, 18vw, 260px);
  object-fit: cover;
  border-radius: 6px;
}

.apartment-section {
  padding: clamp(34px, 7vw, 82px) clamp(18px, 5vw, 54px);
}

.section-title {
  max-width: 760px;
  margin-bottom: 28px;
}

.apartment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: stretch;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.apartment-card.reverse {
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
}

.apartment-card.reverse .apartment-copy {
  grid-column: 2;
}

.apartment-card.reverse .photo-gallery {
  grid-column: 1;
  grid-row: 1;
}

.apartment-copy {
  padding: clamp(20px, 4vw, 34px);
}

.apartment-copy h3 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.apartment-copy p {
  margin: 0 0 18px;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 22px;
  font-weight: 800;
}

.feature-list li::before {
  position: absolute;
  left: 0;
  content: "";
  width: 8px;
  height: 8px;
  top: 0.65em;
  border-radius: 999px;
  background: var(--accent);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 156px;
  gap: 8px;
  padding: 8px;
  background: #f3f0e9;
}

.photo-gallery figure {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #d9d3c9;
}

.photo-gallery figure.large {
  grid-row: span 2;
}

.photo-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-gallery figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(18, 26, 23, 0.72);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
}

.rules-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 0 clamp(18px, 5vw, 54px) clamp(34px, 7vw, 82px);
}

.rule-item {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.rule-item strong {
  color: var(--accent);
}

.rule-item span {
  color: var(--muted);
}

.panel {
  margin: clamp(20px, 5vw, 54px);
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: clamp(20px, 4vw, 38px);
}

.admin-layout .panel {
  margin: 0;
}

.section-head p {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-head h1 {
  margin: 0 0 18px;
}

.form-grid,
.guest-row,
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

form > label,
.guest-box,
.rules,
.message {
  margin-top: 16px;
}

.guest-box,
.rules {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.guest-box h2 {
  margin: 0 0 4px;
}

.guest-box p {
  margin: 0 0 14px;
  color: var(--muted);
}

#guest-list {
  display: grid;
  gap: 12px;
}

.choice-grid {
  align-items: end;
}

.is-disabled {
  opacity: 0.55;
}

button {
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  text-decoration: none;
}

.button-link.is-disabled-link {
  pointer-events: none;
  opacity: 0.45;
}

button.secondary {
  background: #ffffff;
  color: var(--accent);
}

button.danger {
  border-color: var(--danger);
  background: #fff5f4;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.message {
  color: var(--accent);
  font-weight: 900;
}

.record-list {
  display: grid;
  gap: 12px;
}

.record {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.record.is-cancelled {
  opacity: 0.68;
  background: #f4f2ef;
}

.record h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.record p {
  margin: 4px 0;
  color: var(--muted);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f1ed;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-body {
  min-height: 100vh;
  background: #eef2ed;
}

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

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.side-brand span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-tab {
  width: 100%;
  min-height: 42px;
  margin: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-tab:hover,
.nav-tab.active {
  border-color: #d5e7df;
  background: #edf6f2;
  color: var(--accent);
}

.public-link {
  display: block;
  margin-top: 26px;
  color: var(--accent);
  font-weight: 900;
}

.admin-main {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

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

.admin-top h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sync-state {
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: right;
}

.sync-state span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.sync-state strong {
  display: block;
  font-size: 1.1rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.demo-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.demo-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.demo-panel button {
  flex: 0 0 auto;
  margin: 0;
}

.metric-card,
.app-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 33, 29, 0.08);
}

.metric-card {
  min-height: 112px;
  padding: 18px;
}

.metric-card span {
  display: block;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
}

.app-panel {
  padding: 18px;
}

.tab-panel > .app-panel + .app-panel {
  margin-top: 18px;
}

.section-head.compact h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.record-list {
  align-content: start;
}

.record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.record h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
}

.note {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.empty-state,
.placeholder-panel {
  color: var(--muted);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.empty-state strong {
  display: block;
  color: var(--ink);
}

.empty-state p,
.placeholder-panel p {
  margin: 6px 0 0;
}

.hidden {
  display: none !important;
}

.alert-panel {
  margin-bottom: 18px;
  border-color: #e1b5af;
  background: #fff5f4;
  color: var(--danger);
}

.alert-panel strong {
  display: block;
  margin-bottom: 6px;
  color: var(--danger);
}

.alert-panel p {
  margin: 0;
  color: var(--ink);
}

.alert-panel button {
  margin-top: 12px;
}

.payment-record {
  border-left: 4px solid var(--line);
}

.payment-matched {
  border-left-color: var(--accent);
}

.payment-possible {
  border-left-color: #c68a1a;
}

.arrival-mail-record {
  border-left: 4px solid var(--line);
}

.arrival-ready,
.arrival-sent {
  border-left-color: var(--accent);
}

.arrival-blocked {
  border-left-color: var(--danger);
}

.mail-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.mail-preview pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: var(--ink);
}

.break-text {
  overflow-wrap: anywhere;
}

.calendar-export-record,
.calendar-feed-record {
  border-left: 4px solid var(--accent);
}

.calendar-feed-record.has-error {
  border-left-color: var(--danger);
  background: #fffafa;
}

.record.has-warning {
  border-left: 4px solid #c47f17;
  background: #fffaf0;
}

.warning-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #7a4a06;
  font-weight: 800;
}

.compact-metrics {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.calendar-sync-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
  color: var(--muted);
  font-weight: 900;
}

.calendar-sync-toolbar button {
  margin-top: 0;
  flex: 0 0 auto;
}

.availability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.availability-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.availability-legend i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.legend-free {
  background: #ffffff;
}

.legend-option {
  background: #fff3c4;
}

.legend-booked {
  background: #b9463f;
}

.legend-external {
  background: #365f7c;
}

.availability-calendars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.availability-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.availability-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.availability-months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.availability-month {
  min-width: 0;
}

.availability-month h4 {
  margin: 0 0 10px;
  text-transform: capitalize;
}

.availability-weekdays,
.availability-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.availability-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.availability-day {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.availability-day.is-empty {
  border-color: transparent;
  background: transparent;
}

.availability-day.is-today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.availability-day.is-option {
  border-color: #e3bc40;
  background: #fff3c4;
}

.availability-day.is-booked {
  border-color: #b9463f;
  background: #b9463f;
  color: #ffffff;
}

.availability-day.is-external {
  border-color: #365f7c;
  background: #365f7c;
  color: #ffffff;
}

.deposit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
  color: var(--muted);
  font-weight: 900;
}

.deposit-toolbar button {
  margin-top: 0;
}

.select-row {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
}

.select-row input {
  width: 18px;
  min-height: 18px;
}

.link-payment-form,
.deposit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.link-payment-form button,
.deposit-form button,
.deposit-form label:last-of-type {
  grid-column: 1 / -1;
}

.link-payment-form button,
.deposit-form button {
  margin-top: 0;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 860px;
}

.wide-field {
  grid-column: 1 / -1;
}

.rate-period-form {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.inline-form,
.discount-form {
  display: grid;
  gap: 16px;
}

.inline-form {
  grid-template-columns: minmax(180px, 260px) auto minmax(0, 1fr);
  align-items: end;
}

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

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

.settings-form button,
.settings-form .message,
.rate-period-form button,
.rate-period-form .message,
.inline-form .message,
.discount-form button,
.discount-form .message {
  grid-column: 1 / -1;
}

.settings-form .message,
.rate-period-form .message,
.inline-form .message,
.discount-form .message {
  margin-top: 0;
  min-height: 24px;
}

.rate-periods-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.rate-period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.rate-period span {
  display: block;
  color: var(--muted);
}

.compact-button {
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
}

.invoice-record {
  background: #ffffff;
}

.invoice-lines {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.invoice-lines div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.invoice-lines span {
  color: var(--muted);
}

.invoice-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 1.08rem;
}

.invoice-total span,
.invoice-total strong {
  color: var(--ink);
}

.invoice-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.invoice-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
  color: var(--ink);
}

.invoice-checks input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 880px) {
  .topbar,
  .admin-layout {
    grid-template-columns: 1fr;
  }

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

  .form-grid,
  .guest-row,
  .choice-grid,
  .settings-form,
  .rate-period-form,
  .inline-form,
  .discount-form,
  .link-payment-form,
  .deposit-form,
  .rate-period {
    grid-template-columns: 1fr;
  }

  .admin-app,
  .metric-grid,
  .workspace-grid,
  .intro-band,
  .location-band,
  .location-copy,
  .apartment-card,
  .apartment-card.reverse,
  .availability-calendars,
  .rules-band {
    grid-template-columns: 1fr;
  }

  .apartment-card.reverse .apartment-copy,
  .apartment-card.reverse .photo-gallery {
    grid-column: auto;
    grid-row: auto;
  }

  .photo-gallery {
    grid-auto-rows: 138px;
  }

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

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a {
    margin-left: 0;
  }

  .demo-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-sync-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .availability-months {
    grid-template-columns: 1fr;
  }

  .deposit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .admin-top {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-state {
    text-align: left;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}
