/* ============================================================
   ShareTree v2 — Design System (UI/UX Pro Max)

   Typography: Outfit (headings) + Work Sans (body)
   Colors: Nature green palette (#15803D primary)
   Style: Trust & Authority, mobile-first
   ============================================================ */

/* Google Fonts loaded via <link> in _Layout.cshtml — not @import (render-blocking) */

/* --- Design Tokens --- */
:root {
    --green-900: #14532D;
    --green-800: #166534;
    --green-700: #15803D;
    --green-600: #16A34A;
    --green-500: #22C55E;
    --green-400: #4ADE80;
    --green-300: #86EFAC;
    --green-200: #BBF7D0;
    --green-100: #DCFCE7;
    --green-50:  #F0FDF4;
    --accent:    #B45309;
    --accent-light: #FEF3C7;

    --bg:        #F0FDF4;
    --bg-card:   #FFFFFF;
    --text:      #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border:    #E2EFE7;
    --destructive: #DC2626;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 200ms;
    --duration-slow: 300ms;

    /* --- Container widths --- */
    --container-xs: 380px;
    --container-sm: 440px;
    --container-md: 640px;
    --container-lg: 960px;
    --container-xl: 1120px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* --- Focus States (Accessibility) --- */
:focus-visible {
    outline: 3px solid var(--green-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--green-700);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    z-index: 9999;
    transition: top var(--duration) var(--ease-out);
}
.skip-link:focus {
    top: 16px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--green-700);
    color: #FFFFFF;
    border-color: var(--green-700);
}
.btn-primary:hover {
    background: var(--green-800);
    border-color: var(--green-800);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.35);
}
.btn-secondary:hover {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    color: #FFFFFF;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
    min-height: 52px;
    border-radius: var(--radius-lg);
}

.btn-block { display: flex; width: 100%; }

.btn-sm {
    min-height: 36px;
    padding: 8px 20px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.nav-cta {
    margin-left: 8px;
    flex-shrink: 0;
}

.btn-outline {
    background: transparent;
    color: var(--green-700);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--green-600);
    background: var(--green-50);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    min-height: auto;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
}
.btn-ghost:hover { color: var(--green-700); background: var(--green-50); }

/* ============================================================
   Shared Page Layout
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 640px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--green-800);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}
.logo-tree-mini {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-tree-mask {
    position: absolute;
    inset: 0;
    width: 28px;
    height: 28px;
    background-color: var(--green-700);
    -webkit-mask-image: url('/images/tree.png');
    mask-image: url('/images/tree.png');
    -webkit-mask-size: 28px 28px;
    mask-size: 28px 28px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    z-index: 1;
}

.logo-tree-qr {
    display: none;
}

.header-link {
    text-decoration: none;
    color: var(--green-700);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--duration) var(--ease-out);
}
.header-link:hover { background: var(--green-50); }

/* ============================================================
   Landing Page
   ============================================================ */
.landing-hero {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(165deg, #052e16 0%, #14532D 35%, #166534 70%, #15803D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

/* Subtle texture overlay */
.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.04) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.03) 0%, transparent 40%);
    pointer-events: none;
}

.landing-content {
    text-align: center;
    max-width: 440px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.landing-logo-composite {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.landing-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.landing-logo-qr {
    position: absolute;
    top: 15%;
    left: 15.5%;
    width: 71%;
    height: 65%;
    object-fit: contain;
    opacity: 0.8;
}

.landing-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.landing-tagline {
    font-size: 1.1rem;
    color: var(--green-300);
    margin-bottom: 40px;
    font-weight: 400;
}

.landing-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1.4;
}

.landing-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
}

