:root {
    --font-body: "Instrument Sans", system-ui, sans-serif;
    --font-display: "Instrument Serif", Georgia, serif;
    --font-mono: "JetBrains Mono", Consolas, monospace;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

:root,
[data-theme="light"] {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f2f2f5;
    --line: #e8e8ee;
    --line-strong: #d8d8e2;
    --ink: #191b2c;
    --ink-soft: #5c5e72;
    --ink-faint: #9495a8;
    --primary: #784ef8;
    --primary-text: #6133ee;
    --primary-tint: #f1edfe;
    --green: #00c773;
    --green-text: #047a4b;
    --green-tint: #e3f9ef;
    --warn-text: #a05a10;
    --warn-tint: #fdf2e2;
    --danger: #cf4128;
    --danger-tint: #fcedea;
    --scroll-thumb: #d2d3de;
    --overlay: rgba(20, 21, 38, 0.4);
    --inverse: #191b2c;
    --inverse-ink: #fafafa;
}


* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s ease, color 0.25s ease;
}

.hidden {
    display: none !important;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

.app-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-logo {
    height: 28px;
    display: block;
}


.brand-ai-chip {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary-text);
    border: 1px solid var(--line-strong);
    padding: 3px 8px;
    border-radius: 6px;
}

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

.icon-action,
.icon-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-action:hover,
.icon-button:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.icon-action svg,
.icon-button svg {
    width: 18px;
    height: 18px;
}



.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-soft);
    font: 500 13px var(--font-body);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ghost-button:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--line-strong);
}

.ghost-button svg {
    width: 14px;
    height: 14px;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--green);
    color: #06281a;
    font-size: 10.5px;
    font-weight: 700;
    animation: badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

.chat-scroll::-webkit-scrollbar {
    width: 10px;
}

.chat-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.chat-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--ink-faint);
    background-clip: content-box;
}

.chat-column {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 24px 36px;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.welcome {
    text-align: center;
    padding: 11vh 8px 20px;
    animation: rise-in 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome-eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-text);
}

.welcome h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(34px, 6vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
}

.welcome h1 em {
    font-style: italic;
    color: var(--primary-text);
}

.welcome-sub {
    max-width: 460px;
    margin: 0 auto 30px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.65;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
}

.suggestion {
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font: 500 13.5px var(--font-body);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.suggestion:hover {
    border-color: var(--primary);
    color: var(--primary-text);
    background: var(--primary-tint);
}

.message-row {
    display: flex;
    gap: 12px;
    animation: rise-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row.user {
    justify-content: flex-end;
}

.avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    margin-top: 3px;
    overflow: hidden;
}

.avatar img {
    width: 17px;
    height: 17px;
    display: block;
}

.bubble {
    max-width: min(82%, 560px);
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 14.5px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.message-row.user .bubble {
    background: var(--primary-tint);
    color: var(--ink);
    border-bottom-right-radius: 6px;
}

.assistant-turn {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    flex: 1;
    padding-top: 3px;
}

.assistant-content {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
    max-width: 680px;
}

.assistant-content > :first-child {
    margin-top: 0;
}

.assistant-content > :last-child {
    margin-bottom: 0;
}

.assistant-content p {
    margin: 0 0 0.75em;
}

.assistant-content ul,
.assistant-content ol {
    margin: 0.3em 0 0.75em;
    padding-left: 1.35em;
}

.assistant-content li {
    margin-bottom: 0.3em;
}

.assistant-content strong {
    font-weight: 600;
}

.assistant-content a {
    color: var(--primary-text);
}

.assistant-content table {
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 13.5px;
}

.assistant-content th,
.assistant-content td {
    border: 1px solid var(--line);
    padding: 6px 11px;
    text-align: left;
}

.assistant-content th {
    background: var(--surface-2);
}

.assistant-content.streaming::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 15px;
    margin-left: 3px;
    vertical-align: text-bottom;
    border-radius: 2px;
    background: var(--primary);
    animation: caret-blink 0.9s steps(2) infinite;
}

@keyframes caret-blink {
    50% { opacity: 0; }
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--surface-2);
    animation: rise-in 0.3s ease;
}

