:root {
  --blue: #1a4b8c;
  --blue-dark: #123761;
  --bg: #f6f7f9;
  --border: #dde1e6;
  --text: #1f2430;
  --muted: #6b7280;
  --green: #1a7f37;
  --red: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }

.muted { color: var(--muted); }
.link-muted { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.link-muted:hover { text-decoration: underline; }

.admin-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.card-narrow { max-width: 360px; margin: 60px auto; }

form { display: flex; flex-direction: column; gap: 10px; }

.inline-form { flex-direction: row; margin-top: 14px; }
.inline-form input { flex: 1; }

label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-top: 6px; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="time"],
textarea {
  width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="time"] {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

button, .btn {
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button[type="submit"], .btn {
  background: var(--blue);
  color: white;
}
button[type="submit"]:hover, .btn:hover { background: var(--blue-dark); }

.btn-secondary {
  background: white;
  color: var(--blue);
  border: 1px solid var(--blue);
  align-self: flex-start;
}

.btn-tiny {
  background: white;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.btn-danger { color: var(--red); border-color: var(--red); }

.status { font-weight: 600; margin-bottom: 12px; }
.status-ok { color: var(--green); }
.status-warn { color: #b7791f; }

.table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.table th, .table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.hours-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.hours-day { width: 130px; display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text); }

.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.checkbox-row label { font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; }

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  margin-top: 2px;
}

textarea {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.type-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.type-option:hover { border-color: var(--blue); }
.type-icon { font-size: 1.8rem; margin-bottom: 8px; }
.public-theme h1, .public-theme h2 { font-family: 'Zilla Slab', serif; }
.type-label { font-weight: 700; margin-bottom: 4px; font-family: 'Zilla Slab', serif; }
.type-desc { font-size: 0.8rem; color: var(--muted); }

.location-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }

.location-option-other {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-style: dashed;
  background: white;
  width: 100%;
  display: block;
  font-size: inherit;
}

.other-location-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.address-autocomplete { position: relative; }

.address-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.address-suggestion-item {
  padding: 9px 12px;
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.address-suggestion-item:last-child { border-bottom: none; }
.address-suggestion-item:hover { background: var(--bg); }
.location-option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
}
.location-option:hover { border-color: var(--blue); }
.location-name { font-weight: 700; }
.location-address { font-size: 0.85rem; color: var(--muted); }

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}
.btn-tiny.disabled { opacity: 0.35; pointer-events: none; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.slot {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 6px;
  text-align: center;
  text-decoration: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}
.slot:hover { background: var(--blue); color: white; }
.slot-button { border: 1px solid var(--border); font-family: inherit; }

.flash-container { margin-bottom: 16px; }

.nowrap { white-space: nowrap; }
.pagination { display: flex; justify-content: space-between; margin-top: 10px; }

.admin-section-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-section-summary::-webkit-details-marker { display: none; }
.admin-section-summary::before {
  content: '\25B8';
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}
.admin-section[open] > .admin-section-summary::before {
  transform: rotate(90deg);
}
.admin-section-summary h2 { margin: 0; }
.admin-section[open] .admin-section-summary { margin-bottom: 14px; }

.preset-url {
  display: inline-block;
  background: #f1f3f9;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.82rem;
  color: var(--blue);
  margin-top: 4px;
}
.preset-form { margin-top: 16px; }
.preset-slug-row { display: flex; align-items: center; gap: 6px; }
.preset-slug-row input { flex: 1; }

.booking-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.booking-row:last-child { border-bottom: none; }
.booking-row-compact { grid-template-columns: 110px 1fr; }

.booking-when { white-space: nowrap; }
.booking-date { font-weight: 700; font-size: 0.95rem; }
.booking-time { color: var(--muted); font-size: 0.85rem; }
.booking-type-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--blue);
  background: #eef2fb;
  border-radius: 4px;
  padding: 2px 6px;
}

.booking-main { min-width: 0; }
.booking-visitor-name { font-weight: 600; }
.booking-where { margin-top: 6px; font-size: 0.9rem; }
.booking-notes { margin-top: 6px; font-size: 0.9rem; color: var(--text); }
.booking-attachment { margin-top: 6px; font-size: 0.85rem; }

.booking-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

@media (max-width: 640px) {
  .booking-row, .booking-row-compact { grid-template-columns: 1fr; gap: 6px; }
  .booking-actions { flex-direction: row; align-items: flex-start; margin-top: 8px; }
}