.landing-feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--green-300);
    stroke-width: 2;
    fill: none;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing .btn-primary {
    background: #FFFFFF;
    color: var(--green-900);
    border-color: #FFFFFF;
    font-weight: 700;
}
.landing .btn-primary:hover {
    background: var(--green-100);
    border-color: var(--green-100);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

@media (min-width: 480px) {
    .landing-title { font-size: 3.25rem; }
    .landing-logo-composite { width: 180px; height: 180px; }
}

/* ============================================================
   Setup Page
   ============================================================ */
.setup-content {
    max-width: 440px;
    margin: 0 auto;
    padding: 32px 20px 40px;
    text-align: center;
}

.setup-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.setup-content .subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.qr-card {
    background: linear-gradient(180deg, #FFFFFF 0%, var(--green-50) 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 24px -4px rgba(21, 128, 61, 0.12), 0 2px 8px -2px rgba(21, 128, 61, 0.06);
    padding: 40px 28px 32px;
    margin-bottom: 24px;
    border: 1px solid var(--green-200);
    text-align: center;
}

/* Tree + QR composite */
.tree-qr-composite {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 8px;
}

.tree-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: var(--green-700);
    -webkit-mask-image: url('/images/tree.png');
    mask-image: url('/images/tree.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Hidden img so the download JS can still access the src */
.tree-bg-hidden {
    display: none;
}

.tree-qr-overlay {
    position: absolute;
    /* Center QR in the open canopy area of the tree */
    top: 15%;
    left: 15.5%;
    width: 71%;
    height: 65%;
    object-fit: contain;
    z-index: 0; /* Behind the tree so leaves overlay the QR */
}

.qr-scan-hint {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--green-600);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qr-scan-hint svg {
    width: 14px;
    height: 14px;
}

.qr-divider {
    width: 48px;
    height: 2px;
    background: var(--green-300);
    border-radius: 1px;
    margin: 0 auto 16px;
}

.qr-label {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-900);
    outline: none;
    padding: 6px 12px;
    border-bottom: 2px dashed transparent;
    transition: all var(--duration) var(--ease-out);
    display: inline-block;
    min-width: 120px;
    border-radius: var(--radius-sm);
}
.qr-label:hover, .qr-label:focus {
    border-bottom-color: var(--green-400);
    background: rgba(255, 255, 255, 0.7);
}

.qr-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* ============================================================
   Feedback Page (Customer — the money page)
   ============================================================ */
.feedback-body {
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
}

.feedback-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 20px;
}

.feedback-form {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.feedback-logo {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.feedback-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.feedback-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.feedback-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 1px solid var(--border);
}

.feedback-textarea {
    width: 100%;
    min-height: 140px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    resize: vertical;
    transition: border-color var(--duration) var(--ease-out);
    outline: none;
    line-height: 1.6;
    background: var(--bg);
}
.feedback-textarea:focus {
    border-color: var(--green-500);
    background: var(--bg-card);
}
.feedback-textarea::placeholder {
    color: var(--text-muted);
}

.feedback-send {
    width: 100%;
    margin-top: 16px;
    min-height: 52px;
    background: var(--green-700);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.feedback-send:hover { background: var(--green-800); box-shadow: var(--shadow-md); }
.feedback-send:active { transform: scale(0.98); }

.feedback-footer {
    margin-top: 28px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.feedback-footer strong { color: var(--green-700); font-weight: 600; }

.feedback-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: left;
}

/* --- Sent Confirmation --- */
.sent-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 20px;
    text-align: center;
}

.sent-checkmark {
    width: 80px;
    height: 80px;
    background: var(--green-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: checkPop 0.4s var(--ease-spring);
}
.sent-checkmark svg {
    width: 40px;
    height: 40px;
    stroke: #FFFFFF;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.sent-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.sent-page p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 280px;
}
.sent-page .btn {
    min-width: 200px;
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.dashboard-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.conversation-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    overflow: hidden;
}
.conversation-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--green-200);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

.sender-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--green-100);
    color: var(--green-800);
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
}

