:root {
    --navy: #0b1f33;
    --navy-2: #13283d;
    --gold: #c4a35a;
    --paper: #f3efe6;
    --card: #ffffff;
    --text: #14202c;
    --muted: #5d6b78;
    --line: #e3ddd2;
    --danger: #9b3b2e;
    --ok: #2c6a4f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
    margin: 0;
    min-height: 100%;
    background: var(--navy);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.hidden { display: none !important; }

.boot {
    max-width: 400px;
    margin: 0 auto;
    padding: 72px 24px;
    color: var(--paper);
    text-align: center;
}
.boot h1 { margin: 8px 0 16px; font-size: 22px; font-weight: 600; line-height: 1.35; }
.boot-name, #brand-kicker {
    letter-spacing: -0.03em;
    font-size: 22px;
    font-weight: 700;
    color: var(--paper);
    text-transform: none;
}
.boot p { color: #c9d4df; }
.kicker {
    margin: 0;
    letter-spacing: 0.16em;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
}

html:has(#login-view:not(.hidden)),
body:has(#login-view:not(.hidden)) { background: #070b14; }
.landing {
    --ai-ink: #eef2f8;
    --ai-soft: #a7b3c5;
    --ai-line: rgba(255, 255, 255, 0.12);
    --ai-card: rgba(255, 255, 255, 0.06);
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 0% -8%, rgba(124, 108, 255, 0.38), transparent 60%),
        radial-gradient(680px 460px at 100% 0%, rgba(62, 198, 192, 0.22), transparent 58%),
        #070b14;
    color: var(--ai-ink);
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    padding-bottom: 80px;
}
.landing .kicker {
    display: inline-flex;
    margin: 0 0 16px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(139, 124, 255, 0.45);
    background: rgba(124, 108, 255, 0.14);
    color: #ddd7ff;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 600;
}
.land-orb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b7cff, #5ee0d0);
    box-shadow: 0 0 12px rgba(124, 108, 255, 0.8);
}
.brand-logo {
    display: block;
    width: auto;
    height: 46px;
    mix-blend-mode: screen;
}
.boot .brand-logo { height: 72px; margin: 0 auto 8px; }
.land-mark {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.land-mark .brand-logo { height: 42px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand .brand-logo { height: 52px; }
.land-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 14px 28px;
    background: rgba(7, 11, 20, 0.72);
    border-bottom: 1px solid var(--ai-line);
    backdrop-filter: blur(16px);
}
.land-nav nav { display: flex; flex-wrap: wrap; gap: 8px; }
.land-nav a {
    color: var(--ai-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 999px;
}
.land-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.land-nav a[href="#entrar"] {
    color: #071018;
    background: linear-gradient(120deg, #8b7cff, #5ee0d0);
}
.land-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 28px;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 40px 28px;
}
.land-copy h1,
.land-story h2,
.land-questions h2 {
    font-weight: 700;
    letter-spacing: -0.045em;
}
.land-copy h1 {
    margin: 0 0 12px;
    max-width: 14em;
    font-size: clamp(36px, 4.6vw, 58px);
    line-height: 1.05;
}
.land-subhead {
    margin: 0 0 16px;
    max-width: 16em;
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.25;
    background: linear-gradient(120deg, #c4b8ff, #7ef0e4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.land-duo {
    margin: 20px 0 0;
    color: #d5deea;
    font-size: 17px;
    line-height: 1.65;
}
.land-duo strong { color: #fff; }
.land-copy .land-cta { margin-top: 22px; }
.land-copy h1 em {
    font-style: normal;
    background: linear-gradient(120deg, #c4b8ff, #7ef0e4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.land-lead {
    margin: 0 0 22px;
    max-width: 36em;
    color: var(--ai-soft);
    font-size: 18px;
    line-height: 1.7;
}
.land-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.land-points li {
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--ai-line);
    background: rgba(255, 255, 255, 0.04);
    color: #d5deea;
    font-size: 13px;
}
.landing .login-card {
    background: var(--ai-card);
    color: var(--ai-ink);
    border: 1px solid var(--ai-line);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}
.landing .login-card label {
    margin: 14px 0 6px;
    color: var(--ai-soft);
    font-size: 13px;
}
.landing .login-card input {
    border: 1px solid var(--ai-line);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(7, 11, 20, 0.45);
    color: #fff;
    font-family: inherit;
}
.landing .login-card input:focus {
    outline: none;
    border-color: #8b7cff;
}
.landing .login-card button {
    width: 100%;
    margin-top: 18px;
    border-radius: 12px;
    background: linear-gradient(120deg, #8b7cff, #5ee0d0);
    color: #071018;
    font-family: inherit;
    font-weight: 700;
}
.landing .login-card button:disabled {
    cursor: wait;
    opacity: 0.8;
}
.landing .land-wait {
    margin: 12px 0 0;
    color: #c5d0de;
    font-size: 13px;
}
.landing .login-card button.link {
    width: auto;
    margin-top: 12px;
    padding: 0;
    background: none;
    color: #d5deea;
    font-weight: 500;
}
.land-invite { margin: 14px 0 0; color: var(--ai-soft); font-size: 13px; }
.land-form-kicker {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.land-choices {
    margin-top: 14px;
    padding: 16px 16px 8px;
    border-radius: 22px;
    border: 1px solid var(--ai-line);
    background: rgba(255, 255, 255, 0.04);
}
.land-choices > p {
    margin: 0 0 10px;
    color: var(--ai-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.land-choices ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.land-choices li {
    margin: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(7, 11, 20, 0.35);
}
.land-choices strong, .land-choices span { display: block; }
.land-choices strong { font-size: 14px; letter-spacing: -0.02em; }
.land-choices span { margin-top: 4px; color: var(--ai-soft); font-size: 12px; line-height: 1.4; }
.sys-preview {
    margin-top: 14px;
    padding: 12px;
    border-radius: 18px;
    background: #f3efe6;
    color: #14202c;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.sys-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.sys-bar strong {
    margin-right: 4px;
    font-size: 13px;
}
.sys-bar span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #0b1f33;
    color: #f3efe6;
    font-size: 11px;
    font-weight: 600;
}
.sys-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.sys-board article {
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
}
.sys-board h3 {
    margin: 0 0 8px;
    font-size: 13px;
}
.sys-item {
    padding: 8px 0;
    border-top: 1px solid #e3ddd2;
}
.sys-item strong, .sys-item span, .sys-item em { display: block; }
.sys-item strong { font-size: 13px; }
.sys-item span { color: #5d6b78; font-size: 12px; }
.sys-item em {
    margin-top: 4px;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #0b1f33;
}
.sys-item em.quiet { color: #5d6b78; font-weight: 600; }
.sys-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.sys-counts div {
    padding: 8px;
    border-radius: 10px;
    background: #f3efe6;
}
.sys-counts b { display: block; font-size: 18px; color: #0b1f33; }
.sys-counts span { font-size: 11px; color: #5d6b78; }
.sys-wide { grid-column: 1 / -1; }
.sys-wide p { margin: 0; color: #5d6b78; font-size: 13px; line-height: 1.45; }
.land-chat {
    margin-top: 14px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--ai-line);
    background: rgba(255, 255, 255, 0.04);
}
.land-chat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--ai-soft);
    font-size: 12px;
    font-weight: 600;
}
.land-bubble {
    margin: 0 0 8px;
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
}
.land-bubble.user {
    margin-left: auto;
    background: rgba(139, 124, 255, 0.22);
    border-bottom-right-radius: 4px;
}
.land-bubble.ai {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ai-line);
    border-bottom-left-radius: 4px;
}
.land-chat-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.land-chat-pills span {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(94, 224, 208, 0.12);
    color: #bff7f1;
    font-size: 12px;
}
.land-questions h2,
.land-story h2 {
    margin: 0 0 22px;
    max-width: 16em;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.28;
}
.land-q {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.land-q li {
    margin: 0;
    padding: 16px 14px;
    border-radius: 18px;
    border: 1px solid var(--ai-line);
    background: var(--ai-card);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.land-q strong {
    display: block;
    margin-bottom: 8px;
    color: #9d93ff;
    font-size: 12px;
    letter-spacing: 0.08em;
}
.land-story { background: transparent; }
.land-story-alt {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}
.land-inner { max-width: 1120px; margin: 0 auto; padding: 72px 40px 88px; }
.land-steps, .land-grid { display: grid; gap: 22px; }
.land-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.land-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.land-steps article, .land-grid article {
    background: var(--ai-card);
    border: 1px solid var(--ai-line);
    border-radius: 20px;
    padding: 26px 24px;
}
.land-steps span {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 124, 255, 0.35), rgba(94, 224, 208, 0.25));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.land-steps h3, .land-grid h3 { margin: 0 0 12px; font-size: 18px; }
.land-steps p, .land-grid p, .land-close p {
    margin: 0;
    color: var(--ai-soft);
    font-size: 15px;
    line-height: 1.7;
}
.land-close {
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 40px 48px;
    text-align: center;
    border-radius: 24px;
    border: 1px solid var(--ai-line);
    background:
        radial-gradient(420px 180px at 50% 0%, rgba(139, 124, 255, 0.22), transparent 70%),
        #10182a;
}
.land-close h2 {
    margin: 0 auto 8px;
    line-height: 1.35;
    font-size: clamp(32px, 4vw, 44px);
}
.land-cta {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(120deg, #8b7cff, #5ee0d0);
    color: #071018;
    font-weight: 700;
    text-decoration: none;
}
.land-legal { margin-top: 18px; color: var(--ai-soft); }
.land-legal a { color: #d5deea; }
.landing section { scroll-margin-top: 76px; }
.land-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 36px;
    align-items: start;
}
.land-hero + .land-story .land-inner { padding-top: 56px; }
.land-noise {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 28px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}
.land-noise li {
    margin: 0;
    padding: 10px 0;
    border-top: 1px solid var(--ai-line);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.land-quotes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.land-quotes p {
    margin: 0;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--ai-line);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.land-tags {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.land-tags article {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--ai-line);
    background: var(--ai-card);
}
.land-tags span {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(139, 124, 255, 0.2);
    color: #ddd7ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.land-tags p { margin: 0; color: var(--ai-soft); font-size: 14px; line-height: 1.5; }
.land-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.land-flow li {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--ai-line);
    background: var(--ai-card);
    font-weight: 650;
}
.land-flow span {
    display: block;
    margin-bottom: 8px;
    color: #9d93ff;
    font-size: 12px;
    letter-spacing: 0.08em;
}
.land-morning {
    padding: 18px 18px 8px;
    border-radius: 22px;
    border: 1px solid var(--ai-line);
    background: rgba(255, 255, 255, 0.04);
}
.land-morning ul { margin: 0; padding: 0; list-style: none; }
.land-morning li {
    margin: 0;
    padding: 11px 0;
    border-top: 1px solid var(--ai-line);
    font-size: 15px;
}
.land-sign {
    margin: 22px 0 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.45;
}
@media (max-width: 980px) {
    .land-hero, .land-split { grid-template-columns: 1fr; }
    .land-steps, .land-q, .land-tags, .land-flow { grid-template-columns: 1fr 1fr; }
    .land-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
    .land-nav { padding: 12px 16px; }
    .land-hero { padding: 28px 16px 40px; }
    .land-inner { padding: 48px 20px 64px; }
    .land-copy h1, .land-subhead { font-size: 32px; }
    .land-steps, .land-grid, .land-q, .land-quotes, .land-tags, .land-flow, .sys-board, .land-noise { grid-template-columns: 1fr; }
    .land-close { margin: 0 16px 32px; }
}
.legal {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: #c9d4df;
}
.legal a { color: var(--gold); }
.login-card {
    background: var(--card);
    color: var(--text);
    border-radius: 16px;
    padding: 22px;
}
.login-card label, .mini-form label, .chat-form label {
    display: block;
    margin: 10px 0 6px;
    font-size: 13px;
    color: var(--muted);
}
.login-card input, .mini-form input, .chat-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 15px;
}
button {
    border: 0;
    border-radius: 10px;
    padding: 11px 14px;
    background: var(--navy);
    color: #fff;
    font-weight: 650;
    cursor: pointer;
}
.login-card button { width: 100%; margin-top: 16px; }
.login-card button.link, .switch button.link {
    width: auto;
    margin: 12px 0 0;
    padding: 0;
    background: none;
    color: var(--navy);
    text-decoration: underline;
    font-weight: 600;
}
.switch { margin: 0; }
.chat-card h4 { margin: 16px 0 8px; font-size: 14px; }
a { color: var(--navy); }
button.ghost-dark {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--line);
    width: auto;
}
button.ghost {
    background: transparent;
    color: var(--paper);
    border: 1px solid rgba(255,255,255,.25);
}
.status { color: var(--danger); font-size: 14px; }

#cockpit-view {
    padding: 16px 18px 20px;
    max-width: 1480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.cockpit-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 16px;
    align-items: stretch;
}
.cockpit-board {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    padding-bottom: 8px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    color: var(--paper);
}
.topbar h1 { margin: 2px 0 0; font-size: 15px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.35; max-width: 22em; color: #c9d4df; }
.topbar-actions { display: flex; gap: 8px; }
.hello { color: var(--paper); margin: 22px 0 16px; }
.hello h2 { margin: 0 0 6px; font-size: 22px; }
.hello p { margin: 0; color: #c9d4df; }
.hint-line { margin-top: 8px !important; font-size: 13px; }
.confirm-box {
    background: var(--paper);
    border-radius: 16px;
    padding: 12px 14px 14px;
}
.confirm-box .hint { margin: 0 0 10px; }
.confirm-row { display: flex; gap: 8px; margin-top: 8px; }
.confirm-row button { width: auto; padding: 8px 12px; }
.confirm-row button.no { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.action-chips button {
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--navy);
    color: #fff;
}

.pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}
.pills button {
    flex: 0 0 auto;
    background: #1a334b;
    color: var(--paper);
    border: 1px solid rgba(196,163,90,.35);
    font-size: 13px;
}
.pills button.active { background: var(--gold); color: var(--navy); }

.email-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 10px;
}
.email-tabs button {
    width: auto;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: #1a334b;
    color: var(--paper);
    border: 1px solid rgba(196, 163, 90, .35);
}
.email-tabs button.active { background: var(--gold); color: var(--navy); }
.email-more {
    width: auto;
    margin: 8px 0 12px;
    padding: 7px 12px;
    font-size: 13px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.card, .chat-card {
    background: var(--card);
    border-radius: 16px;
    padding: 18px;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.card .card-head h3 { margin: 0; }
.card-how { flex: 0 0 auto; white-space: nowrap; }
.card h3, .chat-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}
.policy-box {
    display: grid;
    gap: 10px;
}
.policy-box p { margin: 0; }
.policy-box h4 {
    margin: 8px 0 4px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}
.policy-kw {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.policy-link {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--navy);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.policy-link:hover { color: #8a7040; }
#email-policy-line {
    margin: 10px 0 0;
    color: var(--navy);
    font-weight: 600;
}
.list { display: grid; gap: 8px; }
.item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}
.item.item-tap, #card-focus.card-tap {
    cursor: grab;
    touch-action: none;
}
body.dragging-card { user-select: none; }
body.dragging-card .modal-backdrop { pointer-events: none; }
body.dragging-card .chat-dock {
    z-index: 240;
    outline: 2px dashed #c4a35a;
    outline-offset: 2px;
}
body.dragging-card .chat-dock.drop-hot {
    outline-color: #2c6a4f;
    background: #f8f3e8;
}
.drag-ghost {
    position: fixed;
    z-index: 220;
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #c4a35a;
    background: #fff;
    color: #14202c;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    transform: translate(-50%, -50%);
}
.tour-target {
    outline: 2px solid #c4a35a;
    outline-offset: 3px;
}
.drag-tour {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 16px;
    z-index: 200;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px 16px 14px;
    border-radius: 16px;
    background: #0b1f33;
    color: #f3efe6;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}
.drag-tour p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.drag-tour button {
    width: auto;
    background: #c4a35a;
    color: #0b1f33;
    pointer-events: auto;
}
.item strong { display: block; font-size: 14px; }
.item span, .hint, #focus-line.empty {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.badge {
    display: inline-block;
    margin-top: 6px;
    margin-right: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--navy);
    background: #f0e6cf;
    border-radius: 999px;
    padding: 2px 8px;
}
.badge.sender {
    background: #e4eef6;
    color: #1a3a52;
    letter-spacing: 0;
    text-transform: none;
}
.badge.past {
    background: #ece7df;
    color: #6b6256;
}
.badge.now {
    background: #f3e0c2;
    color: #6a4a12;
}
.item-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.item-act {
    width: auto;
    padding: 4px 10px;
    font-size: 12px;
}
.empty { color: var(--muted); font-size: 14px; }

.counters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.counter {
    background: var(--paper);
    border-radius: 12px;
    padding: 10px;
}
.counter b { display: block; font-size: 22px; color: var(--navy); }
.counter span { font-size: 12px; color: var(--muted); }
.card-tap { cursor: pointer; }
.card-tap:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.item-tap { cursor: pointer; }
.item-tap:hover { border-color: var(--gold); background: #fbf8f1; }
.counter-tap {
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(196, 163, 90, 0.45);
}
.counter-tap:hover { background: #ebe4d4; }
.counter-tap:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 90;
    max-width: min(420px, calc(100% - 32px));
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--navy);
    color: var(--paper);
    border: 1px solid var(--gold);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 31, 51, 0.62);
}
.modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid rgba(196, 163, 90, 0.35);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    padding: 20px 22px 18px;
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.modal-head h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}
.modal-body {
    overflow: auto;
    min-height: 0;
    flex: 1;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}
.modal-body > p { margin: 0; }
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
}
.modal-actions button { width: auto; }
.modal-actions .no {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--line);
}

.mini-form { margin-top: 14px; }
.mini-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}
.mini-row input[type="date"] { width: auto; }
.mini-row button { width: auto; }
.check { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin: 0; }
.check input { width: auto; }

.settings-card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px 22px 22px;
    margin: 0 0 18px;
    border: 1px solid rgba(196, 163, 90, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.settings-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.settings-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}
.settings-card h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--navy);
}
.settings-card label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
.settings-card input[type="text"],
.settings-card input[type="password"],
.settings-card input[type="email"],
.settings-card input[type="tel"],
.settings-card input[type="date"] {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text);
    background: var(--paper);
}
.settings-card input::placeholder {
    color: #8a96a1;
}
.settings-card input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.28);
    background: #fff;
}
.status-pill {
    display: inline-block;
    margin: 0 0 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 650;
    background: var(--paper);
    color: var(--navy);
}
.status-pill.ok {
    background: #e4f2ea;
    color: var(--ok);
}
.status-pill.warn {
    background: #f7ebe8;
    color: var(--danger);
}