.version-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 32px;
  opacity: 0.7;
}

/* ===================== Public booking theme (Google-style) ===================== */

.public-theme {
  --g-blue: #2B3991;
  --g-blue-dark: #061260;
  --g-orange: #F7951D;
  --g-orange-dark: #F15A27;
  --g-cyan: #00B0F0;
  --g-text: #061260;
  --g-muted: #5f6368;
  --g-border: #dadce0;
  --g-bg-hover: #E8EAF6;
  --g-disabled: #bdc1c6;
  font-family: 'Abel', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--g-text);
  max-width: 760px;
}

.topbar { display: flex; align-items: center; justify-content: center; padding: 8px 0 20px; }
.topbar-logo { height: 84px; width: auto; }

.public-theme .card {
  border-color: var(--g-border);
  border-radius: 8px;
}

.public-theme input[type="text"],
.public-theme input[type="email"],
.public-theme textarea {
  border-color: var(--g-border);
  border-radius: 4px;
  font-family: inherit;
}

.public-theme button[type="submit"],
.public-theme .btn {
  background: var(--g-blue);
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
}
.public-theme button[type="submit"]:hover,
.public-theme .btn:hover { background: var(--g-blue-dark); }

.public-theme a { color: var(--g-blue); }

.gcal-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.gcal-header-name { font-weight: 500; color: var(--g-text); font-size: 1rem; font-family: 'Space Grotesk', sans-serif; }
.gcal-header-title { font-size: 1.5rem; font-weight: 700; color: var(--g-text); font-family: 'Zilla Slab', serif; }

.gcal-subheader { color: var(--g-muted); font-size: 0.9rem; margin-bottom: 20px; }
.gcal-subheader-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.gcal-duration-form { display: flex; align-items: center; gap: 8px; }
.gcal-meeting-type {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--g-blue, var(--text));
  font-family: 'Zilla Slab', serif;
}
.gcal-duration-label { font-size: 0.85rem; color: var(--g-muted); font-weight: 500; margin: 0; }
.gcal-duration-form select {
  border: 1px solid var(--g-blue);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--g-blue);
  background: white;
  cursor: pointer;
}

.gcal-panel {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  border: 1px solid var(--g-border);
  border-radius: 8px;
  padding: 24px;
  background: white;
}

.gcal-monthcal { width: 280px; flex-shrink: 0; }

.gcal-month-label {
  text-align: center;
  font-weight: 600;
  margin-bottom: 10px;
}
.gcal-month-body {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gcal-month-grid { flex: 1; min-width: 0; }
.gcal-month-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  text-decoration: none;
  color: var(--g-muted);
  font-size: 2.2rem;
  line-height: 1;
}
.gcal-month-arrow:hover { color: var(--g-blue); }

.gcal-weekdays, .gcal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.gcal-weekdays span {
  font-size: 0.7rem;
  color: var(--g-muted);
  padding: 4px 0;
  font-family: 'Space Grotesk', sans-serif;
}
.gcal-week { margin-bottom: 2px; }

.gcal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 2px auto;
  border-radius: 50%;
  text-decoration: none;
  color: var(--g-text);
  font-size: 0.85rem;
}
.gcal-day:hover { background: var(--g-bg-hover); }
.gcal-day-selected, .gcal-day-selected:hover { background: var(--g-blue); color: white; }
.gcal-day-disabled {
  color: var(--g-disabled);
  text-decoration: line-through;
  cursor: default;
}
.gcal-day-outside { opacity: 0.5; }

.gcal-daycol { flex: 1; min-width: 220px; }

.gcal-day-heading { text-align: center; min-width: 70px; margin-bottom: 16px; }
.gcal-day-abbr { display: block; font-size: 0.75rem; color: var(--g-muted); letter-spacing: 0.03em; font-family: 'Space Grotesk', sans-serif; }
.gcal-day-num { display: block; font-size: 1.3rem; font-weight: 600; font-family: 'Zilla Slab', serif; }