.card-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-preview {
    padding: 4px 20px 16px;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-thread {
    border-top: 1px solid var(--border);
    background: var(--green-50);
    padding: 16px 20px;
    display: none;
}
.card-thread.open { display: block; }

.thread-messages {
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --- Chat Bubbles (shared: dashboard + conversation) --- */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.93rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-theirs {
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-mine {
    background: var(--green-700);
    color: #FFFFFF;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 3px;
}
.message-mine .message-time { color: rgba(255,255,255,0.65); }

/* --- Reply Bar --- */
.reply-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}
.reply-bar input {
    flex: 1;
    min-height: 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.93rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--duration) var(--ease-out);
    background: var(--bg-card);
}
.reply-bar input:focus { border-color: var(--green-500); }

.reply-bar button {
    min-height: 44px;
    min-width: 44px;
    padding: 0 18px;
    background: var(--green-700);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background var(--duration) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.reply-bar button:hover { background: var(--green-800); }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}
.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--green-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--green-700);
    stroke-width: 1.5;
    fill: none;
}

/* ============================================================
   Conversation Page (Customer Chat)
   ============================================================ */
.conversation-body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
}

.conversation-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 640px;
    margin: 0 auto;
}

.conversation-header {
    background: var(--green-800);
    color: #FFFFFF;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.conversation-header img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}
.conversation-header span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
}

.conversation-compose {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    gap: 8px;
    background: var(--bg-card);
    flex-shrink: 0;
}
.conversation-compose input {
    flex: 1;
    min-height: 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--duration) var(--ease-out);
    background: var(--bg);
}
.conversation-compose input:focus {
    border-color: var(--green-500);
    background: var(--bg-card);
}

.conversation-compose button {
    min-height: 44px;
    min-width: 44px;
    padding: 0 18px;
    background: var(--green-700);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.conversation-compose button:hover { background: var(--green-800); }

/* ============================================================
   Responsive: Tablet+ enhancements
   ============================================================ */
@media (min-width: 768px) {
    .dashboard-content {
        padding: 32px 24px 48px;
    }
    .setup-content {
        padding-top: 48px;
    }
    .conversation-card {
        border-radius: var(--radius-lg);
    }
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0 20px;
}
.site-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-xl);
    margin: 0 auto;
    height: 60px;
}
.site-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--green-800);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}
.nav-logo-tree {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}
.site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.site-nav-links a {
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease-out);
}
.site-nav-links a:hover {
    color: var(--green-700);
    background: var(--green-50);
}
.site-nav-links a.active {
    color: var(--green-700);
    font-weight: 600;
}
.site-nav-links .btn-primary {
    color: #FFFFFF;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
}
.nav-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.nav-mobile {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFFFFF;
    z-index: 99;
    padding: 16px 20px;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--border);
}
.nav-mobile.open {
    display: flex;
}
.nav-mobile a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--radius-sm);
}
.nav-mobile a:hover {
    background: var(--green-50);
    color: var(--green-700);
}
.nav-mobile .btn {
    margin-top: 8px;
}

@media (max-width: 767px) {
    .site-nav-links { display: none; }
    .nav-toggle { display: block; }
}

/* ============================================================
   Form Components
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-input {
    min-height: 44px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: #FFFFFF;
    transition: border-color var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
    width: 100%;
}
.form-input:focus {
    outline: none;
    border-color: var(--green-500);
    background: var(--bg-card);
}
.form-input.error {
    border-color: var(--destructive);
}
.form-error {
    font-size: 0.8125rem;
    color: var(--destructive);
    font-weight: 500;
}
.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.password-wrapper {
    position: relative;
}
.password-wrapper .form-input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}
.password-toggle:hover {
    color: var(--text-secondary);
}

/* ============================================================
   Card
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration) var(--ease-out), visibility var(--duration);
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: #FFFFFF;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    padding: 32px;
    transform: scale(0.95);
    transition: transform var(--duration) var(--ease-out);
}
.modal-overlay.open .modal {
    transform: scale(1);
}
.modal-title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.modal-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--text);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}
.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Badge
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: var(--green-100);
    color: var(--green-800);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}
.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
    margin-bottom: 12px;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
    gap: 16px;
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--green-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-700);
}
.empty-state-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
.empty-state-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}
.empty-state-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.6;
}

/* ============================================================
   Layout Utilities
   ============================================================ */