.status-dots {
    display: inline-flex;
    gap: 4px;
}

.status-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    animation: dot-bounce 1.2s ease-in-out infinite;
}

.status-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.status-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.status-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
}

.notice {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 500;
    animation: rise-in 0.35s ease;
}

.notice.warning {
    border-color: transparent;
    background: var(--warn-tint);
    color: var(--warn-text);
}

.session-banner {
    margin: 10px 0;
    padding: 13px 17px;
    border-radius: var(--radius-md);
    background: var(--warn-tint);
    color: var(--warn-text);
    font-size: 13px;
    line-height: 1.55;
    animation: rise-in 0.35s ease;
}

.products-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products-label {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 400;
    color: var(--ink);
    margin: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    opacity: 0;
    animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--stagger) * 80ms);
    transition: border-color 0.2s, transform 0.2s;
}

.product-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--surface-2);
    overflow: hidden;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-media .media-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 30px;
}

.dessert-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--primary-text);
    font-size: 11px;
    font-weight: 600;
}

.product-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 13px 14px 14px;
    flex: 1;
}

.product-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

.product-branch {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--ink-faint);
    margin: 0;
    min-width: 0;
}

.branch-logo {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
}

.branch-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.branch-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-faint);
}

a.branch-name {
    text-decoration: none;
    transition: color 0.15s;
}

a.branch-name:hover {
    color: var(--primary-text);
    text-decoration: underline;
}

.product-desc {
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.diet-badge {
    padding: 2.5px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 10.5px;
    font-weight: 600;
}

.serving-note {
    font-size: 11.5px;
    color: var(--green-text);
    font-weight: 600;
    margin: 0;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
}

.product-price {
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--ink);
}

.add-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: 600 12.5px var(--font-body);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.add-button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.restaurants-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.restaurants-label {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 400;
    color: var(--ink);
    margin: 0;
}

.restaurants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.restaurant-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    animation: card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--stagger) * 80ms);
    transition: border-color 0.2s, transform 0.2s;
}

.restaurant-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.restaurant-cover {
    position: relative;
    aspect-ratio: 16 / 7;
    background: var(--surface-2);
    overflow: hidden;
}

.restaurant-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.restaurant-cover.is-empty {
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
}

.restaurant-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 14px 14px;
    flex: 1;
}

.restaurant-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.restaurant-logo {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
}

.restaurant-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.restaurant-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.restaurant-name {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restaurant-location {
    font-size: 12px;
    color: var(--ink-faint);
    margin: 0;
}

.restaurant-note {
    font-size: 12px;
    color: var(--green-text);
    font-weight: 600;
    line-height: 1.45;
    margin: 0;
}

.restaurant-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}

.restaurant-select-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font: 600 12.5px var(--font-body);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.restaurant-select-button:hover {
    opacity: 0.9;
}

.restaurant-view-link {
    font: 600 12.5px var(--font-body);
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.restaurant-view-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.kaiser-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 640px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    animation: rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.kf-heading {
    margin: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
}

.kf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.kf-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kf-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.kf-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface-2);
    color: var(--ink);
    font: 400 13px var(--font-body);
}

.kf-input:focus {
    outline: none;
    border-color: var(--primary);
}

.kf-textarea {
    resize: vertical;
    min-height: 60px;
}

.kf-gl {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kf-gl-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kf-gl-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kf-gl-value {
    flex: 1;
}

.kf-gl-pct {
    width: 132px;
    flex: 0 0 132px;
}

.kf-gl-row-invalid .kf-gl-value {
    border-color: var(--danger);
}

.kf-gl-remove {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
}

.kf-gl-total {
    font-size: 11.5px;
    font-weight: 600;
}

.kf-gl-total.ok {
    color: var(--green-text);
}

.kf-gl-total.off {
    color: #c98a00;
}

.kf-add-gl {
    align-self: flex-start;
    padding: 5px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font: 600 12px var(--font-body);
    cursor: pointer;
}

.kf-error {
    margin: 0;
    font-size: 12px;
    color: #c0392b;
    display: none;
}

.kf-error.visible {
    display: block;
}

.kf-submit {
    align-self: flex-start;
    padding: 9px 18px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font: 600 13px var(--font-body);
    cursor: pointer;
    transition: opacity 0.15s;
}

.kf-submit:hover {
    opacity: 0.9;
}

.kf-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.kf-field-error-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--danger);
    min-height: 0;
}

