/* VBR Platform — Heritage light theme */

:root {
    --bg: #ffffff;
    --bg-card: #faf9f7;
    --bg-card-hover: #f0efec;
    --bg-input: #f5f4f2;
    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #a0a0a0;
    --accent: #2c2c2c;
    --accent-light: #505050;
    --accent-dim: rgba(44, 44, 44, 0.08);
    --green: #2d7a50;
    --green-dim: rgba(45, 122, 80, 0.1);
    --red: #b83a3a;
    --red-dim: rgba(184, 58, 58, 0.08);
    --orange: #c5a03d;
    --orange-dim: rgba(197, 160, 61, 0.1);
    --blue: #4a7bb5;
    --blue-dim: rgba(74, 123, 181, 0.08);
    --border: #e8e6e1;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 4px rgba(0,0,0,0.06);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-heading: 'Marcellus', Georgia, 'Times New Roman', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; touch-action: manipulation; }

html {
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
}
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ---- Material Symbols: filled variant ---- */
.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}

/* ---- App Shell ---- */

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    height: 18px;
    width: auto;
    opacity: 0.8;
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text);
}

.header-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.header-back:active { opacity: 0.7; }

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

/* ---- Conversation Search ---- */

.conv-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.conv-search-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.conv-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    font-family: var(--font);
    padding: 4px 0;
}

.conv-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ---- Conversation List ---- */

.conv-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.conv-item:active { background: var(--bg-card-hover); }

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.conv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conv-body {
    flex: 1;
    min-width: 0;
}

.conv-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.conv-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.conv-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conv-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.conv-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-attention {
    background: var(--red-dim);
    color: var(--red);
}

.badge-platform {
    background: var(--blue-dim);
    color: var(--blue);
}

.badge-current {
    background: var(--green-dim);
    color: var(--green);
}

.badge-future {
    background: var(--blue-dim);
    color: var(--blue);
}

.badge-past {
    background: transparent;
    color: var(--text-muted);
}

.badge-inquiry {
    background: var(--orange-dim);
    color: var(--orange);
}

.badge-request {
    background: var(--orange-dim);
    color: var(--orange);
}

.badge-cancelled {
    background: var(--red-dim);
    color: var(--red);
    text-decoration: line-through;
}

.badge-listing {
    background: var(--accent-dim);
    color: var(--accent-light);
    text-transform: none;
    letter-spacing: normal;
}
/* Nights + total spend on confirmed bookings — neutral grey so they read
 * as info rather than action. Slightly muted to keep the listing/platform
 * badges as the primary anchors. */
.badge-nights,
.badge-spend {
    background: var(--bg-card-hover, rgba(0,0,0,0.04));
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
    font-variant-numeric: tabular-nums;
}

.badge-plat-airbnb {
    background: var(--red-dim);
    color: var(--red);
    text-transform: none;
    letter-spacing: normal;
}
.badge-plat-booking {
    background: var(--blue-dim);
    color: var(--blue);
    text-transform: none;
    letter-spacing: normal;
}
.badge-plat-vrbo {
    background: #f3f2ef;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
}
.badge-plat-direct {
    background: var(--green-dim);
    color: var(--green);
    text-transform: none;
    letter-spacing: normal;
}

.conv-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    user-select: none;
}
.conv-section-header:active { background: var(--bg-card-hover); }
.conv-section-chevron { color: var(--text-muted); }

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Message Thread ---- */

.thread-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.guest-context {
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.guest-context-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--text-secondary);
}

.guest-context-info strong {
    color: var(--text);
}

.messages-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
}

.msg-guest {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-host {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-ai-auto {
    align-self: flex-end;
    background: var(--green);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-template {
    align-self: flex-end;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-bottom-right-radius: 4px;
    font-size: 0.82rem;
}

.msg-preview {
    align-self: flex-end;
    background: transparent;
    border: 2px dashed var(--border);
    color: var(--text-secondary);
    border-bottom-right-radius: 4px;
    font-size: 0.85rem;
}

.msg-preview-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-preview .msg-time { color: var(--text-muted); }

/* Image attachments in message bubbles */
.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.msg-attachments:first-child { margin-top: 0; }
.msg-attachment-img {
    display: block;
    max-width: 220px;
    max-height: 260px;
    border-radius: 10px;
    cursor: zoom-in;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    object-fit: cover;
}
.msg-host .msg-attachment-img,
.msg-ai-auto .msg-attachment-img { border-color: rgba(255,255,255,0.25); }
.msg-attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}
.msg-attachment-link:hover { text-decoration: underline; }
.msg-host .msg-attachment-link,
.msg-ai-auto .msg-attachment-link { color: rgba(255,255,255,0.9); }

/* Full-screen image viewer */
.msg-img-viewer {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}
.msg-img-viewer img {
    max-width: 96vw; max-height: 96vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* Soft-cancelled scheduled preview: muted, strikethrough */
.msg-preview-cancelled {
    opacity: 0.55;
    border-style: dotted;
}
.msg-preview-cancelled > div:not(.msg-preview-label):not(.msg-preview-actions):not(.msg-time) {
    text-decoration: line-through;
}
.msg-preview-cancelled .msg-preview-label {
    color: var(--text-muted);
}

/* Edit / cancel / restore button row on preview bubbles */
.msg-preview-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.msg-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.msg-preview-btn:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
    color: var(--text);
}
.msg-preview-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.msg-preview-btn .material-symbols-outlined { font-size: 14px; }
.msg-preview-btn-cancel:hover,
.msg-preview-btn-cancel-edit:hover { border-color: #c62828; color: #c62828; }
.msg-preview-btn-save:hover,
.msg-preview-btn-restore:hover { border-color: var(--accent); color: var(--accent); }

/* Inline edit textarea for previews */
.msg-preview-edit-box {
    margin: 4px 0 6px;
}
.msg-preview-edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}
.msg-preview-edit-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.msg-preview-edit-buttons {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}

.thread-scheduled-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    margin: 8px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.thread-scheduled-header .material-symbols-outlined { font-size: 1rem; }

.msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.msg-host .msg-time { color: rgba(255,255,255,0.6); }
.msg-ai-auto .msg-time { color: rgba(255,255,255,0.6); }

.msg-confidence {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    margin-left: 6px;
}

.msg-status {
    font-size: 0.6rem;
    margin-left: 4px;
}

/* ---- Compose Bar ---- */

.compose-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.compose-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: var(--font);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
}

.compose-input:focus { border-color: var(--accent); }

.compose-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compose-send:active { opacity: 0.8; }
.compose-send:disabled { opacity: 0.3; }

/* ---- Copilot Panel ---- */

.copilot-panel {
    padding: 12px 16px;
    background: #f0f7f2;
    border-top: 1px solid rgba(45, 122, 80, 0.15);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.copilot-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Shimmer placeholder for where the draft field will appear while
   the drafter is fetching live availability + calling Gemini. */
.copilot-draft-shimmer {
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        rgba(45, 122, 80, 0.04) 0%,
        rgba(45, 122, 80, 0.12) 50%,
        rgba(45, 122, 80, 0.04) 100%
    );
    background-size: 200% 100%;
    animation: copilot-shimmer 1.4s ease-in-out infinite;
}

@keyframes copilot-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.copilot-confidence {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: right;
}

.copilot-draft-field {
    width: 100%;
    border: 1px solid rgba(45, 122, 80, 0.25);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-family: var(--font);
    line-height: 1.5;
    color: var(--text);
    resize: none;
    outline: none;
    min-height: 60px;
    max-height: 200px;
}

.copilot-draft-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(45, 122, 80, 0.1);
}

.copilot-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.copilot-task-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.copilot-task-chip .material-symbols-outlined {
    font-size: 16px;
    color: var(--accent);
}

.copilot-action-btn {
    background: var(--accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    cursor: pointer;
}

.copilot-action-denied {
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 4px 10px;
    background: #fef2f2;
    border-radius: 6px;
}

/* Applied-at-draft-time actions — informational only, not clickable.
   Used for priority_checkin where the flag was flipped when the draft
   was generated, so there's nothing for the owner to execute. */
.copilot-action-applied {
    font-size: 0.8rem;
    color: #92400e;
    padding: 4px 10px;
    background: #fef3c7;
    border-radius: 6px;
}

.copilot-history {
    font-size: 0.8rem;
}

.copilot-history-toggle {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 0;
    text-decoration: underline;
}

.copilot-history-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.copilot-history-item {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.copilot-history-owner {
    background: #e8f4fd;
    color: var(--text);
}

.copilot-history-ai {
    background: #f0f7f2;
    color: var(--text-dim);
}

.copilot-bottom-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.copilot-instruct-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: var(--font);
    outline: none;
    background: #fff;
    color: var(--text);
}

.copilot-instruct-input:focus {
    border-color: var(--accent);
}

.copilot-instruct-input::placeholder {
    color: var(--text-dim);
}

.copilot-refine-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.copilot-refine-btn:hover {
    background: var(--bg-alt);
    color: var(--accent);
    border-color: var(--accent);
}

.copilot-refine-btn .material-symbols-outlined {
    font-size: 18px;
}

.copilot-send-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}

.copilot-send-btn:hover {
    opacity: 0.9;
}

.copilot-send-btn .material-symbols-outlined {
    font-size: 16px;
}

/* ---- Compose Row ---- */

.compose-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.compose-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: var(--font);
    outline: none;
    background: #fafafa;
    color: var(--text);
    resize: none;
    overflow: hidden;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.4;
}

.compose-input:focus {
    border-color: var(--accent);
    background: #fff;
}

