/* ═══════════════════════════════════════════════════════════════════════════
   Saacho Theme — Bakery-inspired design system
   Warm cream, serif typography, copper accents
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Colors ── */
    --cream: #f7f3ed;
    --cream-soft: #faf7f2;
    --cream-dark: #ede7dc;
    --green: #2d6a4f;
    --green-light: #40916c;
    --green-pale: rgba(45,106,79,.08);
    --warm: #c4884d;
    --warm-soft: #e8c9a0;
    --warm-pale: rgba(196,136,77,.1);
    --ink: #1a1a2e;
    --ink-dim: #6b6560;
    --ink-faint: #9a9590;
    --line: #e2ddd6;
    --line-light: #ede9e3;
    --white: #ffffff;

    /* ── Shadows ── */
    --shadow-xs: 0 1px 2px rgba(26,26,46,.04);
    --shadow-sm: 0 2px 0 rgba(26,26,46,.06);
    --shadow-md: 0 4px 12px rgba(26,26,46,.07);
    --shadow-lg: 0 8px 25px rgba(26,26,46,.09);
    --shadow-xl: 0 16px 48px rgba(26,26,46,.12);

    /* ── Typography ── */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    /* ── Radius ── */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* ── Layout ── */
    --header-h: 60px;
    --max-w: 1040px;
    --max-w-narrow: 720px;
    --sidebar-w: 260px;
}

/* ── Dark Mode ── */
@media (prefers-color-scheme: dark) {
    :root {
        --cream: #111111;
        --cream-soft: #181818;
        --cream-dark: #1e1e1e;
        --green: #52b788;
        --green-light: #74c69d;
        --green-pale: rgba(82,183,136,.1);
        --warm: #c4884d;
        --warm-soft: #8a6a4a;
        --warm-pale: rgba(196,136,77,.08);
        --ink: #e8e3dc;
        --ink-dim: #9a9590;
        --ink-faint: #6a6560;
        --line: #2a2a2a;
        --line-light: #222222;
        --white: #1a1a1a;
        --shadow-xs: 0 1px 2px rgba(0,0,0,.15);
        --shadow-sm: 0 2px 0 rgba(0,0,0,.2);
        --shadow-md: 0 4px 12px rgba(0,0,0,.25);
        --shadow-lg: 0 8px 25px rgba(0,0,0,.3);
        --shadow-xl: 0 16px 48px rgba(0,0,0,.4);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    font-size: 15px;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--max-w-narrow); }

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.s-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--cream-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.s-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h);
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
}

.s-logo {
    display: inline-flex; align-items: center; gap: .5rem;
    text-decoration: none; color: inherit;
}

.s-logo img {
    width: 32px; height: 32px; border-radius: 8px;
    transition: transform .3s ease;
}

.s-logo:hover img { transform: rotate(-5deg) scale(1.05); }

.s-logo-text {
    font-family: var(--font-serif); font-size: 1.2rem;
    font-weight: 600; color: var(--ink); letter-spacing: .01em;
}

.s-header-nav {
    display: flex; align-items: center; gap: 6px;
}

.s-header-nav a, .s-header-nav button {
    color: var(--ink-dim); text-decoration: none;
    font-size: .85rem; font-weight: 500;
    padding: 6px 14px; border-radius: var(--r-sm);
    border: 1px solid transparent; background: none;
    transition: all .2s ease;
}

.s-header-nav a:hover, .s-header-nav button:hover {
    color: var(--ink); border-color: var(--line); background: var(--cream);
}

.s-header-nav .active {
    color: var(--green); background: var(--green-pale);
}

.s-header-nav .s-btn-primary {
    background: var(--green); color: #fff; border: none;
    padding: 7px 18px;
}

.s-header-nav .s-btn-primary:hover {
    background: var(--green-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

.s-kicker {
    font-family: var(--font-serif); font-style: italic;
    color: var(--warm); font-size: .92rem; margin-bottom: 8px;
}

.s-h1 {
    font-family: var(--font-serif); font-weight: 700;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    line-height: 1.12; color: var(--ink); margin-bottom: 12px;
}

.s-h2 {
    font-family: var(--font-serif); font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    line-height: 1.2; color: var(--ink); margin-bottom: 10px;
}

.s-h3 {
    font-family: var(--font-serif); font-weight: 500;
    font-size: 1.15rem; color: var(--ink); margin-bottom: 8px;
}

.s-text { color: var(--ink-dim); font-size: .92rem; line-height: 1.7; }
.s-text-sm { font-size: .82rem; color: var(--ink-dim); }
.s-text-xs { font-size: .75rem; color: var(--ink-faint); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.s-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 20px; font-size: .88rem; font-weight: 500;
    border-radius: var(--r-sm); border: 1px solid transparent;
    cursor: pointer; transition: all .2s ease; text-decoration: none;
    white-space: nowrap;
}

.s-btn-primary {
    background: var(--green); color: #fff; border-color: var(--green);
}

.s-btn-primary:hover {
    background: var(--green-light); transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45,106,79,.15);
}

.s-btn-ghost {
    background: transparent; color: var(--ink); border-color: var(--line);
}

.s-btn-ghost:hover {
    border-color: var(--ink); background: var(--cream-soft);
}

.s-btn-warm {
    background: var(--warm); color: #fff; border-color: var(--warm);
}

.s-btn-warm:hover {
    background: #d4985d; transform: translateY(-1px);
}

.s-btn-sm { padding: 6px 14px; font-size: .82rem; }
.s-btn-lg { padding: 12px 28px; font-size: .95rem; }

.s-btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--r-sm); font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.s-card {
    background: var(--cream-soft); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 20px;
    transition: all .25s ease; position: relative; overflow: hidden;
}

