/* style.css - Master Cross-Platform Mobile Architecture Core */

/* CORE SYSTEM RESET */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body, html { 
    height: 100%; 
    overflow: hidden; 
    background-color: #050811; 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

/* NATIVE SYSTEM MOBILE CONTAINER BOUNDS */
.iphone-frame { 
    width: 100%; 
    max-width: 430px; 
    height: 100vh; 
    max-height: 100vh; 
    margin: 0 auto; 
    padding: 24px 16px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    background: radial-gradient(circle at top right, #0d1527 0%, #050811 100%);
    position: relative;
}

/* CLEAN BOLD HEADER LAYOUT MATRIX */
header { 
    display: flex !important; 
    flex-direction: row !important; 
    align-items: center !important; 
    justify-content: space-between !important; 
    width: 100% !important; 
    padding-bottom: 16px !important; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important; 
    gap: 12px !important;
}
.header-title { 
    font-size: 24px; 
    font-weight: 800; 
    color: #ffffff; 
    letter-spacing: -0.6px;
    white-space: nowrap;
}
.header-sub { 
    font-size: 16px; 
    color: #38bdf8; 
    font-weight: 700; 
    letter-spacing: 0.4px; 
    margin-top: 4px; 
}
.back-nav { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden; }
.back-btn { color: #38bdf8; font-size: 20px; cursor: pointer; flex-shrink: 0; }

/* 📱 MAIN SCREEN VIEW: HOMEPAGE VERTICAL HUB BUTTON STACK */
main.menu-stack { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    padding: 16px 0; 
}

/* HIGH FIDELITY ACTION CORE CONTROLLER BUTTONS */
.app-btn {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(22, 28, 45, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.app-btn:active, .unit-card:active { 
    transform: scale(0.96); 
    background: rgba(30, 41, 59, 0.85); 
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-left { display: flex; align-items: center; gap: 18px; }
.floor-tag { font-size: 20px; font-weight: 900; color: #38bdf8; width: 28px; text-align: center; }
.btn-title { font-size: 16px; font-weight: 700; color: #f8fafc; }
.badge-count { font-size: 12px; font-weight: 600; color: #cbd5e1; background: rgba(15, 23, 42, 0.85); padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.05); display: flex; align-items: center; gap: 6px; }

/* DESIGN MATRICES FOR LOWER INTERFACE BASE BUTTON ROWS */
.com-btn .floor-tag { color: #60a5fa; }
.com-btn { border-color: rgba(59, 130, 246, 0.25); background: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(15, 23, 42, 0.5) 100%); }
.park-btn .floor-tag { color: #34d399; }
.park-btn { border-color: rgba(16, 185, 129, 0.25); background: linear-gradient(135deg, rgba(6, 78, 59, 0.2) 0%, rgba(15, 23, 42, 0.5) 100%); }
.sec-btn .floor-tag { color: #fbbf24; }
.sec-btn { border-color: rgba(245, 158, 11, 0.25); background: linear-gradient(135deg, rgba(120, 53, 15, 0.2) 0%, rgba(15, 23, 42, 0.5) 100%); }

/* 🏢 SCREEN 2 VIEW: THE 24 APARTMENTS COMPACT MATRIX GRID */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    grid-template-rows: repeat(6, 1fr); 
    gap: 10px; 
    padding: 20px 0; 
    flex: 1; 
}
.unit-card { 
    background: linear-gradient(135deg, rgba(22, 28, 45, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%); 
    border: 1px solid rgba(255, 255, 255, 0.06); 
    border-radius: 16px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    position: relative; 
    cursor: pointer; 
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); 
    transition: all 0.12s ease; 
}
.card-vacant { border-color: rgba(255, 255, 255, 0.08); background: rgba(15, 23, 42, 0.4); }
.card-vacant .unit-num-lbl { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.15); }
.card-vacant .unit-type-sub { color: #64748b; }
.card-airbnb { border-color: rgba(251, 191, 36, 0.4); background: linear-gradient(135deg, rgba(120, 53, 15, 0.3) 0%, rgba(22, 28, 45, 0.8) 100%); }
.card-airbnb .unit-num-lbl { color: #fbbf24; text-shadow: 0 0 15px rgba(251, 191, 36, 0.5); }
.card-airbnb .unit-type-sub { color: #fbbf24; opacity: 0.9; font-weight: 800; }
.card-stable { border-color: rgba(16, 185, 129, 0.4); background: linear-gradient(135deg, rgba(6, 78, 59, 0.25) 0%, rgba(22, 28, 45, 0.8) 100%); }
.card-stable .unit-num-lbl { color: #10b981; text-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
.card-stable .unit-type-sub { color: #10b981; opacity: 0.9; font-weight: 800; }
.unit-num-lbl { font-size: 20px; font-weight: 900; letter-spacing: -0.5px; }
.unit-type-sub { font-size: 10px; font-weight: 700; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.6px; }

/* 🏢 SCREEN 3 VIEW: MASTER COMPACT UNIT DETAILS SHEET */
.detail-card { 
    background: rgba(22, 28, 45, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.06); 
    border-radius: 16px; 
    padding: 18px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    display: flex; 
    flex-direction: column; 
    gap: 14px; 
}
.data-field-group { border-bottom: 1px solid rgba(255,255,255,0.03); padding-bottom: 10px; }
.field-title { font-size: 11px; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.display-value { font-size: 16px; font-weight: 800; color: #ffffff; padding: 2px 0; }

/* RE-CALIBRATED INPUT FIELDS LOGIC */
.input-field { 
    width: 100%; 
    padding: 10px; 
    background: #050811; 
    border: 1px solid #38bdf8; 
    border-radius: 8px; 
    color: #fff; 
    font-size: 15px; 
    font-weight: 700; 
    display: none; 
    margin-top: 4px; 
}
.action-row { display: flex; gap: 12px; margin-top: 8px; }
.action-link-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 700; text-decoration: none; transition: transform 0.1s ease; cursor: pointer; border: none; }
.action-link-btn:active { transform: scale(0.96); }

.wa-btn { background: #10b981; color: #fff; }
.mail-btn { background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); color: #38bdf8; }
.edit-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: #94a3b8; width: 100%; }
.save-btn { background: #38bdf8; color: #050811; width: 100%; display: none; }

/* SHARED SYSTEM STATUS FOOTER */
footer { 
    display: flex; 
    justify-content: space-between; 
    padding-top: 12px; 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    font-family: monospace; 
    font-size: 11px; 
    color: #64748b; 
    letter-spacing: 0.2px;
}


/* ===================================================================
   UNIT DETAIL PAGE (unit_detail.php)
   Everything below is scoped to .unit-page / .unit-html so the other
   screens are not affected.
   =================================================================== */

/* This page scrolls normally (the rules above lock the other screens) */
html.unit-html,
body.unit-page { height: auto; min-height: 100%; overflow: visible; }

.unit-page {
    --bg: #060913;
    --surface: #0e1424;
    --surface-2: #141c32;
    --field-bg: #0a0f1d;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f1f5f9;
    --muted: #8b97ad;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --accent-ink: #04121c;
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --radius: 20px;
    --radius-sm: 14px;
    --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    background: radial-gradient(120% 55% at 100% 0%, #10224a 0%, transparent 62%), var(--bg);
    background-repeat: no-repeat;
}

.unit-page *,
.unit-page *::before,
.unit-page *::after { box-sizing: border-box; }
.unit-page [hidden] { display: none !important; }
.unit-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.unit-page .page {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: calc(14px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

/* Top bar */
.unit-page .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.unit-page .topbar__brand {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unit-page .icon-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.12s ease;
}
.unit-page .icon-btn:active { transform: scale(0.94); }

/* Hero */
.unit-page .hero {
    --tone: #94a3b8;
    --tone-soft: rgba(148, 163, 184, 0.12);
    --tone-line: rgba(148, 163, 184, 0.28);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(160deg, var(--tone-soft), transparent 65%), var(--surface);
    border: 1px solid var(--tone-line);
    border-radius: var(--radius);
}
.unit-page .hero--airbnb {
    --tone: #fbbf24;
    --tone-soft: rgba(251, 191, 36, 0.14);
    --tone-line: rgba(251, 191, 36, 0.32);
}
.unit-page .hero--owner {
    --tone: #60a5fa;
    --tone-soft: rgba(96, 165, 250, 0.14);
    --tone-line: rgba(96, 165, 250, 0.32);
}
.unit-page .hero--tenant {
    --tone: #34d399;
    --tone-soft: rgba(52, 211, 153, 0.14);
    --tone-line: rgba(52, 211, 153, 0.32);
}
.unit-page .hero__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.unit-page .hero__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.unit-page .status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 800;
    color: var(--tone);
    background: var(--tone-soft);
    border: 1px solid var(--tone-line);
    border-radius: 999px;
}
.unit-page .status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tone);
}
.unit-page .hero__unit {
    font-size: clamp(40px, 13vw, 54px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

/* Cards */
.unit-page .card {
    margin-top: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.unit-page .card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.unit-page .card__title i {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    font-size: 13px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 10px;
}
.unit-page .fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
}
.unit-page .field { min-width: 0; }
.unit-page .field--wide { grid-column: 1 / -1; }
.unit-page .field dt {
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.unit-page .field dd {
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.unit-page .empty { color: #55627a; font-weight: 500; font-style: italic; }
.unit-page .empty-state { color: var(--muted); font-size: 15px; }

/* Buttons */
.unit-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.unit-page .btn {
    flex: 1 1 120px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}
.unit-page .btn:active { transform: scale(0.97); }
.unit-page .btn:disabled { opacity: 0.6; cursor: default; }
.unit-page .btn--wa { color: var(--accent-ink); background: var(--ok); }
.unit-page .btn--soft { color: var(--accent); background: var(--accent-soft); border-color: rgba(56, 189, 248, 0.28); }
.unit-page .btn--primary { color: var(--accent-ink); background: var(--accent); }
.unit-page .btn--ghost { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

/* History timeline */
.unit-page .timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.unit-page .event {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
}
.unit-page .event:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: -16px;
    width: 2px;
    background: var(--line);
}
.unit-page .event__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    font-size: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
}
.unit-page .event--stay .event__icon { color: var(--ok); background: var(--ok-soft); }
.unit-page .event__body { min-width: 0; padding-top: 2px; }
.unit-page .event__title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.unit-page .event__text { font-size: 14px; opacity: 0.85; }
.unit-page .event__meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.unit-page .event__change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
.unit-page .chip {
    max-width: 100%;
    padding: 3px 9px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    overflow-wrap: anywhere;
}
.unit-page .chip--old { color: var(--danger); background: var(--danger-soft); text-decoration: line-through; }
.unit-page .chip--new { color: var(--ok); background: var(--ok-soft); }

/* Edit sheet */
.unit-page .backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(2, 6, 14, 0.66);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.unit-page .backdrop.is-open { opacity: 1; pointer-events: auto; }

.unit-page .sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    max-height: 92dvh;
    margin: 0 auto;
    padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
}
.unit-page .sheet.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s;
}
.unit-page .sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.unit-page .sheet__head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.unit-page .sheet__group {
    margin: 18px 0 2px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.unit-page .label {
    display: block;
    margin: 12px 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.unit-page .input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px; /* 16px stops iOS zooming into the field */
    font-weight: 600;
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
}
.unit-page .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit-page .input::placeholder { color: #7f8ba3; font-weight: 500; }
.unit-page select.input {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b97ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.unit-page .form-error {
    margin-top: 16px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: 12px;
}
.unit-page .sheet__actions { display: flex; gap: 10px; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
    .unit-page *, .unit-page *::before, .unit-page *::after { transition: none !important; }
}


/* Unit page: two action buttons, checkbox rows, date fields */
.unit-page .hero__actions { display: flex; gap: 10px; }
.unit-page .hero__actions .btn { flex: 1 1 0; padding: 0 10px; }

.unit-page .check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin-top: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.unit-page .check input {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}
.unit-page .input { color-scheme: dark; }
.unit-page .input:disabled { opacity: 0.45; }

/* Unit page: stays list */
.unit-page .stay-group + .stay-group { margin-top: 18px; }
.unit-page .stay-group__title {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.unit-page .stay-list { display: flex; flex-direction: column; gap: 8px; }
.unit-page .stay-row { display: flex; align-items: stretch; gap: 8px; }

.unit-page .stay {
    --tone: #34d399;
    --tone-soft: rgba(52, 211, 153, 0.12);
    --tone-line: rgba(52, 211, 153, 0.3);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 12px 14px;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: linear-gradient(135deg, var(--tone-soft), transparent 70%), var(--field-bg);
    border: 1px solid var(--tone-line);
    border-left: 4px solid var(--tone);
    border-radius: 14px;
    cursor: pointer;
}
.unit-page .stay:active { transform: scale(0.98); }
.unit-page .stay--airbnb {
    --tone: #fbbf24;
    --tone-soft: rgba(251, 191, 36, 0.12);
    --tone-line: rgba(251, 191, 36, 0.3);
}
.unit-page .stay--owner {
    --tone: #60a5fa;
    --tone-soft: rgba(96, 165, 250, 0.12);
    --tone-line: rgba(96, 165, 250, 0.3);
}
.unit-page .stay-group--past .stay { opacity: 0.7; }

.unit-page .stay__top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.unit-page .stay__name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.unit-page .stay__type {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tone);
}
.unit-page .stay__meta { font-size: 13px; color: var(--muted); }
.unit-page .stay__wa {
    flex-shrink: 0;
    width: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent-ink);
    text-decoration: none;
    background: var(--ok);
    border-radius: 14px;
}

/* Unit page: delete button, success banner, spacer in the top bar */
.unit-page .btn--danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.3); }
.unit-page .sheet__delete { width: 100%; margin-top: 12px; }
.unit-page .topbar__spacer { flex-shrink: 0; width: 44px; }
.unit-page .banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}
.unit-page .banner--ok { color: var(--ok); background: var(--ok-soft); border: 1px solid rgba(52, 211, 153, 0.3); }
.unit-page .banner a { color: inherit; text-decoration: underline; }


/* Unit page: phone numbers bold white, and a History card that opens on tap */
.unit-page .field--phone dd,
.unit-page .field--phone dd a {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}
.unit-page a[x-apple-data-detectors] {
    color: inherit !important;
    font: inherit !important;
    text-decoration: none !important;
}
.unit-page .input[type="tel"] { font-weight: 800; letter-spacing: 0.01em; }

.unit-page .history__summary {
    margin-bottom: 0;
    min-height: 44px;
    list-style: none;
    cursor: pointer;
}
.unit-page .history__summary::-webkit-details-marker { display: none; }
.unit-page .history[open] .history__summary { margin-bottom: 16px; }
.unit-page .history__count {
    padding: 2px 9px;
    font-size: 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.unit-page .history__chev { margin-left: auto; font-size: 13px; transition: transform 0.2s ease; }
.unit-page .history[open] .history__chev { transform: rotate(180deg); }


/* ===================================================================
   MAIN PAGE (index.html)
   Scoped to .home-page / .home-html so the other screens are not affected.
   =================================================================== */

/* This page may scroll on small phones (the rules at the top lock other screens) */
html.home-html,
body.home-page { height: auto; min-height: 100%; overflow: visible; }

.home-page {
    --bg: #060913;
    --surface: #0e1424;
    --text: #f1f5f9;
    --muted: #8b97ad;
    --accent: #38bdf8;
    --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-num: "Space Grotesk", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font);
    -webkit-text-size-adjust: 100%;
    background: radial-gradient(120% 55% at 100% 0%, #10224a 0%, transparent 62%), var(--bg);
    background-repeat: no-repeat;
}

.home-page *,
.home-page *::before,
.home-page *::after { box-sizing: border-box; }
.home-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.home-page .home {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px; /* one equal gap between every button */
    padding: calc(20px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom));
}

/* Title block: title first, subtitle directly underneath */
.home-page .home__head { margin-bottom: 10px; }
.home-page .home__title {
    font-size: clamp(20px, 5.6vw, 26px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}
.home-page .home__sub {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

/* The groups add no box of their own, so all ten buttons share one list,
   with equal height and equal gaps. They fill the screen and scroll on small phones. */
.home-page .home__group { display: contents; }

.home-page .tile {
    --tone: #38bdf8;
    --tone-soft: rgba(56, 189, 248, 0.12);
    --tone-line: rgba(56, 189, 248, 0.24);
    position: relative;
    flex: 1 1 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 0 22px;
    color: var(--text);
    text-decoration: none;
    background: linear-gradient(135deg, var(--tone-soft), transparent 70%), var(--surface);
    border: 1px solid var(--tone-line);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.home-page .tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24%;
    bottom: 24%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--tone);
}
.home-page .tile:active { transform: scale(0.98); border-color: var(--tone); }

/* All ten buttons share one font, weight and size, so "Commercial Sector" fits on one line */
.home-page .tile__name {
    font-family: var(--font-num);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.home-page .tile__meta { display: flex; align-items: center; gap: 10px; }
.home-page .tile__count {
    padding: 5px 12px;
    font-size: 13px;
    white-space: nowrap;
    font-weight: 700;
    color: var(--tone);
    background: var(--tone-soft);
    border: 1px solid var(--tone-line);
    border-radius: 999px;
}
.home-page .tile__chev { font-size: 14px; color: var(--muted); }

.home-page .tile--commercial {
    --tone: #60a5fa;
    --tone-soft: rgba(96, 165, 250, 0.14);
    --tone-line: rgba(96, 165, 250, 0.30);
}
.home-page .tile--parking {
    --tone: #34d399;
    --tone-soft: rgba(52, 211, 153, 0.14);
    --tone-line: rgba(52, 211, 153, 0.30);
}
.home-page .tile--security {
    --tone: #fbbf24;
    --tone-soft: rgba(251, 191, 36, 0.14);
    --tone-line: rgba(251, 191, 36, 0.30);
}

.home-page footer { margin-top: 8px; }

@media (max-width: 360px) {
    .home-page .tile__name { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *, .home-page *::before, .home-page *::after { transition: none !important; }
}


/* ===================================================================
   FLOOR PAGE (floor_view.php)
   Scoped to .floor-page / .floor-html so the other screens are not affected.
   =================================================================== */

html.floor-html,
body.floor-page { height: auto; min-height: 100%; overflow: visible; }

.floor-page {
    --bg: #060913;
    --surface: #0e1424;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f1f5f9;
    --muted: #8b97ad;
    --accent: #38bdf8;
    --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-num: "Space Grotesk", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font);
    -webkit-text-size-adjust: 100%;
    background: radial-gradient(120% 55% at 100% 0%, #10224a 0%, transparent 62%), var(--bg);
    background-repeat: no-repeat;
}

.floor-page *,
.floor-page *::before,
.floor-page *::after { box-sizing: border-box; }
.floor-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.floor-page .floor {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom));
}

/* Title block */
.floor-page .floor__head { display: flex; align-items: center; gap: 14px; }
.floor-page .icon-btn {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 17px;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: transform 0.12s ease;
}
.floor-page .icon-btn:active { transform: scale(0.94); }
.floor-page .floor__titles { min-width: 0; }
.floor-page .floor__title {
    font-family: var(--font-num);
    font-size: clamp(22px, 6.6vw, 30px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.floor-page .floor__sub {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

/* "Live occupancy on" date row: one slim line between the title and the grid */
.floor-page .floor__when {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.floor-page .floor__when-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.floor-page .floor__when-controls { display: flex; align-items: center; gap: 8px; }
.floor-page .floor__date {
    width: 140px;
    height: 40px;
    min-width: 0;
    padding: 0 12px;
    font-family: var(--font-num);
    font-size: 16px; /* 16px stops iOS zooming in */
    font-weight: 700;
    line-height: 40px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
}
.floor-page .floor__date.is-other { color: var(--accent); border-color: var(--accent); }
.floor-page .floor__today {
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 800;
    color: #04121c;
    text-decoration: none;
    background: var(--accent);
    border-radius: 12px;
}

/* The 24 apartments: 4 columns x 6 rows, filling the screen */
.floor-page .tiles {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, minmax(64px, 1fr));
    gap: 10px;
}
.floor-page .tiles__empty {
    grid-column: 1 / -1;
    padding-top: 24px;
    text-align: center;
    color: var(--muted);
}

.floor-page .tile {
    --tone: #64748b;
    --num: #e2e8f0;
    --tone-soft: rgba(255, 255, 255, 0.03);
    --tone-line: rgba(255, 255, 255, 0.08);
    --tone-glow: rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    background: linear-gradient(160deg, var(--tone-soft), transparent 75%), var(--surface);
    border: 1px solid var(--tone-line);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s ease;
}
.floor-page .tile:active { transform: scale(0.95); }

.floor-page .tile__num {
    font-family: var(--font-num);
    font-size: clamp(28px, 8.6vw, 38px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--num);
    text-shadow: 0 0 18px var(--tone-glow);
}
.floor-page .tile__status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tone);
}

.floor-page .tile--airbnb {
    --tone: #fbbf24;
    --num: #fbbf24;
    --tone-soft: rgba(251, 191, 36, 0.14);
    --tone-line: rgba(251, 191, 36, 0.38);
    --tone-glow: rgba(251, 191, 36, 0.45);
}
.floor-page .tile--tenant {
    --tone: #34d399;
    --num: #34d399;
    --tone-soft: rgba(52, 211, 153, 0.14);
    --tone-line: rgba(52, 211, 153, 0.38);
    --tone-glow: rgba(52, 211, 153, 0.45);
}
.floor-page .tile--owner {
    --tone: #60a5fa;
    --num: #60a5fa;
    --tone-soft: rgba(96, 165, 250, 0.14);
    --tone-line: rgba(96, 165, 250, 0.38);
    --tone-glow: rgba(96, 165, 250, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .floor-page *, .floor-page *::before, .floor-page *::after { transition: none !important; }
}