.container-xs { max-width: var(--container-xs); margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: var(--container-sm); margin: 0 auto; padding: 0 20px; }
.container-md { max-width: var(--container-md); margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: var(--container-lg); margin: 0 auto; padding: 0 20px; }
.container-xl { max-width: var(--container-xl); margin: 0 auto; padding: 0 20px; }

.page-content {
    min-height: calc(100dvh - 60px);
    padding-top: 32px;
    padding-bottom: 48px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.site-footer a {
    color: var(--green-700);
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   Tree+QR Composite System
   ============================================================ */
.tree-qr-composite {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.tree-qr-composite .tree-qr-tree {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}
.tree-qr-composite .tree-qr-code {
    position: absolute;
    top: 15%;
    left: 15.5%;
    width: 71%;
    height: 65%;
    object-fit: contain;
    z-index: 0;
}

/* Variant: Nav logo (36px, green on white bg) */
.tree-qr-nav {
    width: 36px;
    height: 36px;
}

/* Variant: Header/login/signup (96px, green) */
.tree-qr-header {
    width: 96px;
    height: 96px;
}

/* Variant: Hero (450px, white on dark green) */
.tree-qr-hero {
    width: 450px;
    height: 450px;
}
.tree-qr-hero .tree-qr-tree,
.tree-qr-hero .tree-qr-code {
    filter: brightness(0) invert(1);
}

/* Variant: Marketing sections (140px, green on light bg) */
.tree-qr-sm {
    width: 140px;
    height: 140px;
}

/* Hero tree (white on dark green, no QR — replaced by SkiaSharp composite in Phase 2) */
.hero-tree {
    width: 420px;
    height: 420px;
    object-fit: contain;
}
.step-composite {
    width: 140px;
    height: 140px;
    object-fit: contain;
}
.auth-header-composite {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 16px;
}

/* ============================================================
   Layout Utility Classes (extracted from inline styles)
   ============================================================ */
[id] { scroll-margin-top: 80px; }
.text-center { text-align: center; }
.section-narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.section-narrow-sm { max-width: 520px; margin-left: auto; margin-right: auto; }
.mb-48 { margin-bottom: 48px; }

/* Auth page utilities */
.page-logo { mix-blend-mode: multiply; display: block; margin: 0 auto; }
.auth-logo { height: 80px; width: auto; }

.auth-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 24px;
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.auth-footer-muted {
    text-align: center;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.link-primary {
    color: var(--green-700);
    text-decoration: none;
    font-weight: 500;
}
.link-primary:hover {
    text-decoration: underline;
}
.form-group-spaced {
    margin-bottom: 16px;
}
.form-group-spaced-lg {
    margin-bottom: 24px;
}
.form-error-summary {
    margin-bottom: 16px;
}

/* ============================================================
   Homepage
   ============================================================ */

/* Hero */
.hero {
    background: linear-gradient(165deg, #052e16 0%, #14532D 35%, #166534 70%, #15803D 100%);
    padding: 56px 20px 48px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-logo {
    width: auto;
    height: 240px;
    object-fit: contain;
    margin-bottom: 12px;
}
.hero-wordmark {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    margin-bottom: 32px;
}
.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 540px;
}
.hero-subtitle {
    font-size: 1.125rem;
    color: var(--green-300);
    line-height: 1.5;
    margin-bottom: 32px;
}
.hero-anchor {
    font-size: 0.9375rem;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 28px;
}
.hero-note {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.75);
    margin-top: 12px;
}

/* Hero CTA: white button on dark green background */
.hero .btn-primary {
    background: #FFFFFF;
    color: var(--green-800);
    border-color: #FFFFFF;
}
.hero .btn-primary:hover {
    background: var(--green-100);
    border-color: var(--green-100);
    color: var(--green-900);
}

/* Sections */
.section {
    padding: 64px 20px;
}
.section-alt {
    background: #FFFFFF;
}
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.section-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* How It Works — Elevated Cards */
.steps-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 0;
}
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px 24px;
    text-align: center;
    flex: 1;
    max-width: 280px;
    transition: box-shadow var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}
.step-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.step-card-header {
    margin-bottom: 16px;
}
.step-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--green-100);
    color: var(--green-700);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}
