* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
    background: #f7f3ed;
    color: #251d17;
}

a {
    color: #8a3b12;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,.04);
    overflow-x: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

h1, h2, h3 {
    margin-top: 0;
}

.category-title {
    border-left: 6px solid #d2691e;
    padding-left: 10px;
}

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 96px;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #f0e6dc;
    padding: 12px 0;
    white-space: nowrap;
}

.item-row:last-child {
    border-bottom: 0;
}

.item-row > div:first-child,
.item-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-row strong {
    display: block;
}

.item-price {
    text-align: right;
    white-space: nowrap;
}

.menu-checkout-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.menu-clear-selection-btn {
    margin-right: auto;
    white-space: nowrap;
}

.page-jump-btn {
    position: fixed;
    top: 120px;
    right: 18px;
    z-index: 9000;
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: #6d6259;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.page-jump-btn:hover {
    background: #5d534c;
}

.order-total-summary {
    margin: 0;
    padding: 12px 16px;
    width: fit-content;
    min-width: 180px;
    border: 1px solid #eadfd4;
    border-radius: 12px;
    background: #fffaf1;
    color: #251d17;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.order-total-summary.checkout-total-summary {
    margin: 16px 0 0 auto;
}

.sold-out {
    opacity: .45;
}

input, select, textarea, button {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9c8b6;
    border-radius: 10px;
    background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
}

button, .btn {
    display: inline-block;
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #d2691e;
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: #6d6259;
}

.btn-danger {
    background: #b73535;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th, .table td {
    border-bottom: 1px solid #eee;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.notice {
    padding: 12px;
    border-radius: 12px;
    background: #fff7df;
    border: 1px solid #f0d98b;
}

.store-status-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.store-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    padding: 4px 10px;
    background: #fff;
    color: #4f463f;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.store-status-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d93025;
    box-shadow: 0 0 0 3px rgba(217,48,37,.14);
}

.store-status-badge.is-online .store-status-icon {
    background: #188038;
    box-shadow: 0 0 0 3px rgba(24,128,56,.16);
}

.store-status-badge.is-offline .store-status-icon {
    background: #d93025;
    box-shadow: 0 0 0 3px rgba(217,48,37,.14);
}

.chat-box {
    height: 320px;
    overflow-y: auto;
    border: 1px solid #eadfd4;
    background: #fffdf9;
    border-radius: 16px;
    padding: 12px;
}

.msg {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 14px;
    max-width: 78%;
}

.msg.customer {
    background: #e8f0ff;
    margin-left: auto;
}

.msg.store {
    background: #fff0df;
    margin-right: auto;
}

.msg.system {
    background: #eee;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: .9em;
}

.quick-replies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 700px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 14px 12px;
        border-radius: 12px;
    }

    .item-row {
        grid-template-columns: minmax(0, 1fr) auto 88px;
        gap: 8px;
        padding: 10px 0;
    }

    .item-row select {
        padding: 8px;
    }

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

    .menu-checkout-actions {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .menu-clear-selection-btn {
        margin-right: 0;
    }

    .page-jump-btn {
        top: 96px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .header {
        display: block;
    }
}


html.theme-dark body,
body.theme-dark {
    background: #171412;
    color: #f4eee8;
}

html.theme-dark a,
body.theme-dark a {
    color: #ffb16c;
}

html.theme-dark .card,
body.theme-dark .card,
html.theme-dark .table,
body.theme-dark .table {
    background: #24201d;
    border-color: #4a3f37;
    box-shadow: 0 6px 20px rgba(0,0,0,.28);
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: #1e1a17;
    border-color: #5b4d43;
    color: #f4eee8;
}

html.theme-dark .table th,
html.theme-dark .table td,
body.theme-dark .table th,
body.theme-dark .table td,
html.theme-dark .item-row,
body.theme-dark .item-row {
    border-bottom-color: #3a332d;
}

html.theme-dark .order-total-summary,
body.theme-dark .order-total-summary,
html.theme-dark .cookie-notice,
body.theme-dark .cookie-notice {
    background: #2d261c;
    border-color: #4b4037;
    color: #f4eee8;
}

html.theme-dark .page-jump-btn,
body.theme-dark .page-jump-btn {
    background: #7a6d62;
    color: #fff;
}

html.theme-dark .notice,
body.theme-dark .notice {
    background: #2d261c;
    border-color: #80652b;
    color: #f7e7c4;
}

html.theme-dark .store-entry-meta,
body.theme-dark .store-entry-meta {
    color: #d8cbbf;
}

html.theme-dark .store-entry-card-title,
body.theme-dark .store-entry-card-title {
    color: #f4eee8;
}

html.theme-dark .store-status-badge,
body.theme-dark .store-status-badge {
    background: #24201d;
    border-color: #4a3f37;
    color: #f4eee8;
}

html.theme-dark .chat-box,
body.theme-dark .chat-box {
    background: #1e1a17;
    border-color: #4a3f37;
}

html.theme-dark .msg.customer,
body.theme-dark .msg.customer {
    background: #263652;
}

html.theme-dark .msg.store,
body.theme-dark .msg.store {
    background: #463120;
}

html.theme-dark .msg.system,
body.theme-dark .msg.system {
    background: #37322d;
}

html.theme-dark .sold-out,
body.theme-dark .sold-out {
    opacity: .5;
}


.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #eadfd4;
    color: #251d17;
    text-decoration: none;
    font-weight: 700;
}