.settings-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.settings-actions button { width: auto; }
.wa-panel {
    margin-top: 14px;
    padding: 14px 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfaf7;
}
.wa-panel h5 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--navy);
}
.wa-order {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}
.wa-order strong { margin-right: auto; }
.wa-order span { color: var(--muted); font-size: 13px; }
.wa-order button { width: auto; }
.token-once {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0e6cf;
    color: var(--navy);
    word-break: break-all;
}
.token-once:empty { display: none; }
.token-list { margin-top: 12px; }
.token-list .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.token-list .item strong { display: inline; margin-right: auto; }
.token-list .item button { width: auto; }
button.ghost.on {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

.chat-dock {
    background: var(--card);
    border-radius: 16px;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 118px);
    position: sticky;
    top: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.chat-head .hint { margin: 4px 0 0; }
.chat-head-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-head-actions button { width: auto; padding: 7px 10px; font-size: 12px; }
.chat-history {
    max-height: 180px;
    overflow: auto;
    margin-bottom: 10px;
    padding-bottom: 4px;
}
.chat-history .item { cursor: pointer; }
.chat-history .item.on { border-color: var(--gold); background: #f8f3e8; }
.chat-head h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
}
.chat-toggle, .chat-open-btn { display: none; }
.chat-log {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 12px;
    margin-bottom: 12px;
}
.bubble {
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.5;
}
.bubble.user {
    background: var(--navy);
    color: #fff;
    justify-self: end;
    max-width: 78%;
}
.bubble.assistant {
    background: var(--paper);
    max-width: 100%;
    padding: 16px 18px;
}
.bubble-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 70%;
    padding: 12px 16px;
}
.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--navy);
    opacity: 0.3;
    animation: typing-dot 1.1s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0.32s; }