.step-card-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 140px;
    align-items: center;
}
.step-icon-lg {
    width: 80px;
    height: 80px;
    background: var(--green-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-700);
}
.step-card-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.step-card-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Customer scan callout */
.scan-callout {
    max-width: 480px;
    margin: 32px auto 0;
    background: var(--green-50);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
}
.scan-callout-label {
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--green-700);
    margin-bottom: 4px;
}
.scan-callout-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Connecting arrows between steps */
.step-connector {
    flex-shrink: 0;
    color: var(--green-300);
    padding: 0 8px;
}

/* Scroll-triggered fade-in */
.step-animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.step-animate.step-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .step-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Why It Works — Reason Cards */
.reason-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 32px;
}
.reason-card {
    padding: 28px 24px;
    text-align: center;
}
.reason-card .step-icon-lg {
    margin: 0 auto 16px;
}
.reason-card-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.reason-card-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
@media (min-width: 768px) {
    .reason-cards { grid-template-columns: repeat(3, 1fr); }
}

/* Pricing Preview */
.pricing-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 32px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.pricing-card {
    padding: 32px 24px;
    text-align: center;
}
.pricing-card-pro {
    border-color: var(--accent);
    border-width: 2px;
}
.pricing-tier {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.pricing-price {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.pricing-period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}
.pricing-features {
    list-style: none;
    margin: 24px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pricing-features li {
    position: relative;
    padding-left: 24px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}
.pricing-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--green-100);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8l3 3 5-5' stroke='%2315803D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.pricing-feature-sub {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding-left: 0;
    margin-top: 2px;
    font-style: normal;
}
.pricing-coming-soon {
    font-size: 0.8125rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}
.pricing-anchor {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 24px;
}

.pricing-card .btn-outline {
    border: 2px solid var(--green-700);
    color: var(--green-700);
}

/* Pricing Page (dedicated /pricing) */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 32px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 640px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* FAQ */
.faq-list {
    max-width: 640px;
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 0;
}
.faq-question {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding: 16px 0;
    cursor: pointer;
    list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: '+';
    float: right;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
details[open] .faq-question::after {
    content: '−';
}
.faq-answer {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0 0 16px;
    margin: 0;
}

/* How It Works Page */
.hiw-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 640px;
    margin: 0 auto;
}
.hiw-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.hiw-step-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: var(--green-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-700);
}
.hiw-step-content {
    flex: 1;
    min-width: 0;
}
.hiw-step-content .step-badge {
    margin-bottom: 8px;
}
.hiw-step-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 8px 0 6px;
}
.hiw-step-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Error Pages */
.error-page {
    padding: 96px 20px;
}
.error-logo {
    height: 120px;
    width: auto;
    mix-blend-mode: multiply;
    margin-bottom: 24px;
}
.error-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.error-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto 24px;
}

/* Final CTA */
.section-cta {
    background: linear-gradient(135deg, #14532D 0%, #15803D 100%);
    padding: 64px 20px;
}
.section-cta .section-title {
    color: #FFFFFF;
}
.btn-cta-inverse {
    background: #FFFFFF;
    color: var(--green-800);
    margin-top: 16px;
}
.section-cta-text {
    color: rgba(255,255,255,0.8);
    margin-bottom: 24px;
}

/* Sent confirmation checkmark */
.sent-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--green-100);
    border-radius: 50%;
    animation: checkPop 0.4s var(--ease-spring);
}
@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Customer Conversation Page */
.conv-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}
.conv-header {
    background: var(--green-800);
    color: #FFFFFF;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}
.conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg);
}
.conv-msg {
    max-width: 80%;
}
.conv-msg--mine {
    align-self: flex-end;
}
.conv-msg--theirs {
    align-self: flex-start;
}
.conv-msg-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.conv-msg--mine .conv-msg-bubble {
    background: var(--green-700);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}