.social-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6d6259;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
}

.social-link-fb .social-icon {
    background: #1877f2;
}

.social-link-ig .social-icon {
    background: #c13584;
}

.social-link-threads .social-icon {
    background: #111;
}

.social-link-line .social-icon {
    background: #06c755;
}


.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.contact-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d2691e;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}


[data-language-select] {
    min-width: 120px;
    width: auto;
}


.cookie-notice {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 16px;
    border: 1px solid #eadfd4;
    border-radius: 12px;
    background: #fffaf1;
    color: #251d17;
    box-shadow: 0 8px 26px rgba(0,0,0,.14);
}

.cookie-notice-text {
    line-height: 1.5;
}

.cookie-notice-btn {
    flex: 0 0 auto;
}

.customer-menu-container,
.checkout-container {
    max-width: 820px;
}

.customer-menu-container {
    position: relative;
}

.store-entry-container {
    max-width: 1040px;
}

.store-entry-header {
    padding-right: 220px;
}

.store-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
}

.store-entry-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.store-entry-cover {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(210,105,30,.92), rgba(91,77,67,.9)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 10px, transparent 10px 20px);
    color: #fff;
}

.store-entry-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.2));
}

.store-entry-logo,
.store-entry-cover-title,
.store-entry-cover .store-status-badge {
    position: relative;
    z-index: 1;
}

.store-entry-logo {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: #d2691e;
    font-size: 1.8rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.store-entry-cover-title {
    max-width: calc(100% - 32px);
    overflow: hidden;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-entry-cover .store-status-badge {
    border-color: rgba(255,255,255,.45);
    background: rgba(255,255,255,.92);
}

.store-entry-card:hover .store-entry-cover {
    box-shadow: 0 8px 22px rgba(0,0,0,.14);
    transform: translateY(-1px);
}

.store-entry-card-main {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding-top: 10px;
}

.store-entry-card-title {
    margin: 0;
    color: #15110e;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
}

.store-entry-meta {
    display: grid;
    gap: 4px;
    color: #5f534a;
    font-size: .95rem;
    line-height: 1.45;
}

.store-entry-action {
    display: none;
}

.store-entry-empty h2 {
    margin-bottom: 8px;
}

.customer-language-picker {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.customer-language-picker label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
}

.customer-language-picker select {
    width: auto;
}

@media (max-width: 900px) {
    .store-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .customer-language-picker {
        position: static;
        justify-content: flex-end;
        margin-bottom: 12px;
    }

    .store-entry-header {
        padding-right: 0;
    }

    .store-entry-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .store-entry-card {
        max-width: 420px;
        width: 100%;
        margin: 0 auto;
    }

    .store-entry-action {
        text-align: center;
    }

    .cookie-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-notice-btn {
        width: 100%;
    }
}

.alias-fields {
    display: grid;
    gap: 6px;
    min-width: 180px;
}

.translation-alias {
    color: #6f6259;
    font-weight: 600;
    margin-left: 4px;
}

body.dark-mode .translation-alias {
    color: #d9cfc7;
}

.inline-lookup-panel {
    margin-top: 72px;
    margin-bottom: 16px;
}

.inline-lookup-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.inline-lookup-result {
    margin-top: 12px;
}

.table-scroll {
    overflow-x: auto;
}

@media (max-width: 700px) {
    .inline-lookup-panel {
        margin-top: 0;
    }

    .inline-lookup-form {
        grid-template-columns: 1fr;
    }
}

.item-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.item-filter-bar button {
    min-height: 42px;
}
