/* Hayven wireframes — shared styling */

html,
body {
  margin: 0;
  padding: 0;
  background: var(--hv-bg);
  color: var(--hv-ink);
  /* Body prose defaults to Kalam (hand-written warmth) per CONVENTIONS Brand Voice.
     UI elements (.btn, .input, nav, headings) override via their own classes. */
  font-family: "Kalam", "Patrick Hand", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

:focus-visible {
  outline: 3px solid var(--hv-accent);
  outline-offset: 3px;
}

:root {
  /* default palette: Hay & Haven */
  --hv-bg: #f5efe1;
  --hv-paper: #fbf7ec;
  --hv-ink: #2a2419;
  --hv-ink-2: #5a4f3d;
  --hv-mute: #6e6452;
  --hv-line: #2a2419;
  --hv-accent: #c89d3a; /* hay gold */
  --hv-accent-soft: #ead79a;
  --hv-accent-2: #5d7a4a; /* moss */
  --hv-accent-2-soft: #b8c6a6;
  --hv-error: #9b3d33;
  --hv-stroke: 1.5px;

  /* Warning and error tones for banners and alerts */
  --hv-warning: #f5d6a8;
  --hv-warning-border: #a87a2a;
  --hv-warning-ink: #2a2419;
  --hv-error: #fbe9e6;
  --hv-error-border: #a44;
  --hv-error-ink: #a44;
}

.palette-dusk {
  --hv-bg: #f3ece4;
  --hv-paper: #fbf6ef;
  --hv-accent: #c97a5a;
  --hv-accent-soft: #ebc3b0;
  --hv-accent-2: #6a7a8c;
  --hv-accent-2-soft: #c5cdd6;
}

.palette-forest {
  --hv-bg: #eee8d8;
  --hv-paper: #f7f2e3;
  --hv-accent: #b58a2c;
  --hv-accent-soft: #e3d29a;
  --hv-accent-2: #3d5a3a;
  --hv-accent-2-soft: #a6bca0;
}

.palette-meadow {
  --hv-bg: #edf0e3;
  --hv-paper: #f5f7eb;
  --hv-accent: #e8a83a;
  --hv-accent-soft: #f3d999;
  --hv-accent-2: #4a8062;
  --hv-accent-2-soft: #b3d1bf;
}

/* frame chrome */
.hv-frame {
  background: var(--hv-paper);
  color: var(--hv-ink);
  font-family: "Kalam", "Patrick Hand", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  position: relative;
  overflow: hidden;
}
.hv-frame.mobile {
  border-radius: 28px;
  border: 2.5px solid var(--hv-ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.hv-frame.desktop {
  border-radius: 8px;
  border: 2px solid var(--hv-ink);
}

/* status bar (mobile) */
.hv-status {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--hv-ink);
}
.hv-status .right {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* desktop top chrome — just a hint */
.hv-topbar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1.5px solid var(--hv-ink);
  background: var(--hv-bg);
}
.hv-topbar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.2px solid var(--hv-ink);
}

/* sketchy box primitive */
.box {
  border: var(--hv-stroke) solid var(--hv-line);
  border-radius: 10px;
  padding: 10px;
  background: var(--hv-paper);
}
.box.dashed {
  border-style: dashed;
}
.box.tight {
  padding: 6px 8px;
}
.box.flat {
  border-radius: 0;
}
.box.pill {
  border-radius: 999px;
  padding: 6px 12px;
}
.box.tag {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  background: var(--hv-paper);
}
.box.tag.gold {
  background: var(--hv-accent-soft);
  border-color: var(--hv-accent);
}
.box.tag.moss {
  background: var(--hv-accent-2-soft);
  border-color: var(--hv-accent-2);
}
.box.fill-gold {
  background: var(--hv-accent-soft);
}
.box.fill-moss {
  background: var(--hv-accent-2-soft);
}
.box.fill-ink {
  background: var(--hv-ink);
  color: var(--hv-paper);
}

/* sketchy image placeholder */
.placeholder {
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(42, 36, 25, 0.1) 7px 8px);
  border: var(--hv-stroke) solid var(--hv-line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hv-ink-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  text-align: center;
  padding: 6px;
}
.placeholder.gold {
  background: repeating-linear-gradient(
    135deg,
    var(--hv-accent-soft) 0 7px,
    rgba(200, 157, 58, 0.35) 7px 8px
  );
}
.placeholder.moss {
  background: repeating-linear-gradient(
    135deg,
    var(--hv-accent-2-soft) 0 7px,
    rgba(93, 122, 74, 0.3) 7px 8px
  );
}
.placeholder.paper {
  background: repeating-linear-gradient(
    135deg,
    var(--hv-paper) 0 7px,
    rgba(42, 36, 25, 0.07) 7px 8px
  );
}

/* annotations */
.annot {
  font-family: "Caveat", "Kalam", cursive;
  color: var(--hv-accent);
  font-size: 15px;
  line-height: 1.05;
  position: absolute;
  display: flex;
  gap: 4px;
  align-items: flex-start;
  pointer-events: none;
  max-width: 180px;
}
.annot svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.hide-annots .annot {
  display: none;
}

/* type helpers */
.t-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
}
.t-ui {
  font-family: "Inter Tight", system-ui, sans-serif;
}
.t-display {
  font-family: "Caveat Brush", "Caveat", cursive;
}
.t-hand {
  font-family: "Kalam", cursive;
}
.t-xs {
  font-size: 10px;
}
.t-sm {
  font-size: 12px;
}
.t-md {
  font-size: 14px;
}
.t-lg {
  font-size: 18px;
}
.t-xl {
  font-size: 22px;
}
.t-2xl {
  font-size: 28px;
}
.t-3xl {
  font-size: 36px;
}
.bold {
  font-weight: 700;
}
.semibold {
  font-weight: 600;
}
.mute {
  color: var(--hv-mute);
}
.ink2 {
  color: var(--hv-ink-2);
}
.center {
  text-align: center;
}
.upper {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* layout helpers */
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grow {
  flex: 1;
}
.wrap {
  flex-wrap: wrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  transform: translateY(-200%);
  padding: 10px 14px;
  border: var(--hv-stroke) solid var(--hv-line);
  border-radius: 10px;
  background: var(--hv-paper);
  color: var(--hv-ink);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-weight: 600;
  text-decoration: none;
  z-index: 200;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* hand-drawn squiggly underline */
.squiggle {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='6' viewBox='0 0 60 6'><path d='M0 3 Q 5 0, 10 3 T 20 3 T 30 3 T 40 3 T 50 3 T 60 3' stroke='%23c89d3a' stroke-width='1.5' fill='none'/></svg>");
  background-repeat: repeat-x;
  background-position: bottom left;
  padding-bottom: 4px;
}

/* category icons (low-fi, hand-drawn vibe) */
.cat-icon {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--hv-stroke) solid var(--hv-line);
  border-radius: 14px;
  background: var(--hv-paper);
}

/* nav bar (mobile bottom) */
.hv-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  border-top: 1.5px solid var(--hv-ink);
  background: var(--hv-paper);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 6px;
  font-family: "Inter Tight", sans-serif;
  font-size: 10px;
  z-index: 100;
}
.hv-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--hv-ink-2);
}
.hv-tab.active {
  color: var(--hv-accent);
  font-weight: 700;
}

