:root {
    --brand: #0a6cff;
    --bg: #f4f6f9;
    --card: #ffffff;
    --ink: #11181c;
    --muted: #5b6770;
    --line: #e4e8ec;
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1216;
        --card: #171c22;
        --ink: #eef1f4;
        --muted: #9aa5ad;
        --line: #2a323b;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.portal-shell {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-top: 4px;
}

.brand-logo { max-height: 48px; max-width: 70%; object-fit: contain; }

.brand-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--brand);
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.card h1 { margin: 0 0 12px; font-size: 1.35rem; }
.card h2 { margin: 0 0 8px; font-size: 1.1rem; }

h1, h2 { position: relative; }
.card h1::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 8px;
    background: var(--brand);
    border-radius: 2px;
}

.muted { color: var(--muted); margin: 0; }

.details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
    margin: 0;
}

.details dt { color: var(--muted); font-size: .9rem; }
.details dd { margin: 0; font-weight: 600; }

.support {
    text-align: center;
    font-size: .9rem;
    padding-top: 4px;
}

/* Conversation */
.chat { margin-top: 14px; }

.chat-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bubble.bot {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

.bubble.me {
    align-self: flex-end;
    background: var(--brand);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble.typing { opacity: .6; letter-spacing: 2px; }

.composer { display: flex; gap: 8px; align-items: flex-end; }

.composer textarea {
    flex: 1;
    resize: none;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
}

.composer textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.send {
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.send:disabled { opacity: .5; cursor: default; }

.closing { padding-top: 6px; }

/* Workshop address + directions on the booking card */
.directions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.directions-addr { margin: 0 0 8px; }
.directions-link { display: inline-block; color: var(--brand); text-decoration: none; font-weight: 600; }
.directions-link:hover { text-decoration: underline; }

/* Platform attribution footer */
.powered {
    text-align: center;
    font-size: .74rem;
    color: var(--muted);
    letter-spacing: .04em;
    padding: 16px 0 2px;
}
.powered span { font-weight: 600; color: var(--ink); }

/* Gateway admin + login */
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.field {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--card); color: var(--ink); font: inherit;
}
.field:focus { outline: none; border-color: var(--brand); }
.form-error { color: #c62828; margin: 0 0 10px; }
.admin-nav { list-style: none; padding: 0; margin: 0 0 14px; }
.admin-nav a { color: var(--brand); text-decoration: none; font-weight: 600; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.linkbtn.danger { color: #c62828; }
.row-actions { display: flex; gap: 14px; align-items: center; }
.row-actions a { color: var(--brand); text-decoration: none; font-weight: 600; }
.row-actions form { display: inline; }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }
.form-actions { display: flex; gap: 16px; align-items: center; margin-top: 4px; }
.form-actions a { color: var(--muted); text-decoration: none; }
.form-ok { color: #2e7d32; margin: 0 0 10px; }
.btn-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.sep { display: inline-block; width: 16px; }