.typing-label {
    margin-left: 4px;
    font-size: 12px;
    color: var(--muted);
}
@keyframes typing-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}
.bubble-md p { margin: 0 0 10px; }
.bubble-md p:last-child { margin-bottom: 0; }
.bubble-md p.lead {
    font-weight: 700;
    color: var(--navy);
    font-size: 16px;
    margin: 14px 0 8px;
}
.bubble-md p.lead:first-child { margin-top: 0; }
.bubble-md ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 8px;
}
.bubble-md li {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    color: var(--text);
}
.bubble-md li.item-tap {
    cursor: grab;
    touch-action: none;
}
body.dragging-card .bubble-md li.item-tap { cursor: grabbing; }
.bubble-md .when {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: #f0e6cf;
    color: var(--navy);
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: 6px;
}
.bubble-md em.soft {
    font-style: normal;
    color: var(--muted);
    font-size: 12px;
}
.whatsapp-qr {
    display: block;
    width: 220px;
    max-width: 100%;
    margin-top: 12px;
    background: #fff;
    border-radius: 12px;
}
.whatsapp-qr.hidden { display: none; }
.bubble .more-pill {
    width: auto;
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 13px;
}
.bubble-md .more-rest { margin-top: 8px; }
.bubble-md strong { color: var(--navy); }
.bubble-md a,
.settings-card a {
    color: var(--navy);
    text-decoration: underline;
    font-weight: 600;
}
.bubble-md code {
    font-family: inherit;
    background: #fff;
    border-radius: 6px;
    padding: 1px 5px;
}
.chat-form { display: flex; gap: 8px; flex-shrink: 0; }
.chat-form input { flex: 1; }
.chat-form button { width: auto; }