.compose-ai-btn,
.compose-send-btn {
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.compose-ai-btn {
    background: #f0f0f0;
    color: var(--accent);
}

.compose-ai-btn:hover {
    background: #e4e4e4;
}

.compose-send-btn {
    background: var(--accent);
    color: #fff;
}

.compose-send-btn:hover {
    opacity: 0.9;
}

.compose-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compose-ai-btn .material-symbols-outlined,
.compose-send-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ---- Translation Toggle ---- */

.msg-translate-toggle {
    font-size: 0.7rem;
    color: var(--accent);
    cursor: pointer;
    margin-top: 4px;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.msg-translate-toggle:active { opacity: 1; }

/* ---- AI Draft Panel ---- */

.draft-panel {
    padding: 12px 16px;
    background: var(--green-dim);
    border-top: 1px solid rgba(45, 122, 80, 0.2);
    flex-shrink: 0;
}

.draft-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-size: 0.85rem;
    padding: 4px 0;
}

.draft-loading .spinner {
    border-top-color: var(--green);
}

.draft-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.draft-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green);
}

.draft-confidence {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(45, 122, 80, 0.15);
    color: var(--green);
    font-weight: 600;
}

.draft-body {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(45, 122, 80, 0.15);
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.draft-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.draft-btn-use {
    background: var(--green) !important;
    color: #fff !important;
}

.draft-btn-edit {
    background: var(--accent) !important;
    color: #fff !important;
}

.draft-btn-regen {
    background: transparent !important;
    color: var(--green) !important;
    border: 1px solid rgba(45, 122, 80, 0.3) !important;
}

.draft-btn-dismiss {
    background: transparent !important;
    color: var(--text-muted) !important;
}

.draft-instruct-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.draft-instruct-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid rgba(45, 122, 80, 0.25);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.draft-instruct-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.draft-instruct-input:focus { border-color: var(--green); }

.draft-btn-instruct {
    background: var(--green) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px 8px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* AI-suggested tasks in draft panel */
.draft-task-suggestions {
    margin: 8px 0;
    padding: 8px 10px;
    background: rgba(45, 122, 80, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(45, 122, 80, 0.15);
}

.draft-task-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green);
    display: block;
    margin-bottom: 6px;
}

.draft-task-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.draft-task-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid rgba(45, 122, 80, 0.15);
}

.draft-task-chip.draft-task-created {
    opacity: 0.5;
}

.draft-task-icon {
    font-size: 16px;
    color: var(--green);
}

.draft-task-name {
    flex: 1;
    font-size: 0.82rem;
    text-transform: capitalize;
}

.draft-task-approve {
    background: var(--green) !important;
    color: #fff !important;
    padding: 2px 10px !important;
    font-size: 0.72rem !important;
}

.draft-task-approve:disabled {
    opacity: 0.6;
}

/* Bag storage action button (separate from send) */
.draft-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--green) 8%, transparent);
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
}
.draft-action-btn {
    background: var(--green) !important;
    color: #fff !important;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 14px !important;
}
.draft-action-btn:disabled { opacity: 0.7; }
.draft-action-done {
    background: color-mix(in srgb, var(--green) 20%, transparent) !important;
    color: var(--green) !important;
}
.draft-action-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
/* Bag storage denied badge */
.draft-action-badge { padding: 6px 12px; border-radius: 8px; font-size: 0.82rem; font-weight: 500; margin-top: 4px; }
.draft-action-denied {
    background: color-mix(in srgb, var(--red) 15%, transparent);
    color: var(--red);
    border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
}

/* AI-drafted message that was sent (human-approved) */
.msg-ai-draft-sent {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    position: relative;
}

.msg-ai-draft-sent::after {
    content: 'AI';
    position: absolute;
    top: -8px;
    right: 8px;
    font-size: 0.55rem;
    font-weight: 700;
    background: var(--green);
    color: #fff;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

.msg-ai-draft-sent .msg-time { color: rgba(255,255,255,0.6); }

/* ---- Sync / Loading ---- */

.sync-bar {
    padding: 8px 16px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
}

.sync-bar:active { opacity: 0.8; }

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    gap: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
    gap: 8px;
}

.empty-state-icon { font-size: 2rem; opacity: 0.5; }

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: var(--font);
}

.btn:active { opacity: 0.7; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }

/* ---- Tab bar (bottom nav) ---- */

.tab-bar {
    display: flex;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    flex-shrink: 0;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
}

.tab-item.active { color: var(--text); }
.tab-item:active { opacity: 0.7; }

.tab-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.tab-icon .material-symbols-outlined {
    font-size: 1.3rem;
}

/* ---- Desktop: side-by-side layout ---- */

@media (min-width: 768px) {
    .desktop-panel .compose-bar {
        padding-bottom: 10px;
    }

    .msg-bubble {
        max-width: 65%;
    }

    .conv-item:hover {
        background: var(--bg-card-hover);
    }

    .desktop-panel .header-back {
        display: none;
    }
}

/* ---- Mobile utilities ---- */
@media (max-width: 767px) {
    .desktop-only { display: none !important; }
}

/* ---- Mobile: smaller draft panel ---- */
@media (max-width: 767px) {
    .draft-panel {
        padding: 10px 12px;
    }
    .draft-body {
        font-size: 0.85rem;
    }
    .draft-actions {
        gap: 4px;
    }
    .draft-actions .btn {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}

/* ---- Login Screen ---- */

.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
}

.login-logo {
    width: 240px;
    max-width: 70vw;
    height: auto;
    margin-bottom: 32px;
}

.login-subtitle {
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 260px;
}

.login-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 14px 16px;
    font-size: 1.3rem;
    font-family: var(--font);
    text-align: center;
    letter-spacing: 0.3em;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: var(--accent);
}

.login-input::placeholder {
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    letter-spacing: 0.04em;
}

.login-error {
    color: var(--red);
    font-size: 0.85rem;
    min-height: 1.3em;
}

/* ================================================================
   HANDBOOK (Knowledge Base)
   ================================================================ */

/* ---- Search bar ---- */

.hb-search-bar {
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.hb-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.hb-search-input:focus { border-color: var(--accent); }
.hb-search-input::placeholder { color: var(--text-muted); }

/* ---- Guides / Products tab row ---- */

.hb-tab-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.hb-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.hb-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ---- Category pills (shared between handbook + stock) ---- */

.hb-pills {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.hb-pills::-webkit-scrollbar { display: none; }

.hb-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.hb-pill:active { opacity: 0.7; }

.hb-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ---- Category group headers ---- */

.cat-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.cat-group-header .material-symbols-outlined {
    font-size: 0.9rem;
}

/* ---- Scrollable content ---- */

.hb-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Card grid ---- */

.hb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 16px;
}

.hb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.hb-card:active { background: var(--bg-card-hover); }

.hb-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.hb-card-icon .material-symbols-outlined { font-size: 1.2rem; }

.hb-card-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.hb-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--text);
}

.hb-card-brand {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- Detail view ---- */

.hb-detail-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 24px;
}

.hb-detail-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 20px 16px 16px;
}

.hb-detail-icon {
    font-size: 2rem !important;
    color: var(--accent);
    opacity: 0.6;
}

.hb-detail-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
}

.hb-reference-img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
}

.hb-detail-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.3;
}

.hb-detail-brand {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ---- Sections ---- */

.hb-section {
    margin: 0 16px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.hb-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.hb-section-body {
    padding: 12px 14px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
}

.hb-warning {
    border-color: rgba(197, 160, 61, 0.4);
    background: var(--orange-dim);
}

.hb-warning .hb-section-header {
    color: #8a6d1b;
    border-bottom-color: rgba(197, 160, 61, 0.3);
}

/* ---- Video embed ---- */

.hb-video-wrap { padding: 0; }
.hb-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
    border-radius: 0 0 var(--radius) var(--radius);
}
.hb-video--native {
    aspect-ratio: auto;
    max-height: 400px;
    background: #000;
}

/* ---- Image gallery ---- */
.hb-gallery { display: flex; flex-direction: column; gap: 1rem; padding-top: 0.5rem; }
.hb-gallery-item { border-radius: var(--radius); overflow: hidden; background: var(--bg-card); }
.hb-gallery-img { width: 100%; display: block; }
.hb-gallery-caption {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ---- Linked products row ---- */
.hb-products-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}
.hb-product-card {
    min-width: 90px;
    max-width: 100px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 8px 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.hb-product-card:active { opacity: 0.7; }
.hb-product-card img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.hb-product-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin: 0 auto;
}
.hb-product-card-icon .material-symbols-outlined { font-size: 1.3rem; }
.hb-product-card-name {
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text);
    margin-top: 4px;
}
.hb-product-card-amazon {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.62rem;
    color: var(--accent);
    text-decoration: none;
    margin-top: 4px;
    font-weight: 600;
}
.hb-product-card-amazon .material-symbols-outlined {
    font-size: 0.75rem;
}

/* ---- Action buttons ---- */

.hb-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 16px 0;
}

.hb-amazon-btn {
    text-decoration: none;
    text-align: center;
}

.hb-report-btn {
    background: var(--orange-dim) !important;
    color: #8a6d1b !important;
    border: 1px solid rgba(197, 160, 61, 0.3) !important;
}

.hb-report-btn:active { opacity: 0.7; }

.hb-reported {
    background: var(--green-dim) !important;
    color: var(--green) !important;
    border-color: rgba(45, 122, 80, 0.2) !important;
    cursor: default !important;
}

/* ================================================================
   STOCK (Cleaner + Owner)
   ================================================================ */