/* desktop nav */
.hv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1.5px solid var(--hv-ink);
  background: var(--hv-paper);
  font-family: "Inter Tight", sans-serif;
}
.hv-nav a {
  color: inherit;
  text-decoration: none;
}
.hv-nav .brand-link,
.hv-nav .nav-actions {
  display: inline-flex;
  align-items: center;
}
.hv-nav .nav-actions {
  gap: 8px;
}
.hv-nav .links {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.hv-nav .links a {
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  min-height: 20px;
}
.hv-nav .links a.active {
  font-weight: 700;
  border-bottom-color: var(--hv-accent);
}
.hv-nav .account-link {
  padding: 4px 10px;
  font-size: 11px;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--hv-ink);
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.nav-drawer-scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--hv-ink) 50%, transparent);
}
.nav-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--hv-paper);
  border-left: 2.5px solid var(--hv-ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 2001;
}
.drawer-header {
  margin-bottom: 18px;
}
.drawer-heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.drawer-close-button,
.drawer-signout-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.drawer-user-card {
  margin-bottom: 18px;
  padding: 12px;
}
.drawer-section {
  margin-top: 18px;
}
.drawer-section-list {
  margin-top: 6px;
  gap: 4px;
}
.drawer-link {
  display: flex;
  padding: 6px 0;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.drawer-link-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex: 0 0 22px;
}
.drawer-signout-form {
  display: inline;
  flex-grow: 1;
}
.drawer-signout-button {
  text-align: left;
  width: 100%;
}
.drawer-footer {
  margin-top: 36px;
  text-align: center;
}

@media (max-width: 720px) {
  .hv-nav {
    padding: 12px 16px;
  }

  .hv-nav .links,
  .hv-nav .nav-actions > a {
    display: none;
  }

  .hv-nav .nav-actions {
    margin-left: auto;
  }

  .hv-nav .account-link {
    min-width: 44px;
    min-height: 36px;
    justify-content: center;
  }
}

/* logo marks */
.logo-text {
  font-family: "Caveat Brush", "Caveat", cursive;
  font-size: 24px;
  font-weight: 400;
  color: var(--hv-ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-text .dot {
  color: var(--hv-accent);
}

/* density */
.density-airy .hv-frame {
  letter-spacing: 0.01em;
}
.density-packed .box {
  padding: 7px;
}
.density-packed .placeholder {
  padding: 4px;
}

/* small UI atoms */
.btn {
  font-family: "Inter Tight", sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--hv-ink);
  background: var(--hv-paper);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}
.btn.primary {
  background: var(--hv-ink);
  color: var(--hv-paper);
}
.btn.gold {
  background: var(--hv-accent);
  color: var(--hv-ink);
  border-color: var(--hv-ink);
}
.btn.moss {
  background: var(--hv-accent-2);
  color: var(--hv-paper);
  border-color: var(--hv-ink);
}
.btn.ghost {
  background: transparent;
}
.btn.tight {
  padding: 4px 10px;
}
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.saved-remove-btn {
  border: 0;
  background: transparent;
  color: var(--hv-accent);
  cursor: pointer;
  padding: 0;
}
#compare-bar[hidden] {
  display: none !important;
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--hv-accent);
  outline-offset: 3px;
}