.kf-field-error-text:empty {
    display: none;
}

.kf-field-invalid .kf-input,
.kf-field-invalid .fc-trigger,
.kf-field-invalid .fc-number {
    border-color: var(--danger);
}

/* Custom themed form controls */
.fc-control {
    position: relative;
    width: 100%;
}

.fc-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface-2);
    color: var(--ink);
    font: 400 13px var(--font-body);
    cursor: pointer;
    text-align: left;
}

.fc-control.open .fc-trigger,
.fc-trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
}

.fc-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-trigger-label.placeholder {
    color: var(--ink-faint);
}

.fc-caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--ink-soft);
    transition: transform 0.15s;
}

.fc-control.open .fc-caret {
    transform: rotate(180deg);
}

.fc-cal-icon {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--ink-soft);
    border-radius: 3px;
    position: relative;
}

.fc-cal-icon::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 2px;
    right: 2px;
    height: 3px;
    border-left: 1.5px solid var(--ink-soft);
    border-right: 1.5px solid var(--ink-soft);
}

.fc-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface);
    box-shadow: 0 12px 32px var(--overlay);
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
    animation: fc-pop 0.14s ease;
}

@keyframes fc-pop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fc-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: var(--ink);
    font: 400 13px var(--font-body);
    text-align: left;
    cursor: pointer;
}

.fc-option:hover {
    background: var(--surface-2);
}

.fc-option.selected {
    background: var(--primary-tint);
    color: var(--primary-text);
    font-weight: 600;
}

.fc-calendar {
    right: auto;
    width: 260px;
    padding: 10px;
}

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

.fc-cal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.fc-cal-nav {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.fc-cal-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.fc-cal-weekdays,
.fc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.fc-cal-weekdays span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-faint);
    padding: 4px 0;
}

.fc-cal-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font: 400 12.5px var(--font-body);
    cursor: pointer;
}

.fc-cal-day:hover:not(:disabled) {
    background: var(--surface-2);
}

.fc-cal-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.fc-cal-day:disabled {
    color: var(--ink-faint);
    opacity: 0.4;
    cursor: default;
}

.fc-number {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    background: var(--surface-2);
}

.fc-number-btn {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.fc-number-btn:hover {
    background: var(--surface);
}

.fc-number-input {
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--ink);
    font: 600 13px var(--font-body);
    text-align: center;
}

.fc-number-input:focus {
    outline: none;
}

.order-result-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    animation: rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.order-result-card.success {
    border-color: var(--green-text);
}

.order-result-card.warning {
    border-color: #c98a00;
}

.order-result-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.order-result-text {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.order-result-note {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-faint);
    line-height: 1.5;
}

.bm-form-button {
    align-self: flex-start;
    margin-top: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font: 600 12.5px var(--font-body);
    text-decoration: none;
    transition: opacity 0.15s;
}

.bm-form-button:hover {
    opacity: 0.9;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 600px;
    animation: rise-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.summary-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
}

.summary-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
}

.summary-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--line);
}

.summary-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.summary-item-title {
    font-size: 13.5px;
    font-weight: 600;
}

.summary-item-meta {
    font-size: 12px;
    color: var(--ink-faint);
}

.summary-item-price {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

.summary-delivery {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.summary-delivery strong {
    color: var(--ink);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 4px;
}

.summary-total span {
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 600;
}

.summary-total strong {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
}

.summary-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 18px;
}

.confirm-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--green);
    color: #06281a;
    font: 700 14px var(--font-body);
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}

.confirm-button:hover {
    filter: brightness(1.06);
}

.confirm-button:active {
    transform: scale(0.99);
}

.confirm-button:disabled {
    background: var(--surface-2);
    color: var(--ink-faint);
    cursor: default;
}

.summary-confirm-hint {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--warn-text);
    font-weight: 600;
}