.stock-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Cleaner stock grid ---- */

.stock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 16px;
}

.stock-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stock-card-tap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px 8px;
    cursor: pointer;
    gap: 6px;
}

.stock-card-tap:active { opacity: 0.7; }

.stock-card-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.stock-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.stock-card-icon .material-symbols-outlined { font-size: 1.3rem; }

.stock-card-name {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--text);
}

.stock-report-btn {
    width: 100%;
    border-radius: 0;
    border-top: 1px solid var(--border);
    background: transparent !important;
    color: var(--red) !important;
    font-weight: 600;
    padding: 8px 10px;
    font-size: 0.75rem;
}

.stock-report-btn:active { background: var(--bg-card-hover) !important; }

/* Request unlisted product button */
.stock-request-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
}
.stock-request-btn .material-symbols-outlined {
    font-size: 1rem;
}

.stock-reported {
    background: var(--green-dim) !important;
    color: var(--green) !important;
    cursor: default !important;
}

/* ---- Owner stock: summary ---- */

.stock-summary {
    padding: 12px 16px;
    background: var(--orange-dim);
    border-bottom: 1px solid rgba(197, 160, 61, 0.2);
    font-size: 0.85rem;
    font-weight: 600;
    color: #8a6d1b;
}

/* ---- Owner stock: report cards ---- */

.stock-report-list {
    display: flex;
    flex-direction: column;
}

.stock-report-card {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.stock-report-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-report-info {
    flex: 1;
    min-width: 0;
}

.stock-report-name {
    font-weight: 600;
    font-size: 0.93rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-report-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stock-time-ago {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stock-report-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.stock-dismiss-btn {
    opacity: 0.5;
    padding: 4px 6px !important;
    min-width: unset !important;
}
.stock-dismiss-btn:hover { opacity: 1; }

.stock-bought-btn {
    background: var(--green) !important;
    color: #fff !important;
}

.stock-resolved {
    opacity: 0.55;
}

.stock-resolved .stock-report-card,
.stock-report-card.stock-resolved {
    flex-direction: row;
    align-items: center;
}

.stock-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 20px 16px 8px;
}

/* ---- Owner stock: resolve form (inline) ---- */

.stock-resolve-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.stock-resolve-input {
    flex: 1;
    min-width: 60px;
    max-width: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.82rem;
    font-family: var(--font);
    outline: none;
}

.stock-resolve-input:focus { border-color: var(--accent); }
.stock-resolve-input::placeholder { color: var(--text-muted); }

/* ---- Owner stock: purchase form inside card grid ---- */

.stock-purchase-form {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 4px 0 2px;
    flex-wrap: wrap;
}

.stock-purchase-form .stock-resolve-input {
    max-width: 70px;
    padding: 6px 8px;
    font-size: 0.75rem;
}

/* ---- Owner stock: history timeline ---- */

.stock-history-list {
    display: flex;
    flex-direction: column;
}

.stock-history-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.stock-history-info {
    flex: 1;
    min-width: 0;
}

.stock-history-dismissed {
    opacity: 0.45;
}

.stock-history-undone {
    opacity: 0.45;
}

.stock-history-undone .stock-report-name {
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.25);
}

.stock-history-open .stock-report-name::before {
    content: '\25CF  ';
    color: var(--amber, #f59e0b);
    font-size: 0.6rem;
    vertical-align: middle;
}

.stock-history-info .stock-resolve-form {
    margin-top: 8px;
}

/* ---- Responsive: handbook + stock ---- */

@media (max-width: 767px) {
    .hb-pills {
        padding: 8px 12px;
        gap: 4px;
    }
    .hb-pill {
        padding: 5px 12px;
        font-size: 0.72rem;
    }
    .hb-grid, .stock-grid {
        gap: 8px;
        padding: 10px 12px;
    }
}

@media (min-width: 768px) {
    .hb-grid, .stock-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .hb-card:hover, .stock-card:hover {
        background: var(--bg-card-hover);
        box-shadow: var(--shadow);
    }
    .stock-report-card:hover {
        background: var(--bg-card-hover);
    }
}

/* ===========================================================================
   Reviews
   =========================================================================== */

.review-motivation {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.review-motivation-icon {
    font-size: 1.5rem !important;
    color: var(--orange);
    font-variation-settings: 'FILL' 1;
}

.review-motivation-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.review-motivation-text strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 2px;
}

/* ---- Month Navigator ---- */
.review-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.review-sync-btn {
    font-size: 0.85rem;
    padding: 4px 8px;
}

.review-month-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-month-btn:active { opacity: 0.6; }

.review-month-label {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text);
    min-width: 120px;
    text-align: center;
}

/* ---- Type Filter Pills ---- */
.review-type-pills {
    display: flex;
    gap: 8px;
    padding: 4px 16px 8px;
    justify-content: center;
}
.review-type-pill {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.review-type-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Second row of pills (platform filter) — tighter top padding */
.review-platform-pills {
    padding-top: 0;
}
/* When an individual platform pill is active, match its brand colour */
.review-platform-pill.active.platform-airbnb  { background: #FF5A5F; border-color: #FF5A5F; color: #fff; }
.review-platform-pill.active.platform-booking { background: #003580; border-color: #003580; color: #fff; }
.review-platform-pill.active.platform-vrbo    { background: #245ABC; border-color: #245ABC; color: #fff; }

/* ---- Scrollable Content ---- */
.review-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Stats Row ---- */
.review-stats {
    display: flex;
    gap: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.review-stats::-webkit-scrollbar { display: none; }

.review-stat-card {
    flex: 1;
    min-width: 44px;
    text-align: center;
    padding: 10px 4px 8px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.review-stat-card:active { opacity: 0.7; }

.review-stat-primary {
    background: var(--bg-card);
}

.review-stat-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.review-stat-active .review-stat-value { color: var(--text); }

.review-stat-avg {
    background: var(--bg-card);
}

.review-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.review-stat-avg .review-stat-value { color: var(--green); }

.review-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 2px;
}

.review-stat-stars {
    display: flex;
    justify-content: center;
    gap: 0;
}

.stat-star {
    font-size: 0.55rem !important;
    color: var(--text-muted);
    opacity: 0.3;
}

.stat-star.filled {
    color: var(--orange);
    opacity: 1;
    font-variation-settings: 'FILL' 1;
}

.review-checkout-ctx {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0 16px 8px;
}

/* ---- Empty State ---- */
.review-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
    gap: 8px;
}

.review-empty-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

.review-empty-icon .material-symbols-outlined {
    font-size: 2.5rem;
}

/* ---- Review Cards ---- */
.review-list {
    display: flex;
    flex-direction: column;
}

.review-card {
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.review-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.review-stars {
    display: flex;
    gap: 1px;
}

.review-star {
    font-size: 0.85rem !important;
    color: var(--border);
}

.review-star.filled {
    color: var(--orange);
    font-variation-settings: 'FILL' 1;
}

.review-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.review-room-badge {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--border);
}

.review-platform-icon {
    width: 13px;
    height: 13px;
    opacity: 0.75;
    margin-left: 4px;
    flex-shrink: 0;
    vertical-align: -2px;
    display: inline-block;
}
svg.review-platform-icon.platform-airbnb  { color: #FF5A5F; }
svg.review-platform-icon.platform-booking { color: #003580; }
img.review-platform-icon.platform-vrbo    { object-fit: contain; }

.review-guest {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 600;
}

.review-comments {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 4px;
}

.review-lang-toggle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 0;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 2px;
}

.review-lang-toggle:active { opacity: 0.6; }
.review-lang-flag { margin-right: 4px; font-size: 1rem; }

/* ---- 5-tab adjustments ---- */
@media (max-width: 374px) {
    .tab-item {
        font-size: 0.5rem;
        padding: 6px 2px;
    }
    .tab-icon .material-symbols-outlined {
        font-size: 1.1rem;
    }
}

/* ---- Settings ---- */

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.settings-role {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.settings-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px !important;
    margin-bottom: 8px;
    font-size: 0.9rem !important;
}

.settings-danger {
    color: var(--red) !important;
    border-color: var(--red) !important;
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0 16px;
}

.settings-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.settings-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.4;
}

/* Issue Reports */
.settings-section { margin-top: 24px; }
.settings-section-header {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-heading); font-size: 1.1rem;
    margin-bottom: 12px; color: var(--text);
}
.settings-section-header .material-symbols-outlined { font-size: 1.2rem; }
.reports-container { display: flex; flex-direction: column; gap: 10px; }
.report-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
}
.report-card.report-resolved { opacity: 0.5; }
.report-top { display: flex; gap: 10px; align-items: flex-start; }
.report-icon { font-size: 1.3rem; color: var(--orange); flex-shrink: 0; margin-top: 2px; }
.report-info { flex: 1; min-width: 0; }
.report-location { font-weight: 600; font-size: 0.9rem; }
.report-message { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }
.report-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.report-photo {
    width: 100%; max-height: 200px; object-fit: cover;
    border-radius: var(--radius-sm); margin-top: 8px; cursor: pointer;
}
.report-resolve-btn { margin-top: 8px; }

.settings-lang-row {
    display: flex;
    gap: 10px;
    padding: 0 16px;
}

.settings-lang-btn {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}

.settings-lang-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* ---- Calendar "Today" View ---- */

.cal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
    -webkit-overflow-scrolling: touch;
}

/* Date navigation row */
.cal-date-nav {
    display: flex;
    align-items: center;
    padding: 8px 0;
    gap: 4px;
}
.cal-date-arrow {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cal-date-arrow:active {
    background: var(--accent-dim);
}
.cal-date-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.cal-date {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
}
.cal-date-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--text-secondary);
    margin-top: 4px;
    cursor: pointer;
    opacity: 0.4;
}
.cal-date-dot:active {
    opacity: 0.8;
}
.cal-date-dot--active {
    background: var(--accent);
    border-color: var(--accent);
    cursor: default;
    opacity: 1;
}

.cal-house {
    margin-bottom: 16px;
}

.cal-house-hdr {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text);
    padding: 8px 0 6px;
}