.s-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--warm); transform: scaleX(0); transition: transform .3s ease;
    transform-origin: left;
}

.s-card:hover {
    transform: translateY(-2px); border-color: var(--warm);
    box-shadow: var(--shadow-md);
}

.s-card:hover::before { transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════════════════ */

.s-divider {
    border: none; border-top: 1px solid var(--line); margin: 0;
}

.s-section-title {
    font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500;
    color: var(--ink); display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}

.s-section-title::after {
    content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */

.s-input {
    width: 100%; padding: 10px 14px; font-size: .88rem;
    background: var(--white); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-sm);
    outline: none; transition: border-color .2s;
}

.s-input:focus { border-color: var(--green); }
.s-input::placeholder { color: var(--ink-faint); }

.s-textarea {
    resize: vertical; min-height: 80px; line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAG / BADGE
   ═══════════════════════════════════════════════════════════════════════════ */

.s-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; font-size: .72rem; font-weight: 500;
    border-radius: var(--r-full); letter-spacing: .3px;
    text-transform: uppercase;
}

.s-tag-warm { background: var(--warm-pale); color: var(--warm); }
.s-tag-green { background: var(--green-pale); color: var(--green); }

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT INTERFACE (shared by SmartWay, PhotoChat, Sanctuary)
   ═══════════════════════════════════════════════════════════════════════════ */

.s-chat-layout {
    display: flex; height: calc(100vh - var(--header-h));
}

/* Sidebar */
.s-sidebar {
    width: var(--sidebar-w); background: var(--cream-soft);
    border-right: 1px solid var(--line); display: flex;
    flex-direction: column; flex-shrink: 0;
}

.s-sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}

.s-sidebar-header h3 {
    font-family: var(--font-serif); font-size: .95rem; font-weight: 500;
    color: var(--ink);
}

.s-sidebar-list {
    flex: 1; overflow-y: auto; padding: 8px;
}

.s-sidebar-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
    transition: all .15s ease; border: 1px solid transparent;
    margin-bottom: 2px;
}

.s-sidebar-item:hover { background: var(--cream); border-color: var(--line); }
.s-sidebar-item.active { background: var(--green-pale); border-color: var(--green); }

.s-sidebar-item-title {
    font-size: .82rem; color: var(--ink); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; flex: 1;
}

.s-sidebar-item-delete {
    opacity: 0; background: none; border: none; color: var(--ink-faint);
    font-size: .75rem; padding: 2px 6px; border-radius: var(--r-xs);
    transition: all .15s;
}