.secondary-button {
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ink-soft);
    font: 600 13.5px var(--font-body);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.secondary-button:hover {
    border-color: var(--line-strong);
    color: var(--ink);
    background: var(--surface-2);
}

.composer-wrap {
    flex-shrink: 0;
    position: relative;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.scroll-down {
    position: absolute;
    top: -52px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, border-color 0.15s, color 0.15s;
}

.scroll-down.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.scroll-down:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.scroll-down svg {
    width: 16px;
    height: 16px;
}

.composer-column {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 24px 14px;
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 16px;
    transition: border-color 0.15s;
}

.composer:focus-within {
    border-color: var(--primary);
}

.composer textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font: 400 15px/1.5 var(--font-body);
    color: var(--ink);
    max-height: 160px;
    padding: 8px 0;
}

.composer textarea::placeholder {
    color: var(--ink-faint);
}

.send-button {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: filter 0.15s, opacity 0.15s, transform 0.1s;
}

.send-button svg {
    width: 17px;
    height: 17px;
}

.send-button:hover {
    filter: brightness(1.08);
}

.send-button:active {
    transform: scale(0.94);
}

.send-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.composer-hint {
    margin: 9px 2px 0;
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-faint);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 40;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 100vw);
    background: var(--surface);
    border-left: 1px solid var(--line);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.34s;
}

.cart-drawer.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.drawer-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 400;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

.cart-items::-webkit-scrollbar {
    width: 8px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
}

.cart-empty {
    margin: auto;
    text-align: center;
    color: var(--ink-faint);
    font-size: 13.5px;
    line-height: 1.6;
    padding: 0 20px;
}

.cart-empty .empty-icon {
    font-size: 30px;
    display: block;
    margin-bottom: 10px;
}

.cart-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: rise-in 0.3s ease;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cart-item-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
}

.cart-item-price {
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
}

.cart-item-branch {
    font-size: 12px;
    color: var(--ink-faint);
}

.cart-item-options {
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
}

.cart-qty {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 3px 10px;
}

.cart-item-buttons {
    display: flex;
    gap: 4px;
}

.text-button {
    border: none;
    background: none;
    font: 600 12.5px var(--font-body);
    color: var(--primary-text);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.text-button:hover {
    background: var(--primary-tint);
}

.text-button.danger {
    color: var(--danger);
}

.text-button.danger:hover {
    background: var(--danger-tint);
}

.drawer-footer {
    border-top: 1px solid var(--line);
    padding: 16px 22px 20px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--ink-soft);
    font-weight: 600;
}

.cart-total-row strong {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    color: var(--ink);
}

.drawer-note {
    margin: 9px 0 0;
    font-size: 11.5px;
    color: var(--ink-faint);
    line-height: 1.5;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--overlay);
    animation: fade-in 0.18s ease;
}

.modal {
    width: min(460px, 100%);
    max-height: min(86dvh, 700px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    animation: modal-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 22px 4px;
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 400;
    line-height: 1.25;
}

.modal-sub {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--ink-faint);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
}

.qty-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qty-label {
    font-size: 13.5px;
    font-weight: 600;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}

.qty-stepper button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.qty-stepper button:hover {
    background: var(--surface-2);
}

.qty-value {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    font-size: 14.5px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.option-group-name {
    font-size: 13.5px;
    font-weight: 600;
}

.option-group-rule {
    font-size: 11.5px;
    color: var(--ink-faint);
    font-weight: 600;
}

.option-group-rule.required {
    color: var(--primary-text);
}

.option-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.option-row:hover {
    border-color: var(--line-strong);
}

.option-row.selected {
    border-color: var(--primary);
    background: var(--primary-tint);
}

.option-row input {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
}

.option-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.option-price {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--green-text);
    white-space: nowrap;
}

.modal-error {
    display: none;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--danger-tint);
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 600;
}

.modal-error.visible {
    display: block;
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--line);
}

.modal-confirm {
    width: min(420px, 100%);
}

.modal-confirm-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.modal-confirm-footer {
    justify-content: flex-end;
}

.modal-total {
    display: flex;
    flex-direction: column;
}