.conv-msg--theirs .conv-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.conv-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    padding: 0 4px;
}
.conv-msg--mine .conv-msg-time {
    text-align: right;
}
.conv-compose {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Responsive — Tablet+ */
@media (min-width: 768px) {
    .pricing-preview { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .hero-title { font-size: 2.75rem; }
    .hero-logo { height: 280px; }
    .hero-wordmark { font-size: 3rem; }
}

/* Mobile */
@media (max-width: 767px) {
    .hero { padding: 36px 20px 32px; min-height: auto; }
    .hero-logo { height: 160px; }
    .hero-wordmark { font-size: 1.75rem; letter-spacing: 0.03em; margin-bottom: 20px; }
    .hero-title { font-size: 1.75rem; }

    /* Steps stack vertically on mobile */
    .steps-v2 { flex-direction: column; gap: 16px; }
    .step-card { max-width: 100%; }
    .step-connector { display: none; }
    .step-card-visual { min-height: 100px; }
    .tree-qr-sm { width: 100px; height: 100px; }
}

/* ============================================================
   Dashboard — Conversation Inbox
   ============================================================ */
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: box-shadow var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}
.dash-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--green-200);
}
.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.dash-card-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dash-card-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--green-500);
    border-radius: 50%;
    flex-shrink: 0;
}
.dash-thread {
    display: none;
    background: var(--green-50);
    border-top: 1px solid var(--border);
    margin: 12px -20px -16px;
    padding: 16px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.dash-thread-messages {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 4px;
}
.dash-card.expanded .dash-thread {
    display: block;
}
.dash-msg {
    max-width: 80%;
    margin-bottom: 6px;
}
.dash-msg--mine {
    margin-left: auto;
}
.dash-msg-bubble {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.dash-msg--mine .dash-msg-bubble {
    background: var(--green-700);
    color: #fff;
    border-bottom-right-radius: 2px;
}
.dash-msg--theirs .dash-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 2px;
}
.dash-msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
    padding: 0 4px;
}
.dash-msg--mine .dash-msg-time { text-align: right; }
.dash-reply {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-end;
}
.dash-reply .form-input {
    flex: 1;
    min-height: 40px;
}
.upgrade-prompt {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    text-align: center;
}
.upgrade-prompt p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 12px;
}

/* ============================================================
   Manage Codes
   ============================================================ */
.code-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    transition: opacity var(--duration) var(--ease-out);
}
.code-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.code-card-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 2px dashed transparent;
    padding: 2px 4px;
    outline: none;
    border-radius: 2px;
    transition: border-color var(--duration) var(--ease-out);
}
.code-card-label:hover, .code-card-label:focus {
    border-bottom-color: var(--green-400);
}
.code-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: wrap;
    overflow: hidden;
}
.code-card-meta span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.code-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.toggle-active {
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    min-height: 36px;
    font-family: var(--font-body);
    transition: background var(--duration) var(--ease-out), color var(--duration) var(--ease-out);
}
.toggle-active:hover {
    background: var(--green-50);
    color: var(--green-700);
}
.code-inactive {
    opacity: 0.5;
}

/* ============================================================
   Setup Page
   ============================================================ */