.gcal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.gcal-pill {
  border: 1px solid var(--g-blue);
  border-radius: 20px;
  padding: 8px 18px;
  color: var(--g-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  background: white;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
}
.gcal-pill:hover { background: var(--g-orange); border-color: var(--g-orange); color: white; }
.gcal-pill-button { border: 1px solid var(--g-blue); }
.gcal-no-slots { color: var(--g-muted); font-size: 0.9rem; }

.gcal-timezone { text-align: right; color: var(--g-muted); font-size: 0.8rem; margin-top: 12px; }

.gcal-back { margin-top: 16px; }

.link-danger { color: var(--g-orange-dark, #c0392b); }

.btn-cancel-confirm {
  background: var(--g-orange-dark, #c0392b);
  align-self: flex-start;
}
.btn-cancel-confirm:hover { background: #a8321f; }

@media (max-width: 560px) {
  .gcal-panel { flex-direction: column; }
  .gcal-monthcal { width: 100%; }
}

/* ===================== Mobile refinements (both admin and public) ===================== */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 60px; }
  .card { padding: 18px; }
  h1 { font-size: 1.35rem; }
  .hero-title { font-size: 1.7rem; }
  .hero-title .hero-sub { font-size: 1.05rem; }

  .admin-header { flex-wrap: wrap; gap: 8px; }

  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input { width: 100%; }

  .hours-row { flex-wrap: wrap; row-gap: 6px; }
  .hours-day { width: 100%; }

  .checkbox-row { flex-direction: column; gap: 10px; }

  .table th, .table td { padding: 8px 4px; font-size: 0.82rem; }

  button, .btn { min-height: 40px; }

  .gcal-panel { padding: 16px; gap: 20px; }
  .gcal-day { width: 36px; height: 36px; font-size: 0.9rem; }
  .gcal-pill { padding: 10px 16px; min-height: 40px; box-sizing: border-box; }
  .gcal-header-title { font-size: 1.25rem; }
  .gcal-monthcal { width: 100%; }
  .gcal-month-arrow { width: 40px; font-size: 2.4rem; min-height: 44px; }
}

@media (max-width: 380px) {
  .gcal-day { width: 32px; height: 32px; font-size: 0.8rem; }
  .type-grid { grid-template-columns: 1fr; }
}

/* ===================== Hero + option list (Option A) ===================== */

.hero-title {
  font-family: 'Zilla Slab', serif;
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1.05;
  margin: 10px 0 4px;
  color: var(--g-text, var(--text));
  white-space: nowrap;
}
.hero-title .hero-sub {
  display: block;
  color: var(--g-blue, var(--blue));
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 6px;
}
.hero-rule {
  width: 60px;
  height: 5px;
  background: var(--g-orange, #F7951D);
  border-radius: 3px;
  margin: 14px 0 16px;
}
.hero-intro { font-size: 1rem; color: var(--g-muted, var(--muted)); margin-bottom: 22px; }

.opt-list { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--g-border, var(--border));
  border-radius: 14px;
  padding: 15px 16px;
  text-decoration: none;
  color: var(--g-text, var(--text));
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.opt:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(43,57,145,0.12); border-color: var(--g-blue, var(--blue)); }
.opt-other { border-style: dashed; }

.opt-chip { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opt-chip svg { width: 24px; height: 24px; }
.opt-chip.online { background: #e6f6fd; }
.opt-chip.phone { background: #fef1e2; }
.opt-chip.person { background: #fdeae6; }

.opt-title { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 1px; }
.opt-desc { font-size: 0.88rem; color: var(--g-muted, var(--muted)); }
.opt-arrow { margin-left: auto; color: var(--g-orange-dark, #F15A27); font-size: 1.3rem; flex-shrink: 0; }

.attachment-list { margin-top: 4px; }
.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f6f7fb;
  border: 1px solid var(--g-border, var(--border));
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.attachment-info { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0;
}
.attachment-remove:hover { background: var(--g-orange-dark, #F15A27); }
.attachment-remove:hover svg { stroke: white; }
.attachment-note { font-size: 0.78rem; color: var(--g-muted, var(--muted)); margin-top: 2px; }

.field-error {
  color: var(--g-orange-dark, #c0392b);
  font-size: 0.82rem;
  margin: -6px 0 4px;
}

.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 8px;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
.public-theme button[type="submit"]:disabled {
  opacity: 0.85;
  cursor: default;
}

[data-ajax-container] {
  transition: opacity 0.12s ease;
}
[data-ajax-container].gcal-loading {
  opacity: 0.4;
  pointer-events: none;
}
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.flash-success { background: #e6f4ea; color: var(--green); }
.flash-error { background: #fdecea; color: var(--red); }