.modal-total span {
    font-size: 11.5px;
    color: var(--ink-faint);
    font-weight: 600;
}

.modal-total strong {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 400;
}

.modal-submit {
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font: 600 13.5px var(--font-body);
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}

.modal-submit:hover {
    filter: brightness(1.08);
}

.modal-submit:active {
    transform: scale(0.98);
}

.toast-root {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--inverse);
    color: var(--inverse-ink);
    font-size: 13px;
    font-weight: 500;
    animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.leaving {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

.debug-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font: 600 11.5px var(--font-mono);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.debug-toggle:hover {
    color: var(--ink);
    border-color: var(--ink-faint);
}

.debug-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--green);
    color: #06281a;
    font-size: 10.5px;
    font-weight: 700;
}

.debug-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(46dvh, 420px);
    z-index: 79;
    display: flex;
    flex-direction: column;
    background: #0b0c14;
    color: #c9cce6;
    border-top: 1px solid #2c2e44;
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: var(--font-mono);
}

.debug-panel.open {
    transform: translateY(0);
}

.debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid #1f2134;
    flex-shrink: 0;
}

.debug-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8eb8;
}

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

.debug-action {
    border: 1px solid #2c2e44;
    background: transparent;
    color: #8a8eb8;
    font: 600 11px var(--font-mono);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.debug-action:hover {
    border-color: #4fe7a8;
    color: #4fe7a8;
}

.debug-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 14px;
    scrollbar-width: thin;
    scrollbar-color: #34364c transparent;
}

.debug-list::-webkit-scrollbar {
    width: 8px;
}

.debug-list::-webkit-scrollbar-thumb {
    background: #34364c;
    border-radius: 999px;
}

.debug-row {
    border-bottom: 1px solid rgba(31, 33, 52, 0.7);
}

.debug-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    cursor: pointer;
    font-size: 11.5px;
    line-height: 1.5;
    transition: background 0.12s;
}

.debug-row-head:hover {
    background: rgba(141, 107, 250, 0.08);
}

.debug-time {
    color: #565a85;
    flex-shrink: 0;
    font-size: 10.5px;
}

.debug-badge {
    flex-shrink: 0;
    min-width: 54px;
    text-align: center;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.debug-badge.info {
    background: rgba(141, 107, 250, 0.18);
    color: #b3a0fc;
}

.debug-badge.mcp {
    background: rgba(43, 224, 150, 0.14);
    color: #5cf0ae;
}

.debug-badge.tool {
    background: rgba(86, 156, 255, 0.16);
    color: #8fbcff;
}

.debug-badge.warn {
    background: rgba(255, 176, 32, 0.16);
    color: #ffce6b;
}

.debug-badge.err {
    background: rgba(255, 92, 92, 0.18);
    color: #ff9090;
}

.debug-badge.done {
    background: rgba(43, 224, 150, 0.2);
    color: #2be096;
}

.debug-summary {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #b6b9dd;
}

.debug-detail {
    display: none;
    margin: 0;
    padding: 10px 18px 14px 82px;
    font-size: 11px;
    line-height: 1.6;
    color: #8a8eb8;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.3);
    max-height: 240px;
    overflow-y: auto;
}

.debug-row.expanded .debug-detail {
    display: block;
}

@media (max-width: 640px) {
    .header-inner {
        padding: 12px 16px;
    }

    .brand-logo {
        height: 24px;
    }

    .ghost-label {
        display: none;
    }

    .ghost-button {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    .chat-column {
        padding: 20px 16px 28px;
    }

    .messages {
        gap: 22px;
    }

    .welcome {
        padding-top: 7vh;
    }

    .bubble {
        max-width: 88%;
    }

    .avatar {
        display: none;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .summary-actions {
        flex-direction: column;
    }

    .composer-column {
        padding: 12px 14px 12px;
    }

    .modal-overlay {
        padding: 0;
        align-items: end;
    }

    .modal {
        width: 100%;
        max-height: 92dvh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom: none;
    }

    .debug-detail {
        padding-left: 18px;
    }

    .debug-toggle {
        bottom: auto;
        top: 70px;
        left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}