.input {
  font-family: "Kalam", cursive;
  font-size: 13px;
  padding: 8px 12px;
  border: 1.5px solid var(--hv-ink);
  border-radius: 10px;
  background: var(--hv-paper);
  color: var(--hv-ink-2);
}

/* grid utilities */
.g-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.g-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.g-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}

/* map sketchy background */
.map-bg {
  background: radial-gradient(circle at 20% 30%, var(--hv-accent-2-soft) 0 60px, transparent 61px),
    radial-gradient(circle at 70% 60%, var(--hv-accent-soft) 0 80px, transparent 81px),
    radial-gradient(circle at 40% 80%, var(--hv-accent-2-soft) 0 50px, transparent 51px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(42, 36, 25, 0.08) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(42, 36, 25, 0.08) 38px 39px),
    var(--hv-bg);
  position: relative;
}
.map-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      90deg,
      transparent 39%,
      rgba(42, 36, 25, 0.2) 40%,
      rgba(42, 36, 25, 0.2) 41%,
      transparent 42%
    ),
    linear-gradient(
      180deg,
      transparent 24%,
      rgba(42, 36, 25, 0.2) 25%,
      rgba(42, 36, 25, 0.2) 26%,
      transparent 27%
    ),
    linear-gradient(
      135deg,
      transparent 64%,
      rgba(42, 36, 25, 0.18) 65%,
      rgba(42, 36, 25, 0.18) 66%,
      transparent 67%
    );
  pointer-events: none;
}

.pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1.5px solid var(--hv-ink);
  background: var(--hv-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  font-family: "Inter Tight", sans-serif;
  font-weight: 700;
  font-size: 10px;
}
.pin > span {
  transform: rotate(45deg);
}
.pin.moss {
  background: var(--hv-accent-2);
  color: var(--hv-paper);
}
.pin.ink {
  background: var(--hv-ink);
  color: var(--hv-paper);
}
.pin.paper {
  background: var(--hv-paper);
}

/* toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--hv-mute);
  border: 1.5px solid var(--hv-ink);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--hv-paper);
  border: 1px solid var(--hv-ink);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle:checked {
  background: var(--hv-accent-2);
}
.toggle:checked::after {
  transform: translateX(18px);
}

.faq-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.faq-category-icon {
  font-size: 22px;
}
.faq-search-icon {
  font-size: 18px;
}
.faq-item {
  padding: 8px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--hv-ink) 10%, transparent);
  cursor: pointer;
}
.faq-arrow {
  transition: transform 0.2s;
  font-size: 14px;
}

.calendar-page-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

.calendar-cell:hover,
.calendar-cell:focus-visible {
  filter: brightness(0.95);
}

@media (max-width: 768px) {
  .calendar-page-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 12px 16px 80px;
  }
}

/* Print: strip fixed UI so signed leases print cleanly. */
@media print {
  .hv-nav,
  .hv-tabbar,
  .hv-topbar,
  .lsign-back-bar,
  .lsign-bottom-bar,
  .ls-bottom-bar,
  .htmx-error-flash {
    display: none !important;
  }
  body {
    background: #fff;
  }
}

/* Pinned to the bottom of the viewport so it never covers the action
   the user is about to retry. Element is constructed by /static/htmx-errors.js. */
.htmx-error-flash {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 360px;
  margin-left: auto;
  padding: 10px 14px;
  background: var(--hv-paper);
  border: 1.5px solid var(--hv-ink);
  border-radius: 8px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hv-overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--hv-ink) 45%, transparent);
  z-index: 100;
}

.hv-overlay-backdrop.dark {
  background: color-mix(in srgb, var(--hv-ink) 85%, transparent);
  z-index: 199;
}

.hv-overlay-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: var(--hv-paper);
  border-top: 2px solid var(--hv-ink);
  border-left: 2px solid var(--hv-ink);
  border-right: 2px solid var(--hv-ink);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--hv-ink) 15%, transparent);
  max-height: 85vh;
  overflow-y: auto;
  z-index: 101;
}

.hv-overlay-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  pointer-events: none;
}

/* Content block within full-screen photos overlay */
.hv-overlay-fullscreen-content {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0;
  background: var(--hv-paper);
  border: 2px solid var(--hv-ink);
  border-radius: 12px;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hv-ink) 30%, transparent);
  z-index: 200;
  pointer-events: auto;
}

[x-cloak] {
  display: none !important;
}