/* Room row */
.cal-row {
    display: flex;
    align-items: stretch;
    margin-bottom: 4px;
    min-height: 54px;
}

/* Room number column */
.cal-num {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-secondary);
    width: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Booking cell */
.cal-cell {
    flex: 1;
    display: flex;
    gap: 4px;
    min-width: 0;
}

/* Card base */
.cal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow);
    min-width: 0;
    flex: 0 1 calc(50% - 2px);
}

/* Card full-width (occupied stays) */
.cal-card--full { flex: 1 1 100%; }

/* Platform colours — applied to .cal-card and .cal-span */
.cal-plat--airbnb { background: var(--red-dim); }
.cal-plat--airbnb .cal-guest { color: var(--red); }
.cal-plat--airbnb .cal-stay { color: var(--red); opacity: 0.7; }

.cal-plat--booking { background: var(--blue-dim); }
.cal-plat--booking .cal-guest { color: var(--blue); }
.cal-plat--booking .cal-stay { color: var(--blue); opacity: 0.7; }

.cal-plat--vrbo { background: var(--orange-dim); }
.cal-plat--vrbo .cal-guest { color: var(--orange); }
.cal-plat--vrbo .cal-stay { color: var(--orange); opacity: 0.7; }

.cal-plat--direct { background: var(--green-dim); }
.cal-plat--direct .cal-guest { color: var(--green); }
.cal-plat--direct .cal-stay { color: var(--green); opacity: 0.7; }

.cal-plat--multi { background: var(--orange-dim); }
.cal-plat--multi .cal-guest { color: var(--orange); }
.cal-plat--multi .cal-stay { color: var(--orange); opacity: 0.7; }

.cal-plat--internal { background: var(--accent-dim); }
.cal-plat--internal .cal-guest { color: var(--accent); }
.cal-plat--internal .cal-stay { color: var(--accent); opacity: 0.7; }

/* Guest name */
.cal-guest {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.cal-guest-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: currentColor;
    opacity: 0.8;
}

.cal-guest-link:hover {
    opacity: 1;
}

/* Country flag emoji */
.cal-flag {
    font-size: 0.75rem;
}

/* Stay subtitle */
.cal-stay {
    font-size: 0.72rem;
    margin-top: 1px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

/* Direction icon (login/logout) */
.cal-dir {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Empty half (spacer for checkout-only / checkin-only) */
.cal-half--empty {
    flex: 0 1 calc(50% - 2px);
}

/* Empty room — subtle dashed outline */
.cal-cell--empty {
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    opacity: 0.25;
}

/* Group container — no gaps between rows */
.cal-group {
    margin-bottom: 4px;
    position: relative;
}
.cal-group .cal-row {
    margin-bottom: 0;
}

/* Absolute spanning card (covers all rows in the group on one half) */
.cal-span {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow);
    z-index: 1;
    min-width: 0;
    overflow: hidden;
}
/* Span positions */
.cal-span--left { left: 40px; width: calc(50% - 22px); }
.cal-span--right { right: 0; width: calc(50% - 22px); }
.cal-span--full { left: 40px; right: 0; }

/* Sub-group container for nested spans within a group */
.cal-subgroup { position: relative; }

/* Cards inside groups: no shadow (prevents overlap bleed), slight vertical gap */
.cal-group > .cal-row .cal-card { margin: 2px 0; box-shadow: none; }

/* Invisible spacer — reserves space under the absolute span card */
.cal-half--spacer {
    flex: 0 1 calc(50% - 2px);
}

/* Cross-house group divider (195 label inside spanning group) */
.cal-row--divider {
    min-height: 28px;
}
.cal-num--house {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Day view platform color legend ──────────────────────────────────── */

.cal-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 0 6px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-legend-dot--airbnb { background: var(--red); }
.cal-legend-dot--booking { background: var(--blue); }
.cal-legend-dot--vrbo { background: var(--orange); }
.cal-legend-dot--direct { background: var(--green); }
.cal-legend-dot--internal { background: var(--accent); }

.cal-legend-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ── View toggle (Day / Month) ──────────────────────────────────────── */

.cal-view-toggle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
}

.cal-view-toggle-btn {
    font-size: 0.75rem;
    padding: 5px 18px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

.cal-view-toggle-btn:first-child {
    border-radius: 20px 0 0 20px;
}

.cal-view-toggle-btn:not(:first-child):not(:last-child) {
    border-radius: 0;
    margin-left: -1px;
}

.cal-view-toggle-btn:last-child {
    border-radius: 0 20px 20px 0;
    margin-left: -1px;
}

.cal-view-toggle-btn--active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

/* Metric toggle on the month view: Checkouts / Booked / Lost. Each pill
   shows a label + a tiny subtitle so the user doesn't have to remember
   which one is which. Visually distinct from the view-toggle (rounded
   chips with subtitles vs flat segmented pill) so the two stacks don't
   blur together. */
.cal-metric-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px 4px;
}

.cal-metric-toggle-btn {
    flex: 1 1 0;
    max-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-heading);
    line-height: 1.15;
}

.cal-metric-toggle-label {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.cal-metric-toggle-sub {
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0;
    font-family: var(--font-body, inherit);
    opacity: 0.8;
}

.cal-metric-toggle-btn--active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.cal-metric-toggle-btn--active .cal-metric-toggle-sub {
    color: rgba(255, 255, 255, 0.78);
}

/* ── Calendar month view ────────────────────────────────────────────────── */

.cal-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 8px;
}

.cal-month-label {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    min-width: 170px;
    text-align: center;
}

/* Legend */
.cal-month-legend {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: 2px 0 10px;
}