.setup-page-content {
    padding-top: 32px;
}
.setup-page-header {
    text-align: center;
    margin-bottom: 24px;
}
.setup-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.setup-page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}
.setup-name-wrap {
    text-align: center;
    margin-bottom: 24px;
}
.setup-editable-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px dashed var(--border);
    padding: 4px 8px;
    outline: none;
    display: inline-block;
}
.setup-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}
.setup-qr-card {
    text-align: center;
    padding: 32px 24px;
    margin-bottom: 24px;
}
.setup-qr-display {
    width: 240px;
    height: 240px;
    margin: 0 auto;
}
.card-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.card-section-title-sm {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.setup-download-row {
    display: flex;
    gap: 10px;
}
.setup-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.setup-link-code {
    flex: 1;
    padding: 10px 12px;
    background: var(--green-50);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
}
.setup-link-copy {
    flex-shrink: 0;
}
.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.setup-action-ghost {
    text-align: center;
}

/* ============================================================
   Dashboard Page
   ============================================================ */
.dash-page-content {
    padding: 32px 20px 64px;
}
.dash-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.dash-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.dash-page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.dash-empty-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}
.dash-prefix {
    color: var(--text-muted);
    margin-right: 4px;
}
.dash-prefix-italic {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================
   Customer Feedback Page (c.cshtml)
   ============================================================ */
.feedback-page-top {
    padding-top: 64px;
    text-align: center;
}
.feedback-page-top-sm {
    padding-top: 32px;
}
.feedback-sent-wrap {
    margin-bottom: 24px;
}
.feedback-sent-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.feedback-sent-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 24px;
}
.feedback-header {
    text-align: center;
    margin-bottom: 24px;
}
.feedback-tree-icon {
    width: 32px;
    height: 32px;
    opacity: 0.6;
    margin-bottom: 8px;
}
.feedback-business-name {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.feedback-business-sub {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}
.feedback-card {
    margin-bottom: 16px;
}
.feedback-form-group {
    margin-bottom: 16px;
}
.feedback-textarea {
    min-height: 140px;
    resize: vertical;
}
.feedback-email-details {
    margin-bottom: 16px;
}
.feedback-email-summary {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}
.feedback-email-form {
    margin-top: 8px;
}
.feedback-not-found-btn {
    margin-top: 8px;
}

/* ============================================================
   Conversation Page
   ============================================================ */
.conv-header-icon {
    width: 24px;
    height: 24px;
}
.conv-waiting {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.conv-compose-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.conv-compose-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
}
.conv-compose-btn {
    flex-shrink: 0;
    min-height: 44px;
}

/* ============================================================
   Codes Page
   ============================================================ */
.codes-page-content {
    padding: 32px 20px 80px;
}
.codes-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.codes-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.codes-plan-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.codes-plan-badge-gap {
    margin-left: 6px;
}
.code-card-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.codes-empty-state {
    margin-top: 32px;
}
.setup-download-card {
    margin-bottom: 16px;
}
.setup-link-card {
    margin-bottom: 24px;
}
.dash-empty-state {
    margin-top: 48px;
}
.add-code-card {
    padding: 16px;
}
.add-code-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.add-code-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.add-code-input {
    flex: 1;
}
.add-code-form-wrap {
    display: none;
    margin-bottom: 16px;
}
.code-card-badge-active {
    background: var(--green-100);
    color: var(--green-800);
}
.code-card-badge-inactive {
    background: var(--text-muted);
    color: #fff;
}
.code-card-url {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.codes-empty-actions {
    margin-top: 16px;
}
.modal-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.modal-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-price {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}
.modal-price-period {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}
.modal-price-intro {
    margin-bottom: 16px;
}
.modal-cancel-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================================
   Vertical Landing Pages (/for/{industry})
   ============================================================ */
.vertical-hero {
    min-height: 60vh;
    padding: 48px 20px 40px;
}
.vertical-hero-label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--green-300);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.vertical-hero .hero-title {
    font-size: 2rem;
    max-width: 480px;
}

/* Use case cards */
.vertical-usecases {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 640px;
    margin: 32px auto 0;
}
.vertical-usecase-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.vertical-usecase-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-100);
    border-radius: var(--radius-sm);
    color: var(--green-700);
}
.vertical-usecase-text {
    font-size: 1.0625rem;
    color: var(--text);
    line-height: 1.5;
    padding-top: 8px;
}

@media (min-width: 640px) {
    .vertical-hero .hero-title {
        font-size: 2.5rem;
        max-width: 560px;
    }
    .vertical-usecases {
        gap: 20px;
    }
    .vertical-usecase-card {
        padding: 24px 28px;
    }
}

@media (max-width: 479px) {
    .vertical-hero {
        min-height: auto;
        padding: 36px 20px 32px;
    }
}
