:root {
    --brand: #ff5a00;
    --ink: #242424;
    --muted: #6f6f6f;
    --line: #e8e1dc;
    --bg: #fff8f3;
    --panel: #ffffff;
    --soft: #fff0e6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, #ffe7d4, transparent 28%),
        linear-gradient(180deg, #fff8f3, #fff1e7);
    font-family: var(--site-font-family, Arial, Helvetica, sans-serif);
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

textarea {
    font: inherit;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 44px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
}

.auth-nav {
    display: flex;
    gap: 14px;
}

.auth-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.auth-layout,
.account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    gap: 24px;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 28px clamp(16px, 4vw, 44px);
}

.account-layout {
    grid-template-columns: 360px minmax(0, 1fr);
}

.account-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px clamp(16px, 4vw, 44px);
}

.account-sidebar,
.account-content {
    display: grid;
    gap: 18px;
    align-content: start;
}

.account-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.auth-hero,
.auth-card,
.account-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
}

.auth-hero,
.auth-card,
.account-card {
    padding: 24px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-hero h1,
.account-card h1,
.account-card h2 {
    margin: 0 0 8px;
}

.account-card h3 {
    margin: 0;
}

.auth-hero p,
.muted-copy {
    margin: 0;
    color: var(--muted);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
    padding: 4px;
    border-radius: 999px;
    background: #f2ebe5;
}

.auth-tab {
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.auth-tab.active {
    color: #fff;
    background: var(--brand);
}

.auth-form,
.auth-panel,
.detail-list,
.order-list {
    display: grid;
    gap: 12px;
}

.auth-panel[hidden] {
    display: none;
}

.auth-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

.auth-form textarea {
    width: 100%;
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    resize: vertical;
}

.auth-form input[readonly] {
    background: #f8f4ef;
    color: var(--muted);
}

.account-distance-status {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px dashed #e0cfc2;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.account-distance-status.is-loading,
.account-distance-status.is-ok,
.account-distance-status.is-error {
    border-style: solid;
}

.account-distance-status.is-loading {
    border-color: #f4c8ab;
    background: #fff5ee;
    color: #9a4c14;
}

.account-distance-status.is-ok {
    border-color: #cfe8c6;
    background: #f5fff2;
    color: #2f7d32;
}

.account-distance-status.is-error {
    border-color: #f0b4b4;
    background: #fff4f4;
    color: #b33a3a;
}

.auth-form button {
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-weight: 900;
}

.auth-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    color: var(--muted);
    font-weight: 800;
}

.auth-links.compact {
    justify-content: flex-end;
    margin-top: -4px;
    font-size: 14px;
}

.auth-links a {
    color: var(--brand);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-reset-dev {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed #ffc39e;
    border-radius: 8px;
    background: #fff7f0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.auth-reset-dev a {
    overflow-wrap: anywhere;
    color: var(--brand);
    font-weight: 800;
}

.auth-status {
    min-height: 20px;
    color: var(--muted);
    font-size: 14px;
}

.auth-status-success {
    color: #2f7d32;
}

.auth-status-error {
    color: #b33a3a;
}

.detail-list div {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    font-weight: 800;
}

.order-row {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.order-head,
.order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-meta {
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 13px;
}

.order-row p {
    margin: 0;
    line-height: 1.45;
}

.order-total {
    color: var(--brand);
    font-weight: 900;
}

.order-preview {
    color: var(--muted);
}

.booking-row .order-head {
    align-items: flex-start;
}

.booking-meta {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.booking-meta .order-status {
    white-space: nowrap;
}

.booking-note {
    margin-top: 12px !important;
    color: var(--muted);
    font-size: 13px;
}

.booking-change-request {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.booking-change-request summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 900;
}

.booking-change-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.booking-change-form textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    font: inherit;
}

.booking-change-form button {
    justify-self: start;
}

.order-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.order-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 900;
}

.order-status-pending {
    color: #8a4f00;
    background: #fff1d6;
}

.order-status-accepted {
    color: #0e5c8f;
    background: #e7f4ff;
}

.order-status-completed {
    color: #17653d;
    background: #eaf8f0;
}

.order-status-cancelled {
    color: #a32b1f;
    background: #ffe9e6;
}

.reorder-button {
    text-decoration: none;
}

.compact-form {
    margin-top: 18px;
}

.account-summary-card {
    gap: 18px;
}

.account-summary-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.account-summary-list div {
    display: grid;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.account-summary-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.account-summary-list dd {
    margin: 0;
    font-weight: 700;
}

.account-nav {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.account-nav-link {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--ink);
    background: #fff6f0;
    cursor: pointer;
    text-align: left;
}

.account-nav-link strong {
    font-size: 16px;
}

.account-nav-link span {
    color: var(--muted);
    font-size: 13px;
}

.account-nav-link.is-active {
    border-color: #ffbf98;
    color: #fff;
    background: linear-gradient(135deg, #ff7a1a, var(--brand));
    box-shadow: 0 14px 26px rgba(255, 90, 0, 0.16);
}

.account-nav-link.is-active span {
    color: rgba(255, 255, 255, 0.85);
}

.account-panel[hidden] {
    display: none;
}

.panel-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.panel-header .muted-copy {
    max-width: 320px;
    text-align: right;
}

.panel-action-button {
    min-height: 42px;
    border: 1px solid var(--line);
    background: #fff;
}

.address-form-wrap[hidden] {
    display: none;
}

.address-form-wrap {
    margin-top: 18px;
}

.account-placeholder {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px dashed #ffc59b;
    border-radius: 8px;
    background: #fffaf5;
}

.account-placeholder p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.allergy-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.allergy-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.allergy-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.allergy-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 14px;
    color: #1f4ed8;
    font-weight: 800;
}

.allergy-chip:has(input:checked),
.allergy-chip.is-selected {
    border-color: #1f4ed8;
    background: #1f4ed8;
    box-shadow: 0 8px 18px rgba(31, 78, 216, 0.16);
}

.allergy-chip:has(input:checked) span,
.allergy-chip.is-selected span {
    color: #fff;
}

.account-status {
    margin-top: 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
}

.account-status-success {
    color: #17653d;
    background: #eaf8f0;
}

.account-status-error {
    color: #a32b1f;
    background: #ffe9e6;
}

.address-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.address-row {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.address-row.is-default {
    border-color: #ffc59b;
    background: #fffaf5;
}

.address-head,
.address-meta,
.address-actions,
.form-head,
.inline-fields {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.address-row p {
    margin: 10px 0;
    line-height: 1.45;
}

.address-meta {
    color: var(--muted);
    font-size: 13px;
}

.address-actions {
    margin-top: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.address-actions form {
    margin: 0;
}

.secondary-button,
.link-button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 14px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.danger-button {
    color: #a32b1f;
}

.default-pill {
    border-radius: 999px;
    padding: 6px 9px;
    color: #fff;
    background: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.form-head {
    margin-bottom: 4px;
}

.form-head h3 {
    margin: 0;
}

.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    color: var(--brand);
    background: transparent;
}

.inline-fields {
    align-items: end;
}

.inline-fields label {
    flex: 1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.checkbox-row input {
    width: auto;
    accent-color: var(--brand);
}

.order-modal[hidden] {
    display: none;
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.order-modal-card {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: 86vh;
    overflow: auto;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f4eee9;
    cursor: pointer;
}

.order-modal-head,
.order-modal-meta,
.order-modal-footer,
.modal-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-modal-head {
    margin-bottom: 10px;
}

.order-modal-head h3 {
    margin: 0;
}

.order-modal-meta {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.order-modal-items {
    display: grid;
    gap: 12px;
}

.order-modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.order-summary-chip {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8f3;
}

.order-summary-chip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-summary-chip strong {
    font-size: 16px;
}

.order-summary-chip.is-total {
    border-color: #ffd7be;
    background: #fff3ea;
}

.order-modal-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-bottom: 8px;
}

.order-detail-row {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.order-detail-row dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-detail-row dd {
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

.modal-item-row {
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.modal-item-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.4;
}

.order-modal-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    align-items: center;
}

@media (max-width: 900px) {
    .auth-layout,
    .account-layout,
    .account-shell {
        grid-template-columns: 1fr;
        padding: 16px 12px 28px;
    }

    .auth-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-head,
    .order-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .address-head,
    .address-meta,
    .address-actions,
    .form-head,
    .inline-fields,
    .panel-header,
    .panel-header-actions,
    .order-modal-head,
    .order-modal-meta,
    .order-modal-footer,
    .modal-item-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-modal-summary,
    .order-modal-detail-grid {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: static;
    }

    .account-nav {
        padding: 10px;
    }

    .panel-header .muted-copy {
        max-width: none;
        text-align: left;
    }

    .panel-header-actions {
        justify-items: stretch;
    }
}