.cal-month-legend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.cal-month-legend-card {
    width: 26px;
    height: 32px;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-month-legend-card .cal-month-total {
    font-size: 0.85rem;
}

.cal-month-legend-text {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

/* Multi-month feed (owner only). The page-level cal-content is what
   scrolls; sections flow into multiple columns when the viewport can
   comfortably fit them, and the first month starts at the top. */
.cal-month-feed {
    display: grid;
    /* Each month column is 420–460px so cells are big enough to read
       (half-counts in split cells stay legible) but still small enough
       to fit 2–3 months side-by-side on desktop. auto-fit packs as many
       columns as the viewport allows; below the min the layout cleanly
       collapses to one month per row. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 460px));
    justify-content: center;
    align-items: start;
    gap: 24px 20px;
    padding: 0 12px 80px;  /* breathing room above the tab bar */
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* Year overview: all 12 months at once in a responsive grid. Months are
   smaller than in the feed (we're fitting 12 of them instead of scrolling
   through them), but cells still go square and half-counts remain readable
   thanks to a tightened font block below. */
.cal-month-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 360px));
    justify-content: center;
    align-items: start;
    gap: 20px 16px;
    padding: 8px 12px 80px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.cal-month-section--year-grid .cal-month-section-label {
    font-size: 0.95rem;
    padding: 6px 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

/* Tighter day-number and total/half-count sizes inside a year-grid cell.
   At ~280-360px per month, cells settle around 38-50px wide — small but
   still scannable. The half-count font scales with cell size via clamp. */
.cal-month-section--year-grid .cal-month-grid {
    gap: 2px;
}

.cal-month-section--year-grid .cal-month-day-num {
    font-size: 0.55rem;
    margin-top: 2px;
    margin-bottom: 2px;
}

.cal-month-section--year-grid .cal-month-total {
    font-size: clamp(0.75rem, 2.6vw, 1.05rem);
}

.cal-month-section--year-grid .cal-month-half-count {
    font-size: clamp(0.65rem, 2.2vw, 0.9rem);
    font-weight: 700;
}

.cal-month-section--year-grid .cal-month-booked-pos,
.cal-month-section--year-grid .cal-month-booked-neg {
    font-size: clamp(0.6rem, 2vw, 0.85rem);
}

.cal-month-section--year-grid .cal-month-wday {
    font-size: 0.6rem;
    padding: 2px 0;
}

.cal-month-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.cal-month-section-label {
    position: static;
    z-index: 5;
    background: var(--bg, #fff);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    padding: 12px 10px 8px;
    border-bottom: 1px solid var(--border);
    width: 100%;
    box-sizing: border-box;
}

.cal-month-section--anchor .cal-month-section-label {
    color: var(--accent);
}

/* The 7-column day grid fills its month-feed column. With ~440px feed
   columns the cells land at ~60px wide — big enough that two-digit
   half-counts on split (checkout) cells read at a glance, while still
   compact enough that the user can scan multiple months at once. */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.cal-metric-toggle,
.cal-month-legend {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* Cells go square at ≥720px so cell width and height match — half-count
   centroids land where the eye expects them, not stretched vertically. */
@media (min-width: 720px) {
    .cal-month-card {
        aspect-ratio: 1 / 1;
    }
}

.cal-month-weekdays {
    gap: 2px;
    margin-bottom: 2px;
}

.cal-month-wday {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 4px 0;
}

/* Cell wrapper (day number + card) */
.cal-month-cell-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.cal-month-cell-wrap:active .cal-month-card {
    background: var(--accent-dim);
}

.cal-month-cell-wrap--outside {
    opacity: 0.25;
    pointer-events: none;
}

/* Day number (outside the card) */
.cal-month-day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
    margin-top: 4px;
    margin-bottom: 4px;
    position: relative;
    text-align: center;
    isolation: isolate;
}

.cal-month-day-num--today {
    color: #fff;
}

.cal-month-day-num--today::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    z-index: -1;
}

/* Card */
.cal-month-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* All in-card content sits absolutely positioned, so no matter what numbers
   land in the cell, the card itself stays at its aspect-ratio-prescribed
   size. Without this, busy months (with stacked +/− numbers) grew taller
   than empty months on the same view, and the rows in different month
   sections ended up different heights. */
.cal-month-total {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text);
    z-index: 2;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-variant-numeric: tabular-nums;
}

/* Booked-mode stacked numbers: "+N" gross confirmations on top in accent,
   "−M" gross cancellations below in red. Either can be absent. Absolutely
   positioned so the stack height doesn't push the card. */
.cal-month-booked-stack {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
}

.cal-month-booked-pos,
.cal-month-booked-neg {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.cal-month-booked-pos { color: var(--accent, #b9a47a); }
.cal-month-booked-neg { color: #c54545; }

@media (min-width: 720px) {
    .cal-month-booked-pos,
    .cal-month-booked-neg { font-size: 1.15rem; }
}

/* State B: diagonal split */
.cal-month-card--split::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--border) calc(50% - 0.5px), var(--border) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    pointer-events: none;
    z-index: 1;
}

/* Triangles */
.cal-month-tri {
    position: absolute;
    inset: 0;
}

.cal-month-tri--193 {
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.cal-month-tri--195 {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.cal-month-tri--occupied {
    background: rgba(44, 44, 44, 0.07);
}

/* Half-count (number on the non-occupied triangle). Positioned at the
   centroid of each triangle so the digit is visually balanced regardless
   of cell size — and so the two positions are mirror-symmetric. */
.cal-month-half-count {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    line-height: 1;
    color: var(--text);
    z-index: 2;
    font-variant-numeric: tabular-nums;
}

/* 193 = top-left triangle. Centroid sits at ~(33%, 33%). */
.cal-month-half-count--193 {
    top: 33%;
    left: 33%;
    transform: translate(-50%, -50%);
}

/* 195 = bottom-right triangle. Centroid sits at ~(67%, 67%). */
.cal-month-half-count--195 {
    top: 67%;
    left: 67%;
    transform: translate(-50%, -50%);
}

@media (min-width: 720px) {
    .cal-month-half-count { font-size: 1.15rem; }
    .cal-month-total { font-size: 1.5rem; }
}

/* State C: both houses whole-home */
.cal-month-card--full-occupied {
    background: rgba(44, 44, 44, 0.07);
}

/* ── Calendar stats view ────────────────────────────────────────────────── */

.cal-stats-houses {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.cal-stats-house {
  flex: 1;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.cal-stats-house-code {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
}

.cal-stats-house-name {
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

.cal-stats-total {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.cal-stats-platforms {
  text-align: left;
}

.cal-stats-platform-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.cal-stats-platform-row:last-child {
  border-bottom: none;
}

.cal-stats-platform-name {
  color: #555;
}

.cal-stats-platform-nights {
  font-weight: 600;
  color: #333;
}

.cal-stats-empty {
  color: #aaa;
  font-style: italic;
  justify-content: center;
}

.cal-stats-combined {
  margin-top: 16px;
  background: #f0f4f8;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.cal-stats-combined-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
}

.cal-stats-combined .cal-stats-total {
  font-size: 18px;
  margin-bottom: 8px;
}

.cal-stats-combined .cal-stats-platforms {
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

/* Booked since-floor headline card — three figures laid out in a row:
   gross bookings, gross cancellations, net. */
.cal-stats-since-floor {
    margin: 16px auto 0;
    max-width: 480px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card, #fff);
}

.cal-stats-since-floor-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-align: center;
}

.cal-stats-since-floor-figs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.cal-stats-since-floor-fig {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: var(--bg-card-hover, rgba(0,0,0,0.02));
}

.cal-stats-since-floor-val {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--accent, #b9a47a);
    font-variant-numeric: tabular-nums;
}

.cal-stats-since-floor-fig--neg .cal-stats-since-floor-val {
    color: #c54545;
}

.cal-stats-since-floor-fig--net .cal-stats-since-floor-val {
    color: var(--text);
}

.cal-stats-since-floor-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cal-stats-platform-compare {
    margin: 16px auto;
    max-width: 620px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card, #fff);
}

.cal-stats-platform-compare-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cal-stats-platform-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card-hover, rgba(0,0,0,0.03));
    flex-shrink: 0;
}

.cal-stats-platform-toggle-btn {
    border: 0;
    border-radius: 6px;
    padding: 6px 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-family: var(--font-heading);
    cursor: pointer;
    white-space: nowrap;
}

.cal-stats-platform-toggle-btn--active {
    background: var(--text);
    color: #fff;
}

.cal-stats-platform-compare-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-stats-platform-compare-row {
    display: grid;
    grid-template-columns: 86px 1fr 58px;
    align-items: center;
    gap: 10px;
}

.cal-stats-platform-compare-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text);
}

.cal-stats-platform-compare-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 10px;
}

.cal-stats-platform-compare-main {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cal-stats-platform-compare-sub {
    font-size: 0.62rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cal-stats-platform-compare-bar {
    grid-column: 2 / 3;
    width: 100%;
}

.cal-stats-platform-compare-bookings {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    color: var(--text-secondary);
    font-size: 0.68rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
    .cal-stats-platform-compare-header {
        flex-direction: column;
    }
    .cal-stats-platform-compare-row {
        grid-template-columns: 1fr;
    }
    .cal-stats-platform-compare-bar,
    .cal-stats-platform-compare-bookings {
        grid-column: auto;
        grid-row: auto;
    }
    .cal-stats-platform-compare-bookings {
        text-align: left;
    }
}

/* Lost-nights leaderboard */
.cal-stats-leaderboard {
    margin: 16px auto;
    max-width: 480px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card, #fff);
}

.cal-stats-leaderboard-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.cal-stats-leaderboard-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.cal-stats-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cal-stats-leaderboard-row {
    display: grid;
    grid-template-columns: 24px 36px 36px 1fr 70px;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
}

.cal-stats-leaderboard-rank {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.cal-stats-leaderboard-house {
    font-size: 0.62rem;
    text-align: center;
    border-radius: 4px;
    padding: 2px 0;
    color: var(--text-secondary);
    background: var(--bg-card-hover, rgba(0,0,0,0.04));
    letter-spacing: 0.04em;
}

.cal-stats-leaderboard-house--193 { color: #3a6f97; }
.cal-stats-leaderboard-house--195 { color: #6a4d8b; }

.cal-stats-leaderboard-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
}

.cal-stats-leaderboard-bar-wrap {
    height: 8px;
    background: var(--bg-card-hover, rgba(0,0,0,0.05));
    border-radius: 999px;
    overflow: hidden;
}

.cal-stats-leaderboard-bar {
    height: 100%;
    background: var(--accent, #b9a47a);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.cal-stats-leaderboard-val {
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Day-of-week row: label · bar · value */
.cal-stats-dow-row {
    display: grid;
    grid-template-columns: 36px 1fr 70px;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
}

.cal-stats-dow-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text);
}

/* Per-month booking activity. Each month gets a small block with two bars
   stacked (booked + cancelled) so you can eyeball the ratio per month. */
.cal-stats-month-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cal-stats-month-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 10px;
    align-items: center;
}

.cal-stats-month-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text);
}

.cal-stats-month-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-stats-month-bar-row {
    display: grid;
    grid-template-columns: 60px 1fr 70px;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
}

.cal-stats-month-bar-mini {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-size: 0.6rem;
}

.cal-stats-month-bar-val {
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--text-secondary);
}

.cal-stats-leaderboard-bar--neg {
    background: #c54545;
}

/* Drill-down modal — opens when tapping a day cell in 'booked' or 'lost'
   mode. Shows the contributors behind the number (reservations or empty
   rooms). Slides up from the bottom on small screens, centred card on
   large screens. */
.cal-drill-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    padding: 0;
}

.cal-drill-sheet {
    background: var(--bg, #fff);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    border-radius: 14px 14px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}

@media (min-width: 720px) {
    .cal-drill-overlay {
        align-items: center;
        padding: 24px;
    }
    .cal-drill-sheet {
        border-radius: 14px;
        max-height: 70vh;
    }
}

.cal-drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.cal-drill-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-drill-mode-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.cal-drill-date {
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.cal-drill-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card-hover, rgba(0,0,0,0.04));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.cal-drill-body {
    overflow-y: auto;
    padding: 12px 18px 24px;
}

.cal-drill-summary {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 10px;
}

.cal-drill-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px 0;
    font-size: 0.85rem;
}

.cal-drill-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cal-drill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    gap: 12px;
}

.cal-drill-row:hover {
    background: var(--bg-card-hover, rgba(0,0,0,0.02));
}

/* Cancelled rows in the booked drill-down — visually subdued + tagged. */
.cal-drill-row--cancelled {
    opacity: 0.78;
    background: rgba(197, 69, 69, 0.04);
    border-color: rgba(197, 69, 69, 0.25);
}

.cal-drill-row--cancelled .cal-drill-row-title {
    text-decoration: line-through;
    text-decoration-color: rgba(197, 69, 69, 0.5);
    text-decoration-thickness: 1.5px;
}

.cal-drill-row-tag {
    display: inline-block;
    font-family: var(--font-body, inherit);
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    background: #c54545;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    text-decoration: none;
}

.cal-drill-row-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.cal-drill-row-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-drill-row-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.cal-drill-row-platform {
    text-transform: lowercase;
}

.cal-drill-row-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.cal-drill-house-group {
    margin-top: 12px;
}

.cal-drill-house-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.cal-drill-room-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cal-drill-room-chip {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    background: var(--bg-card, #fff);
}

/* ── Calendar grid (Gantt) view ─────────────────────────────────────────── */

.cal-grid-wrap {
    padding: 8px 0 0;
}

.cal-grid-scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.cal-grid-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}

.cal-grid-row--header {
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background-color: var(--bg);
    z-index: 3;
}

.cal-grid-row--house-hdr {
    background-color: var(--bg);
    border-bottom: none;
}

/* Column-line overlay. A separate absolute-positioned layer holding 1px
   divs at every column boundary, spanning the full scroller height. By
   using actual divs (not a gradient and not cell borders), every line
   is rendered with identical thickness and color across the entire
   grid — date strip, house-label gaps, and room rows alike. */
.cal-grid-lines {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.cal-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.cal-grid-house-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 8px 2px;
    letter-spacing: 0.02em;
}

.cal-grid-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 1px solid var(--border);
    background: var(--bg);
    z-index: 1;
}

.cal-grid-date {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}

.cal-grid-date:hover {
    background: rgba(0,0,0,0.03);
}

.cal-grid-dow {
    font-size: 0.55rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-grid-daynum {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.cal-grid-date--today .cal-grid-daynum {
    color: var(--green);
}

.cal-grid-date--today {
    background: var(--green-dim);
}

.cal-grid-date--weekend .cal-grid-dow {
    color: var(--text-secondary);
    opacity: 0.6;
}

.cal-grid-cell {
    position: absolute;
    top: 0;
    height: 100%;
    box-sizing: border-box;
    /* No border-right: vertical column lines are drawn by the overlay
       layer (.cal-grid-lines) so that line thickness + color match
       perfectly across the whole grid (date strip, house gaps, rows).
       Cells still own their bg highlights for weekend / today. */
}

.cal-grid-cell--weekend {
    background: rgba(0,0,0,0.015);
}

.cal-grid-cell--today {
    background: color-mix(in srgb, var(--green) 5%, transparent);
}

.cal-grid-bar {
    position: absolute;
    top: 4px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    overflow: hidden;
    z-index: 2;
    cursor: default;
    border: 1px solid rgba(0,0,0,0.12);
}

.cal-grid-bar--clip-left {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.cal-grid-bar--clip-right {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.cal-grid-bar-name {
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Platform colors for grid bars at 90% opacity, white text. Solid enough
   to fully mask the column lines under each bar (so they don't bleed
   through and look noisy) but the 10% transparency keeps the page from
   feeling heavy. VRBO uses --orange and Internal uses --accent so they
   each have their own identity instead of relying on neutral grey, which
   Dark Reader rendered nearly invisible. */
.cal-grid-bar--airbnb   { background: color-mix(in srgb, var(--red)    90%, transparent); border-color: var(--red); }
.cal-grid-bar--booking  { background: color-mix(in srgb, var(--blue)   90%, transparent); border-color: var(--blue); }
.cal-grid-bar--vrbo     { background: color-mix(in srgb, var(--orange) 90%, transparent); border-color: var(--orange); }
.cal-grid-bar--direct   { background: color-mix(in srgb, var(--green)  90%, transparent); border-color: var(--green); }
.cal-grid-bar--internal { background: color-mix(in srgb, var(--accent) 90%, transparent); border-color: var(--accent); }

.cal-grid-bar--airbnb   .cal-grid-bar-name,
.cal-grid-bar--booking  .cal-grid-bar-name,
.cal-grid-bar--vrbo     .cal-grid-bar-name,
.cal-grid-bar--direct   .cal-grid-bar-name,
.cal-grid-bar--internal .cal-grid-bar-name { color: #fff; }

/* Group bars */
.cal-grid-bar--group {
    border-radius: 6px;
}

/* =====================================================================
   Tasks / Cleaning Checklist
   ===================================================================== */

.tasks-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
}

/* Date navigation */
.tasks-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px 6px;
}
.tasks-nav-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}
.tasks-nav-btn .material-symbols-outlined { font-size: 22px; }
.tasks-date-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}
.tasks-today-dot {
    background: none;
    border: none;
    font-size: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 2px 4px;
}
.tasks-today-dot--active { color: var(--green); }

/* Loading */
.tasks-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}
.tasks-loading-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Empty state */
.tasks-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.tasks-empty-icon {
    font-size: 40px;
    opacity: 0.3;
    display: block;
    margin-bottom: 8px;
}
.tasks-empty-text { font-size: 0.85rem; }

/* House section */
.tasks-house {
    margin: 8px 12px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.tasks-house-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 4px;
}
.tasks-house-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'Marcellus', serif;
}
/* "Whole Home" pill next to house label — shown when a whole-home guest
   checks in today (cleaners must finish by 3pm). */
.tasks-house-wh-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue, #1976d2);
    margin-left: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.tasks-house-report {
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.65rem;
    padding: 3px 8px;
    opacity: 0.55;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    margin-right: 8px;
}
.tasks-house-report:active {
    opacity: 1;
    background: var(--accent-dim);
}
.tasks-house-progress {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.tasks-house-status--empty {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Progress bar */
.tasks-progress-bar {
    height: 3px;
    background: var(--border);
    margin: 4px 14px 8px;
    border-radius: 2px;
    overflow: hidden;
}
.tasks-progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.tasks-progress-fill--done {
    background: var(--green);
}

/* Area section */
.tasks-area {
    border-top: 1px solid var(--border);
}
.tasks-area--done {
    opacity: 0.6;
}
.tasks-area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tasks-area-header:active {
    background: rgba(0,0,0,0.03);
}
.tasks-area-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tasks-area-chevron {
    font-size: 18px;
    color: var(--text-secondary);
}
.tasks-area-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.tasks-area-label--priority {
    color: var(--orange);
}
.tasks-area-badge {
    font-size: 0.65rem;
    background: var(--border);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.tasks-area-badge--done {
    background: var(--green);
    color: #fff;
}

/* Priority badge */
.tasks-priority-badge {
    font-size: 0.55rem;
    background: var(--orange);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* "NOT A CHECKOUT" badge — bedroom appears on the cleaner list only because
 * of a one-off guest request (e.g. extra blanket), not a turnover. Bright red
 * to override the cleaner's default "room visible = strip linens" instinct. */
.tasks-stayover-badge {
    font-size: 0.55rem;
    background: var(--red);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-left: 6px;
    text-transform: uppercase;
}

/* "out HH:MM" chip — guest-told room-vacate time. Colour-coded:
 *   --early   (< 11:00) → green: cleaner can start the room early
 *   --ontime  (= 11:00) → blue:  default checkout, no surprise
 *   --late    (> 11:00) → red:   late checkout requested, room
 *                                blocked until then
 * The base class shapes the chip; the modifier sets the colour. */
.tasks-checkout-time-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 6px;
    white-space: nowrap;
}
.tasks-checkout-time-badge--early {
    background: var(--green-dim);
    color: var(--green);
}
.tasks-checkout-time-badge--ontime {
    background: var(--blue-dim);
    color: var(--blue);
}
.tasks-checkout-time-badge--late {
    background: var(--red-dim);
    color: var(--red);
}

/* Task items */
.tasks-list {
    padding: 0 14px 10px;
}
.tasks-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.tasks-item:last-child { border-bottom: none; }
.tasks-item--done .tasks-item-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.tasks-item--recurring .tasks-item-title {
    color: var(--blue);
    font-weight: 600;
}
.tasks-item--recurring.tasks-item--done .tasks-item-title {
    color: var(--text-secondary);
    font-weight: 400;
}
.tasks-item--overdue .tasks-item-title {
    color: var(--orange);
}
.tasks-item--overdue.tasks-item--done .tasks-item-title {
    color: var(--text-secondary);
}
/* Urgent / system tasks (e.g. battery replacement) */
.tasks-item--urgent .tasks-item-title {
    color: var(--red, #e53935);
    font-weight: 600;
}
.tasks-item--urgent.tasks-item--done .tasks-item-title {
    color: var(--text-secondary);
    font-weight: 400;
}
.tasks-urgent-badge {
    font-size: 0.55rem;
    background: rgba(229, 57, 53, 0.1);
    color: var(--red, #e53935);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}
/* System task (AI/manual guest request) — blue title + badge */
.tasks-item--system .tasks-item-title {
    color: var(--blue, #1976d2);
    font-weight: 600;
}
.tasks-item--system.tasks-item--done .tasks-item-title {
    color: var(--text-secondary);
    font-weight: 400;
}
.tasks-item--system .tasks-urgent-badge {
    background: rgba(25, 118, 210, 0.1);
    color: var(--blue, #1976d2);
}

/* Highlighted operational notes — blue panel so cleaners don't skim past
 * them. Used e.g. for "remove the reed diffuser before the whole-home
 * guest arrives". Wraps the whole row (not just the title) and shows the
 * wiki image inline. */
.tasks-item--highlight-blue {
    background: rgba(25, 118, 210, 0.08);
    border-left: 3px solid var(--blue, #1976d2);
    padding: 8px 10px;
    margin-left: -13px;
    margin-right: -10px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex-wrap: wrap;
}
.tasks-item--highlight-blue.tasks-item--done {
    background: rgba(25, 118, 210, 0.03);
}
.tasks-item--highlight-blue .tasks-item-title {
    color: var(--blue, #1976d2);
    font-weight: 600;
}
.tasks-item-highlight-image-wrap {
    flex-basis: 100%;   /* always wrap to its own line below the title */
    order: 99;          /* push after any badges/buttons in the row */
    margin-top: 6px;
    margin-left: 30px;  /* indent past checkbox */
}
.tasks-item-highlight-image {
    display: block;
    max-width: 180px;
    max-height: 180px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid rgba(25, 118, 210, 0.2);
    cursor: pointer;
}

/* "Complete all regular" button on each area card */
.tasks-area-complete-all {
    background: var(--surface, #fff);
    color: var(--text-secondary);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.tasks-area-complete-all:hover {
    background: rgba(25, 118, 210, 0.06);
    color: var(--blue, #1976d2);
    border-color: var(--blue, #1976d2);
}
.tasks-area-complete-all:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.tasks-area-complete-all .material-symbols-outlined {
    font-size: 14px;
}

/* Manual tasks (owner-added via the FAB) — solid blue M chip and a left
 * accent stripe so it's visually distinct from AI-fired guest requests. */
.tasks-item--manual {
    border-left: 3px solid var(--blue, #1976d2);
    padding-left: 8px;
    margin-left: -11px;  /* offset so left edge stays aligned with non-manual rows */
}
.tasks-urgent-badge--manual {
    background: var(--blue, #1976d2);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}
/* Conditional + room-specific task styling (blue like recurring) */
.tasks-item--conditional .tasks-item-title {
    color: var(--blue);
    font-weight: 600;
}
.tasks-item--conditional.tasks-item--done .tasks-item-title {
    color: var(--text-secondary);
    font-weight: 400;
}
.tasks-cond-badge {
    background: var(--blue-dim);
    color: var(--blue);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
/* Area badge */
.tasks-area-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.tasks-checkbox {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.tasks-checkbox .material-symbols-outlined {
    font-size: 22px;
    color: var(--text-secondary);
}
.tasks-checkbox--checked .material-symbols-outlined {
    color: var(--green);
}
.tasks-checkbox--disabled {
    pointer-events: none;
    opacity: 0.3;
}
.tasks-title-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.tasks-item-title {
    font-size: 0.78rem;
    color: var(--text);
    line-height: 1.3;
}
.tasks-item-rooms {
    font-weight: 700;
}
.tasks-recur-badge {
    font-size: 0.55rem;
    background: var(--blue-dim);
    color: var(--blue);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}
/* Info button (guide link) */
.tasks-info-btn {
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.tasks-info-btn .material-symbols-outlined {
    font-size: 16px;
    color: var(--text-muted);
}
.tasks-info-btn:active .material-symbols-outlined {
    color: var(--accent);
}

/* Postponed task state */
.tasks-item--postponed {
    opacity: 0.4;
}
.tasks-item--postponed .tasks-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}
.tasks-postponed-icon {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: -2px;
}
.tasks-postponed-label {
    font-size: 0.55rem;
    background: var(--accent-dim);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
.tasks-undo-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 1;
}
.tasks-undo-btn .material-symbols-outlined {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Days-since badge (blue when due, orange when overdue) */
.tasks-since-badge {
    font-size: 0.55rem;
    background: var(--blue-dim);
    color: var(--blue);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}
.tasks-since-badge--overdue {
    background: var(--orange-dim);
    color: var(--orange);
    font-weight: 600;
}
/* Postpone button */
.tasks-postpone-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 2px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}
.tasks-postpone-btn:active {
    background: var(--accent-dim);
}

/* Skipped task state */
.tasks-item--skipped {
    opacity: 0.4;
}
.tasks-item--skipped .tasks-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}
.tasks-skipped-icon {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: -2px;
}
.tasks-skipped-label {
    font-size: 0.55rem;
    background: var(--accent-dim);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Optional photo button (e.g. letters) */
.tasks-photo-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 2px 6px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
.tasks-photo-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* Skip button */
.tasks-skip-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 2px 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    border-radius: 4px;
    font-weight: 500;
}
.tasks-skip-btn:active {
    background: var(--accent-dim);
}

/* Dismiss button (X icon, for guest_request/manual tasks) */
.tasks-dismiss-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.tasks-dismiss-btn .material-symbols-outlined {
    font-size: 16px;
    color: var(--text-muted);
}
.tasks-dismiss-btn:active .material-symbols-outlined {
    color: var(--red, #e53935);
}

/* Dismissed system task state */
.tasks-item--dismissed {
    opacity: 0.4;
}
.tasks-item--dismissed .tasks-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}
.tasks-dismissed-icon {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: -2px;
}
.tasks-dismissed-label {
    font-size: 0.55rem;
    background: var(--accent-dim);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}
/* Skipped system task state */
.tasks-item--sys-skipped {
    opacity: 0.4;
}
.tasks-item--sys-skipped .tasks-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Photo task inline thumbnails */
.tasks-photo-thumbs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-left: auto;
    flex-shrink: 0;
}
.tasks-photo-inline-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}
.tasks-photo-inline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tasks-checkbox--photo .material-symbols-outlined {
    color: var(--blue);
}
.tasks-checkbox--photo.tasks-checkbox--checked .material-symbols-outlined {
    color: var(--green);
}
/* Photo manage overlay */
.photo-manage-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}
.photo-manage-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}
.photo-manage-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-manage-delete-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 80, 80, 0.5);
    border-radius: 12px;
    background: transparent;
    color: #ff6b6b;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 12px;
}
.photo-manage-delete-all .material-symbols-outlined {
    font-size: 1.1rem;
}

/* Area header right side (report + badge) */
.tasks-area-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
/* Report button in area header */
.tasks-area-report {
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.65rem;
    flex-shrink: 0;
    padding: 3px 8px;
    opacity: 0.55;
    white-space: nowrap;
}

/* App feedback button at bottom of task list */
.tasks-feedback-section {
    padding: 20px 0 40px;
    text-align: center;
}
.tasks-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
}
.tasks-feedback-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* Report / Feedback overlay */
/* ── Form screen (light page overlay for reports, product requests, feedback) ── */
.form-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.form-screen-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px 40px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.form-screen-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.form-cat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}
.form-cat-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}
.form-cat-btn .material-symbols-outlined { font-size: 0.95rem; }
.form-cat-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(0,0,0,0.25);
}
.form-photo-row { margin-bottom: 12px; }
.form-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}
.form-photo-btn .material-symbols-outlined { font-size: 1.2rem; }
.report-photo-preview {
    position: relative;
    width: 100%;
    max-height: 180px;
    border-radius: 12px;
    overflow: hidden;
}
.report-photo-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}
.report-photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.report-photo-remove .material-symbols-outlined { font-size: 1rem; }
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
    min-height: 80px;
    box-sizing: border-box;
}
.form-textarea::placeholder { color: var(--text-muted); }
.form-textarea:focus { outline: none; border-color: rgba(0,0,0,0.25); }
.form-screen-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.form-screen-submit:disabled { opacity: 0.5; }
.form-screen-submit .material-symbols-outlined { font-size: 1.2rem; }

/* Congratulatory banner */
.tasks-congrats {
    text-align: center;
    padding: 20px 16px;
    margin: 8px 0 4px;
    background: var(--green-dim);
    border-radius: var(--radius);
    border: 1px solid rgba(45, 122, 80, 0.15);
    animation: tasksCongratsFade 0.5s ease-out;
}
.tasks-congrats-emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}
.tasks-congrats-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--green);
    font-weight: 600;
}
.tasks-congrats-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
@keyframes tasksCongratsFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Task toast notification */
.task-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    white-space: nowrap;
    max-width: 85vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Photo indicator on area header */
.tasks-photo-indicator {
    font-size: 0.85rem;
    color: var(--green);
    margin-right: 4px;
}

/* Room photo section */
.tasks-photo-section {
    padding: 8px 12px 12px;
    border-top: 1px solid var(--border);
}
.tasks-photo-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.tasks-photo-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
}
.tasks-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tasks-camera-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}
.tasks-camera-btn:active {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
}
.tasks-camera-btn .material-symbols-outlined {
    font-size: 1.1rem;
}

/* Photo overlay */
.photo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-overlay-img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}
.photo-overlay-close {
    position: absolute;
    top: env(safe-area-inset-top, 12px);
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 12px;
}
.photo-overlay-delete {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 50, 50, 0.85);
    border: none;
    color: #fff;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.photo-overlay-delete .material-symbols-outlined {
    font-size: 1.1rem;
}