@media (max-width: 1080px) {
    .cockpit-shell { grid-template-columns: 1fr; }
    .cockpit-board { overflow: visible; padding-bottom: 88px; }
    .chat-dock {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        top: auto;
        height: auto;
        max-height: none;
        z-index: 40;
        padding: 10px 12px 12px;
        border: 1px solid rgba(196, 163, 90, 0.35);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .chat-dock .chat-log,
    .chat-dock .confirm-box,
    .chat-dock .action-chips { display: none; }
    .chat-toggle, .chat-open-btn { display: inline-flex; }
    body.chat-open .chat-dock {
        max-height: min(82vh, 720px);
        height: min(82vh, 720px);
    }
    body.chat-open .chat-dock .chat-log,
    body.chat-open .chat-dock .confirm-box { display: grid; }
    body.chat-open .chat-dock .action-chips { display: flex; }
    body.chat-open .chat-toggle { display: inline-flex; }
}

@media (max-width: 800px) {
    .grid { grid-template-columns: 1fr; }
    .topbar { flex-wrap: wrap; }
    .topbar h1 { font-size: 15px; }
    .topbar-actions { flex-wrap: wrap; }
    #cockpit-view { padding: 12px 12px 16px; }
    .settings-head { flex-direction: column; align-items: stretch; }
    .settings-card { padding: 16px; }
    .hello { margin: 14px 0 12px; }
}