.s-sidebar-item:hover .s-sidebar-item-delete { opacity: 1; }
.s-sidebar-item-delete:hover { color: #c0392b; background: rgba(192,57,43,.08); }

/* Chat main area */
.s-chat-main {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}

.s-chat-messages {
    flex: 1; overflow-y: auto; padding: 24px;
}

.s-msg {
    max-width: 720px; margin: 0 auto 20px; display: flex; gap: 12px;
}

.s-msg-avatar {
    width: 32px; height: 32px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; flex-shrink: 0; margin-top: 2px;
}

.s-msg-user .s-msg-avatar { background: var(--ink); color: var(--cream); }
.s-msg-assistant .s-msg-avatar { background: var(--green-pale); color: var(--green); }

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

.s-msg-name {
    font-size: .78rem; font-weight: 600; color: var(--ink-dim);
    margin-bottom: 4px;
}

.s-msg-content {
    font-size: .92rem; line-height: 1.7; color: var(--ink);
}

.s-msg-content p { margin-bottom: 12px; }
.s-msg-content p:last-child { margin-bottom: 0; }

.s-msg-content pre {
    background: var(--ink); color: #e8ecec;
    padding: 16px; border-radius: var(--r-sm);
    overflow-x: auto; font-size: .82rem; margin: 12px 0;
    font-family: var(--font-mono); line-height: 1.6;
}

.s-msg-content code {
    font-family: var(--font-mono); font-size: .88em;
    background: var(--cream-dark); padding: 2px 5px;
    border-radius: var(--r-xs);
}

.s-msg-content pre code { background: transparent; padding: 0; }

.s-msg-content blockquote {
    border-left: 3px solid var(--warm); padding: 4px 0 4px 16px;
    margin: 12px 0; font-style: italic; color: var(--ink-dim);
}

.s-msg-content ul, .s-msg-content ol {
    margin: 8px 0 8px 20px;
}

.s-msg-content li { margin-bottom: 4px; }

.s-msg-content a {
    color: var(--green); text-decoration: underline;
    text-underline-offset: 2px;
}

.s-msg-content img {
    max-width: 100%; border-radius: var(--r-sm);
    margin: 8px 0; border: 1px solid var(--line);
}

.s-msg-time {
    font-size: .7rem; color: var(--ink-faint); margin-top: 4px;
}

/* Chat input */
.s-chat-input-area {
    padding: 16px 24px; border-top: 1px solid var(--line);
    background: var(--cream-soft);
}

.s-chat-input-wrap {
    max-width: 720px; margin: 0 auto;
    display: flex; gap: 10px; align-items: flex-end;
}

.s-chat-input {
    flex: 1; padding: 12px 16px; font-size: .92rem;
    background: var(--white); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-md);
    outline: none; resize: none; min-height: 44px; max-height: 200px;
    line-height: 1.5; transition: border-color .2s;
    font-family: var(--font-sans);
}

.s-chat-input:focus { border-color: var(--green); }
.s-chat-input::placeholder { color: var(--ink-faint); }

.s-chat-send {
    width: 44px; height: 44px; padding: 0;
    background: var(--green); color: #fff;
    border: none; border-radius: var(--r-md);
    font-size: 1.1rem; display: flex;
    align-items: center; justify-content: center;
    transition: all .2s ease; flex-shrink: 0;
}

.s-chat-send:hover { background: var(--green-light); }
.s-chat-send:disabled { opacity: .4; cursor: not-allowed; }

/* Welcome state */
.s-welcome {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 40px 24px;
}

.s-welcome-icon { font-size: 3rem; margin-bottom: 16px; opacity: .6; }

.s-welcome h2 {
    font-family: var(--font-serif); font-size: 1.6rem;
    font-weight: 600; color: var(--ink); margin-bottom: 8px;
}

.s-welcome p { color: var(--ink-dim); max-width: 400px; margin-bottom: 24px; }

.s-welcome-suggestions {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}

.s-suggestion {
    padding: 8px 16px; background: var(--cream-soft);
    border: 1px solid var(--line); border-radius: var(--r-full);
    font-size: .82rem; color: var(--ink-dim); cursor: pointer;
    transition: all .2s ease;
}

.s-suggestion:hover {
    border-color: var(--green); color: var(--green);
    background: var(--green-pale);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.s-footer {
    background: var(--cream-soft); border-top: 1px solid var(--line);
    padding: 24px 0;
}

.s-footer-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
}

.s-footer p { font-family: var(--font-serif); color: var(--ink); font-size: .85rem; }
.s-footer .s-footer-sub { color: var(--ink-dim); font-style: italic; font-size: .82rem; }

.s-footer-links { display: flex; gap: 6px; flex-wrap: wrap; }

.s-footer-links a {
    color: var(--ink-dim); text-decoration: none; font-size: .78rem;
    padding: 4px 10px; border: 1px solid var(--line);
    border-radius: var(--r-sm); transition: all .2s ease;
}

.s-footer-links a:hover { color: var(--ink); border-color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .s-header-nav { display: none; }
    .s-sidebar { display: none; }
    .s-chat-messages { padding: 16px; }
    .s-chat-input-area { padding: 12px 16px; }
    .s-msg { flex-direction: column; gap: 6px; }
    .s-welcome-suggestions { flex-direction: column; align-items: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.s-hidden { display: none !important; }
.s-flex { display: flex; }
.s-flex-col { flex-direction: column; }
.s-items-center { align-items: center; }
.s-justify-between { justify-content: space-between; }
.s-gap-sm { gap: 8px; }
.s-gap-md { gap: 16px; }
.s-mt-sm { margin-top: 8px; }
.s-mt-md { margin-top: 16px; }
.s-mb-sm { margin-bottom: 8px; }
.s-mb-md { margin-bottom: 16px; }
.s-p-sm { padding: 8px; }
.s-p-md { padding: 16px; }
.s-w-full { width: 100%; }
.s-text-center { text-align: center; }
.s-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