/* Photo capture session overlay */
.photo-capture-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-capture-content {
    text-align: center;
    color: #fff;
    padding: 32px 24px;
    max-width: 320px;
    width: 100%;
}
.photo-capture-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.photo-capture-counter {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 28px;
}
.photo-capture-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
}
.photo-capture-btn:disabled {
    opacity: 0.5;
}
.photo-capture-btn .material-symbols-outlined {
    font-size: 1.3rem;
}
.photo-capture-done {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ── Photo screen (full-page overlay) ── */
.photo-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.photo-screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.photo-screen-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    padding: 0;
}
.photo-screen-back .material-symbols-outlined { font-size: 1.3rem; }
.photo-screen-title {
    font-family: 'Marcellus', serif;
    font-size: 1.1rem;
    font-weight: 400;
}
.photo-screen-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px 40px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.photo-screen-counter {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.photo-screen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 24px;
}
.photo-screen-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}
.photo-screen-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.photo-screen-thumb-x {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.photo-screen-thumb-x .material-symbols-outlined { font-size: 0.85rem; }
.photo-screen-take-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
}
.photo-screen-take-btn .material-symbols-outlined { font-size: 1.3rem; }
.photo-screen-delete-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 80, 80, 0.4);
    border-radius: 12px;
    background: transparent;
    color: #ff6b6b;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 12px;
}
.photo-screen-delete-all .material-symbols-outlined { font-size: 1.1rem; }
.photo-screen-delete-all:disabled { opacity: 0.4; }
.photo-screen-thumb--uploading { opacity: 0.45; }

/* Celebration overlay */
.celebration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: celebrationIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.celebration-overlay--out {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}
.celebration-content {
    text-align: center;
    color: #fff;
    padding: 24px;
}
.celebration-emoji {
    font-size: 64px;
    margin-bottom: 12px;
    animation: celebrationBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.celebration-sub {
    font-size: 0.9rem;
    opacity: 0.7;
}
@keyframes celebrationIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes celebrationBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---- Install Banner ---- */
.install-banner {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9000;
    transform: translateY(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    opacity: 0;
}
.install-banner--in {
    transform: translateY(0);
    opacity: 1;
}
.install-banner--out {
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.25s ease-in, opacity 0.2s;
}
.install-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.install-banner-text {
    flex: 1;
    min-width: 0;
}
.install-banner-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text);
}
.install-banner-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.install-banner-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.install-banner-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ---- Install Card (Handbook tab) ---- */
.install-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 24px 0 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.install-card:active {
    background: var(--bg-card-hover);
}
.install-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.install-card-text {
    flex: 1;
    min-width: 0;
}
.install-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text);
}
.install-card-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1px;
}
.install-card-arrow {
    color: var(--text-muted);
    font-size: 20px;
    flex-shrink: 0;
}

/* ---- iOS Install Help Overlay ---- */
.install-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    animation: celebrationIn 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.install-help-overlay--out {
    opacity: 0;
    transition: opacity 0.25s;
}
.install-help-card {
    background: var(--bg);
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 100%;
    margin-bottom: env(safe-area-inset-bottom);
}
.install-help-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-align: center;
}
.install-help-step {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.install-help-step:last-of-type {
    border-bottom: none;
}
.install-help-num {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
    min-width: 20px;
}
.install-help-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.install-help-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}
.install-help-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
}

/* --- FAB (floating action button) --- */
.tasks-fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 50;
}
.tasks-fab .material-symbols-outlined {
    font-size: 28px;
}
.tasks-fab:active {
    transform: scale(0.92);
}

/* --- Request modal --- */
.request-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.request-modal {
    background: var(--bg);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 420px;
    padding: 16px;
    max-height: 80vh;
    overflow-y: auto;
}
.request-house-pick {
    border-radius: 16px;
    margin-bottom: env(safe-area-inset-bottom, 0);
    text-align: center;
    padding: 24px;
}
.request-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.request-modal-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}
.request-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.request-modal-close .material-symbols-outlined {
    font-size: 22px;
    color: var(--text-secondary);
}
.request-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.request-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    text-align: center;
}
.request-modal-item:active {
    background: var(--accent-dim);
}
.request-modal-item-icon {
    font-size: 28px;
    color: var(--accent);
}
.request-modal-item-label {
    font-size: 0.75rem;
    color: var(--text);
    line-height: 1.3;
}
.request-modal-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 0.7rem;
}
.request-modal-divider::before,
.request-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.request-modal-custom-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.request-modal-room-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.request-modal-room-chip {
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}
.request-modal-room-chip.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.request-modal-custom {
    display: flex;
    gap: 8px;
}
.request-modal-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
}
.request-modal-input:focus {
    border-color: var(--accent);
}
.request-modal-send {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.request-modal-send .material-symbols-outlined {
    font-size: 20px;
}
.request-modal-rooms {
    padding: 8px 0;
}
.request-modal-rooms-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.request-modal-room-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.request-modal-room-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}
.request-modal-room-btn:active {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* "Address neighbours" button on the conversation composer */
.compose-neighbors-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}
.compose-neighbors-btn:hover {
    color: var(--blue, #1976d2);
}
.compose-neighbors-btn .material-symbols-outlined {
    font-size: 22px;
}

/* Broadcast modal — extends request-modal with multiline content */
.broadcast-modal {
    max-width: 500px;
}
.broadcast-modal-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.broadcast-modal-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.broadcast-modal-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 12px 0 4px;
}
.broadcast-modal-row .broadcast-modal-label {
    margin: 0;
}
.broadcast-modal-select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
}
.broadcast-modal-mode {
    display: flex;
    gap: 6px;
}
.broadcast-modal-mode-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}
.broadcast-modal-mode-btn.selected {
    background: var(--blue, #1976d2);
    color: #fff;
    border-color: var(--blue, #1976d2);
}
.broadcast-modal-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #c2772a;
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px 0;
}
.broadcast-modal-warning .material-symbols-outlined {
    font-size: 16px;
}
.broadcast-modal-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}
.broadcast-modal-recipients {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
}
.broadcast-modal-recipient {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.broadcast-modal-recipient:hover {
    background: var(--card);
}
.broadcast-modal-recipient-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
.broadcast-modal-recipient-name {
    font-size: 0.82rem;
    color: var(--text);
}
.broadcast-modal-recipient-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.broadcast-modal-recipient--leaving .broadcast-modal-recipient-name {
    color: var(--text-secondary);
}
.broadcast-modal-recipient--leaving .broadcast-modal-recipient-sub {
    color: #c2772a;
}
.broadcast-modal-subgroup-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.broadcast-modal-subgroup-header .material-symbols-outlined {
    font-size: 18px;
}
.broadcast-modal-recipients--leaving {
    margin-top: 4px;
    opacity: 0.85;
}
.broadcast-modal-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.broadcast-modal-textarea:focus {
    border-color: var(--blue, #1976d2);
    outline: none;
}
.broadcast-modal-preview {
    background: rgba(25, 118, 210, 0.05);
    border-left: 2px solid var(--blue, #1976d2);
    padding: 6px 10px;
    margin: 6px 0 4px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.broadcast-modal-preview-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.broadcast-modal-preview-line {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 2px 0;
}
.broadcast-modal-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 8px 0 4px;
    cursor: pointer;
}
.broadcast-modal-footer {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.broadcast-modal-cancel {
    flex: 0 0 auto;
    padding: 10px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}
.broadcast-modal-send {
    flex: 1;
    padding: 10px 16px;
    background: var(--blue, #1976d2);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.broadcast-modal-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Template Manager
   --------------------------------------------------------------------------- */
.tmpl-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}
.tmpl-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.tmpl-card:active {
    background: var(--bg-card-hover);
}
.tmpl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tmpl-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}
.tmpl-card-badges {
    display: flex;
    gap: 6px;
}
.tmpl-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.tmpl-badge-sections {
    background: var(--accent-dim);
    color: var(--accent);
}
.tmpl-badge-enabled {
    background: var(--green-dim);
    color: var(--green);
}
.tmpl-badge-disabled {
    background: var(--red-dim);
    color: var(--red);
}
.tmpl-badge-category {
    background: var(--blue-dim, rgba(74, 123, 181, 0.1));
    color: var(--blue);
}
.tmpl-badge-overrides {
    background: var(--orange-dim);
    color: var(--orange);
}
.tmpl-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.tmpl-card-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}
/* Section cards */
.tmpl-section-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
}
.tmpl-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.tmpl-section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.tmpl-section-badges {
    display: flex;
    gap: 6px;
}
.tmpl-section-default-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green);
    margin-bottom: 4px;
}
.tmpl-section-body {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
/* Clickable URLs in template bodies */
.tmpl-link {
    color: var(--accent);
    text-decoration: underline;
    word-break: break-all;
}
/* Variants (sections at same sort_order) */
.tmpl-variant {
    padding-bottom: 4px;
}
.tmpl-variant-alt {
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-top: 8px;
}
.tmpl-variant-toggle {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.tmpl-variant-toggle-btn {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
}
.tmpl-variant-container {
    margin-top: 4px;
}
/* Override expansion */
.tmpl-overrides-container {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.tmpl-overrides-loading, .tmpl-overrides-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 0;
}
.tmpl-override-card {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.tmpl-override-card:last-child {
    margin-bottom: 0;
}
.tmpl-override-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}
.tmpl-variant-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.tmpl-variant-chip {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.tmpl-override-listing {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}
.tmpl-badge-code {
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    font-family: monospace;
}
.tmpl-override-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
/* Diff view pills */
.tmpl-diff-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
}
.tmpl-diff-pill {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}
.tmpl-diff-default {
    background: var(--green-dim);
    color: var(--green);
}
.tmpl-diff-override {
    background: var(--orange-dim);
    color: var(--orange);
}
.tmpl-diff-n\/a {
    background: var(--bg-input);
    color: var(--text-muted);
}
/* Preview view */
.tmpl-preview-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.tmpl-preview-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}
.tmpl-preview-select {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border, #e0e0e0);
    background: var(--bg-card);
    font-size: 0.85rem;
    color: var(--text);
}
.tmpl-preview-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text);
}
.tmpl-placeholder {
    background: rgba(74, 123, 181, 0.15);
    color: var(--blue);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.82rem;
}
.header-title {
    font-family: 'Marcellus', serif;
    font-size: 1.1rem;
    color: var(--text);
}
