:root {
    font-family: Arial, sans-serif;
    color: #51331e;
    background: #fff9f2;
}

body.register-page {
    border-top: 0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    border-top: 0;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 8px 30px;
    border-bottom: 1px solid #ead8c7;
    color: #b95000;
    font-size: 18px;
    font-weight: 700;
}

main {
    width: min(100% - 32px, 300px);
    margin: 14px auto 48px;
}

h1 {
    margin: 0 0 16px;
    color: #b95000;
    font-size: 18px;
    text-align: left;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.roles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.role {
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #ead5c2;
    background: #f3e5d7;
    color: #765a42;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.role[aria-pressed="true"],
.submit {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.field {
    margin-bottom: 10px;
}

.field input {
    display: block;
    width: 100%;
    height: 28px;
    padding: 5px 7px;
    border: 1px solid #e5d1bd;
    border-radius: 0;
    background: #fffdfa;
    color: #51331e;
    font: 11px Arial, sans-serif;
}

.field label {
    display: block;
    margin-bottom: 3px;
    color: #9b7b61;
    font: 10px Arial, sans-serif;
}

.field input::placeholder {
    color: #9b7b61;
    opacity: 1;
}

.errors,
.form-errors {
    color: #a33120;
    font-size: 11px;
}

.submit {
    width: 100%;
    height: 28px;
    margin-top: 9px;
    border: 1px solid #b95000;
    padding: 3px 7px;
    text-align: left;
    font-size: 11px;
    cursor: pointer;
}

.login {
    margin: 11px 0 23px;
    color: #8b7058;
    font-size: 11px;
}

.form-section {
    margin: 0 0 8px;
    color: #b95000;
    font-size: 11px;
}

.extras {
    margin-top: 14px;
}

.restaurant-extras {
    padding: 10px 20px 20px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.restaurant-extras .form-section {
    margin: 0 0 18px -10px;
    font-size: 12px;
}

.restaurant-extras .field {
    margin-bottom: 10px;
}

.working-hours-label {
    display: block;
    margin-bottom: 5px;
    color: #9b7b61;
    font: 11px Arial, sans-serif;
}

.opening-hours-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin-bottom: 5px;
    color: #8b7058;
    font-size: 10px;
}

.opening-hours-row input[type="hidden"] {
    display: none;
}

.opening-hours-row select {
    min-width: 0;
    flex: 0 1 72px;
    width: 72px;
    height: 28px;
    padding: 4px 3px;
    border: 1px solid #e5d1bd;
    border-radius: 0;
    background: #fffdfa;
    color: #51331e;
    font: 10px Arial, sans-serif;
}

.opening-hours-row input[type="time"] {
    min-width: 0;
    flex: 1 1 70px;
    width: 70px;
    height: 28px;
    padding: 3px;
    border: 1px solid #e5d1bd;
    border-radius: 0;
    background: #fffdfa;
    color: #51331e;
    font: 11px Arial, sans-serif;
}

.order-summary {
    max-width: 440px;
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.order-item input[type="number"] {
    width: 55px;
}

.remove-hours {
    flex: 0 0 22px;
    width: 22px;
    height: 28px;
    border: 1px solid #ead5c2;
    background: #f3e5d7;
    color: #765a42;
    cursor: pointer;
}

.add-hours-button {
    margin-top: 4px;
}

.menu-item {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 6px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
}

.tag {
    padding: 4px 12px;
    border: 1px solid #ead5c2;
    border-radius: 12px;
    color: #8b7058;
    font-size: 10px;
    cursor: pointer;
}

.menu-button {
    display: block;
    width: 78%;
    height: 30px;
    border: 1px solid #ead5c2;
    background: #f3e5d7;
    color: #765a42;
    padding: 4px 8px;
    text-align: left;
    font-size: 11px;
    cursor: pointer;
}

.restaurant-orders {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 40px 0 28px;
}

.restaurant-dashboard-page {
    border-top: 0;
}

.restaurant-dashboard {
    width: min(100% - 60px, 1400px);
    margin: 42px auto 48px;
}

.order-column {
    min-height: 600px;
    padding: 9px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.order-column h2 {
    margin: 0 0 14px;
    color: #b95000;
    font-size: 14px;
}

.order-card {
    min-height: 160px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.order-card > strong {
    display: block;
    color: #b95000;
    font-size: 13px;
}

.order-card-status {
    margin-top: 5px !important;
}

.order-details {
    margin-top: 9px;
    color: #765a42;
    font-size: 11px;
}

.order-details summary {
    color: #9b4b14;
    cursor: pointer;
    font-size: 11px;
}

.order-details-content {
    max-height: 420px;
    overflow: auto;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.order-details-content h3 {
    margin: 10px 0 5px;
    color: #b95000;
    font-size: 11px;
}

.order-details-content h3:first-child {
    margin-top: 0;
}

.order-details-content dl {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
    gap: 4px 8px;
    margin: 0;
}

.order-details-content dt {
    color: #8b7058;
    font-weight: 700;
}

.order-details-content dd,
.order-details-content p,
.order-detail-items {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.order-detail-items {
    padding-left: 18px;
}

.order-card p {
    margin: 8px 0 0;
    color: #765a42;
    font-size: 12px;
}

.order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.order-actions form {
    margin: 0;
}

.order-button {
    min-width: 112px;
    height: 33px;
    padding: 6px 10px;
    border: 1px solid #ead5c2;
    font: 12px Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.order-primary {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.order-secondary {
    background: #f3e5d7;
    color: #8b7058;
}

.empty-orders {
    margin: 0;
    color: #8b7058;
    font-size: 12px;
}

.restaurant-settings {
    padding-top: 24px;
    border-top: 1px solid #ead8c7;
}

.settings-page {
    width: min(100% - 52px, 1400px);
    margin: 42px auto 48px;
}

.restaurant-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 36px;
}

.settings-panel {
    min-width: 0;
    min-height: 375px;
    padding: 10px 18px 24px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.settings-panel h2 {
    margin: 0 0 16px;
    color: #b95000;
    font-size: 14px;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #8b7058;
    font-size: 12px;
}

.settings-table th,
.settings-table td {
    height: 40px;
    padding: 5px;
    border: 1px solid #ead8c7;
    text-align: left;
}

.settings-table th {
    background: #f3e5d7;
    color: #9b4b14;
    font-weight: 700;
}

.settings-table input[type="text"],
.settings-table input[type="number"] {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 5px;
    border: 0;
    background: transparent;
    color: #765a42;
    font: 12px Arial, sans-serif;
}

.settings-table input[type="checkbox"] {
    margin: 0 7px 0 0;
}

.menu-table th:first-child {
    width: 34%;
}

.menu-table th:nth-child(2) {
    width: 33%;
}

.menu-table th:last-child {
    width: 33%;
}

.table-action {
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #8b7058;
    font: 11px Arial, sans-serif;
    cursor: pointer;
}

.day-toggle {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.hours-table td:first-child {
    width: 38%;
}

.hours-table .hours-separator {
    width: 24px;
    padding: 2px;
    text-align: center;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.settings-actions button {
    min-width: 130px;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #ead5c2;
    font: 12px Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.settings-primary {
    border-color: #b95000 !important;
    background: #b95000;
    color: white;
}

.settings-secondary {
    background: #f3e5d7;
    color: #8b7058;
}

@media (max-width: 850px) {
    .restaurant-orders {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .order-column {
        min-height: 180px;
    }

    .restaurant-dashboard {
        width: min(100% - 32px, 650px);
        margin-top: 24px;
    }

    .restaurant-settings-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .settings-page {
        width: min(100% - 32px, 650px);
        margin-top: 24px;
    }
}

/* Customer restaurant discovery page */
.customer-page {
    border-top: 0;
}

.customer-page main {
    width: calc(100% - 40px);
    margin: 18px 20px 48px;
}

.customer-orders > h2 {
    margin: 0 6px 14px;
    color: #b95000;
    font-size: 18px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.customer-orders-page main {
    width: calc(100% - 52px);
    margin: 38px 26px 48px;
}

.order-history-wrap {
    width: 100%;
    overflow-x: auto;
}

.order-history-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 2px;
    background: #ead8c7;
    color: #8b7058;
    font-size: 11px;
    text-align: left;
}

.order-history-table th,
.order-history-table td {
    padding: 8px 7px;
    background: #fffdfa;
    vertical-align: top;
}

.order-history-table th {
    background: #f3e5d7;
    color: #b95000;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.order-history-table .order-history-empty td {
    padding: 16px;
    color: #8b7058;
    text-align: center;
}

.review-prompt {
    color: #9b4b14;
    text-decoration: underline;
    white-space: nowrap;
}

.review-after-delivery {
    color: #9b7b61;
    white-space: nowrap;
}

.customer-review-page main {
    width: min(calc(100% - 32px), 522px);
    margin: 28px auto 48px;
}

.review-form-card {
    min-height: 332px;
    padding: 10px 14px 18px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.review-form-card h1 {
    margin: 0 0 12px;
    color: #b95000;
    font-size: 14px;
}

.review-order-meta {
    margin: 0 0 10px;
    color: #8b7058;
    font-size: 12px;
}

.review-message {
    margin: 0 0 8px;
    color: #a33120;
    font-size: 11px;
}

.review-rating-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.review-rating-fieldset legend {
    margin-bottom: 6px;
    color: #8b7058;
    font-size: 11px;
}

.review-rating-options {
    display: flex;
    gap: 6px;
}

.review-rating-option {
    position: relative;
    display: inline-flex;
    width: 26px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ead8c7;
    border-radius: 999px;
    background: #fffdfa;
    color: #8b7058;
    font-size: 10px;
    cursor: pointer;
}

.review-rating-option:has(input:checked) {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.review-rating-option:has(input:focus-visible) {
    outline: 2px solid #b95000;
    outline-offset: 2px;
}

.review-rating-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.review-text-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.review-form-card textarea {
    display: block;
    width: 100%;
    height: 112px;
    margin: 16px 0 18px;
    padding: 9px;
    resize: vertical;
    border: 1px dashed #ead8c7;
    border-radius: 0;
    background: #f3e5d7;
    color: #51331e;
    font: 11px Arial, sans-serif;
}

.review-form-card textarea::placeholder {
    color: #9b7b61;
    opacity: 1;
}

.review-submit {
    width: 156px;
    height: 28px;
    padding: 5px 8px;
    border: 1px solid #ead5c2;
    background: #b95000;
    color: white;
    font: 11px Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.delivery-location {
    min-height: 23px;
    padding: 5px 7px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
    color: #9b7b61;
    font-size: 10px;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 22px 0 20px;
}

.filter-chip {
    padding: 3px 10px;
    border: 1px solid #ead5c2;
    border-radius: 14px;
    background: #fffdfa;
    color: #8b7058;
    font: 10px Arial, sans-serif;
    cursor: pointer;
}

.filter-chip.selected {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.restaurant-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 13px;
}

.restaurant-section + .restaurant-section {
    margin-top: 24px;
}

.restaurant-section > h2 {
    margin: 0 0 10px;
    color: #b95000;
    font-size: 16px;
}

.restaurant-card {
    min-width: 0;
    flex: 0 1 435px;
    min-height: 228px;
    padding: 7px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.restaurant-photo {
    display: flex;
    height: 110px;
    align-items: center;
    padding: 9px;
    border: 1px dashed #ead8c7;
    background: #f3e5d7;
    color: #9b7b61;
    font-size: 10px;
}

.favorite-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.favorite-icon {
    display: block;
    width: 20px;
    height: 20px;
    overflow: visible;
    color: #c76b08;
}

.favorite-icon.is-filled path {
    fill: currentColor;
}

.favorite-icon.is-outline path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.restaurant-card h2 {
    overflow: hidden;
    margin: 9px 2px 3px;
    color: #b95000;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restaurant-tags,
.restaurant-meta {
    overflow: hidden;
    margin: 0 2px 4px;
    color: #8b7058;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restaurant-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
}

.restaurant-menu-form {
    display: flex;
    flex: 1 1 100px;
}

.restaurant-menu-link {
    display: flex;
    flex: 1 1 100px;
    align-items: center;
    text-decoration: none;
}

.restaurant-detail-page {
    max-width: 960px;
}

.restaurant-back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: #9b4b14;
    font-size: 12px;
}

.restaurant-detail,
.restaurant-detail-menu,
.restaurant-opening-hours {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.restaurant-detail h1,
.restaurant-detail-menu h2,
.restaurant-opening-hours h2,
.restaurant-reviews h2 {
    margin: 0 0 10px;
    color: #b95000;
}

.restaurant-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.restaurant-detail-heading h1 {
    margin-bottom: 0;
}

.restaurant-detail-heading form {
    margin: 0;
}

.restaurant-detail-tags {
    margin: 0 0 14px;
    color: #8b7058;
    font-size: 12px;
}

.restaurant-detail-info {
    display: grid;
    grid-template-columns: minmax(100px, 150px) 1fr;
    gap: 8px 12px;
    margin: 0;
    font-size: 12px;
}

.restaurant-detail-info dt {
    color: #8b7058;
    font-weight: 700;
}

.restaurant-detail-info dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.restaurant-menu-items {
    display: grid;
    gap: 8px;
}

.restaurant-menu-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 72px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #ead8c7;
}

.restaurant-menu-item h3,
.restaurant-menu-item p {
    margin: 0;
}

.restaurant-menu-item h3 {
    color: #51331e;
    font-size: 13px;
}

.restaurant-menu-item p,
.restaurant-menu-item label {
    color: #8b7058;
    font-size: 11px;
}

.restaurant-menu-item input {
    width: 72px;
    height: 30px;
    padding: 4px 6px;
    border: 1px solid #ead5c2;
    background: #fffdfa;
    color: #51331e;
    font: 12px Arial, sans-serif;
}

.restaurant-order-totals {
    max-width: 360px;
    margin: 14px 0 0 auto;
    padding-top: 8px;
    border-top: 1px solid #ead8c7;
    color: #765a42;
    font-size: 12px;
}

.restaurant-order-totals p {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 5px 0;
}

.restaurant-place-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 36px;
    margin-top: 14px;
    padding: 8px 14px;
    text-decoration: none;
    cursor: pointer;
}
.restaurant-schedule-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #765a42;
    min-width: 160px;
    min-height: 36px;
    margin-top: 14px;
    padding: 8px 14px;
    text-decoration: none;
    cursor: pointer;
}

.restaurant-schedule {
    margin-left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.restaurant-order-submission button {
    align-self: center;
    width: auto;
    flex: 0 0 auto;
}
.restaurant-order-submission {
    display: flex;
    align-items: center;
    gap: 15px;
}

.restaurant-order-submission p{
    margin: 1px;
}

@media (max-width: 700px){
    .restaurant-schedule, .restaurant-order-submission {
        display: inline;
    }
}

.restaurant-opening-hours ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 18px;
    margin: 0;
    padding-left: 18px;
    color: #765a42;
    font-size: 12px;
}

.restaurant-reviews {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #ead8c7;
    background: #fffdfa;
}

.restaurant-average-rating {
    margin: 0 0 8px;
    color: #9b4b14;
    font-size: 13px;
    font-weight: 700;
}

.restaurant-review-card {
    padding: 12px 0;
    border-bottom: 1px solid #ead8c7;
    color: #765a42;
    font-size: 12px;
}

.restaurant-review-card:last-child {
    border-bottom: 0;
}

.restaurant-review-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #9b4b14;
}

.restaurant-review-card p {
    margin: 7px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.restaurant-review-card time,
.restaurant-reviews-empty {
    color: #9b7b61;
    font-size: 11px;
}

@media (max-width: 520px) {
    .restaurant-detail,
    .restaurant-detail-menu,
    .restaurant-opening-hours {
        padding: 13px;
    }

    .restaurant-menu-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .restaurant-menu-item label {
        grid-column: 1;
    }

    .restaurant-menu-item input {
        grid-column: 2;
        grid-row: 2;
    }
}

.restaurant-favorite-form {
    display: flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
}

.card-action {
    min-width: 0;
    height: 23px;
    padding: 3px 7px;
    border: 1px solid #ead5c2;
    font: 9px Arial, sans-serif;
    text-align: left;
    white-space: nowrap;
}

.primary-action {
    flex: 1 1 100px;
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.secondary-action {
    flex: 1 1 80px;
    background: #f3e5d7;
    color: #8b7058;
}

.restaurant-actions > button:disabled {
    flex: 1 1 100px;
    cursor: default;
    opacity: 1;
}

/* Hamburger menu in the header */
.menu {
    position: relative;
}

.menu summary {
    list-style: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.menu summary::-webkit-details-marker {
    display: none;
}

.menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1;
    min-width: 120px;
    padding: 4px;
    border: 1px solid #ead5c2;
    background: #fffdfa;
}

.menu-panel button {
    width: 100%;
    padding: 5px 7px;
    border: 0;
    background: none;
    color: #51331e;
    font-size: 10px;
    text-align: left;
    cursor: pointer;
}

.menu-panel a,
.header-link {
    display: block;
    padding: 5px 7px;
    color: #51331e;
    font-size: 11px;
    text-align: left;
}

header .header-link {
    color: #51331e;
    text-decoration: none;
}

header .header-link:hover {
    background: #f3e5d7;
}

.menu-panel button:hover {
    background: #f3e5d7;
}

.field input:disabled,
.submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

@media (max-width: 360px) {
    main {
        width: min(100% - 28px, 300px);
    }
}

@media (max-width: 480px) {
    .customer-page main {
        width: calc(100% - 28px);
        margin-right: 14px;
        margin-left: 14px;
    }

    .restaurant-card {
        flex-basis: 100%;
    }
}


/* ---------- Courier dashboard ---------- */

.courier-page main.courier-dashboard {
    width: min(100% - 32px, 960px);
    margin: 24px auto 48px;
}

.courier-dashboard h1 {
    margin: 0 0 4px;
    font-size: 20px;
}

.courier-section {
    margin-top: 28px;
}

.courier-section h2 {
    margin: 0 0 12px;
    color: #b95000;
    font-size: 15px;
}

.courier-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #ead8c7;
    border-left: 4px solid #b9a08a;
    border-radius: 8px;
    background: #fffdfa;
}

.courier-status--available {
    border-left-color: #2f8a4c;
}

.courier-status--busy {
    border-left-color: #d08a00;
}

.courier-status-text p {
    margin: 0;
    color: #8b7058;
    font-size: 13px;
}

.availability-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    padding: 9px 16px;
    border: 1px solid #d9c3ae;
    border-radius: 999px;
    background: #f3e5d7;
    color: #765a42;
    font: 700 13px Arial, sans-serif;
    cursor: pointer;
}

.availability-button:hover:not(:disabled) {
    filter: brightness(0.96);
}

.availability-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #b9a08a;
}

.availability-button--available {
    border-color: #2f8a4c;
    background: #e5f4e9;
    color: #1f6b38;
}

.availability-button--available .availability-dot {
    background: #2f8a4c;
}

.availability-button--busy {
    border-color: #d08a00;
    background: #fdf1d8;
    color: #8a5a00;
    cursor: not-allowed;
}

.availability-button--busy .availability-dot {
    background: #d08a00;
}

.courier-messages {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.courier-messages .message {
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #ead8c7;
    border-radius: 6px;
    background: #fffdfa;
    font-size: 13px;
}

.courier-messages .message.success {
    border-color: #b7dcc1;
    background: #eef8f1;
    color: #1f6b38;
}

.courier-messages .message.error {
    border-color: #efc2b9;
    background: #fdeeeb;
    color: #a33120;
}

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

.delivery-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #ead8c7;
    border-radius: 8px;
    background: #fffdfa;
}

.delivery-card--active {
    border-color: #e0b38c;
    background: #fff6ec;
}

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

.delivery-card h3 {
    margin: 0;
    font-size: 15px;
}

.delivery-fee {
    color: #b95000;
    font-weight: 700;
    white-space: nowrap;
}

.delivery-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: #b95000;
    color: white;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.delivery-route {
    display: grid;
    gap: 6px;
    margin: 0;
}

.delivery-route div {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
}

.delivery-route dt {
    color: #8b7058;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-top: 2px;
}

.delivery-route dd {
    margin: 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.delivery-meta {
    margin: 0;
    color: #8b7058;
    font-size: 12px;
}

.delivery-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.delivery-actions form {
    flex: 1;
}

.courier-button {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #ead5c2;
    border-radius: 6px;
    font: 700 13px Arial, sans-serif;
    cursor: pointer;
}

.courier-button:hover {
    filter: brightness(0.95);
}

.courier-button:focus-visible,
.availability-button:focus-visible {
    outline: 2px solid #b95000;
    outline-offset: 2px;
}

.courier-button--primary {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.courier-button--secondary {
    background: #f3e5d7;
    color: #765a42;
}

.courier-button--danger {
    border-color: #efc2b9;
    background: #fdeeeb;
    color: #a33120;
}

.courier-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed #e2cdb9;
    border-radius: 8px;
    color: #8b7058;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 480px) {
    .courier-page header {
        padding: 8px 16px;
    }

    .courier-page main.courier-dashboard {
        width: calc(100% - 32px);
        margin-top: 16px;
    }

    .courier-status form,
    .availability-button {
        width: 100%;
        justify-content: center;
    }

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

/* Courier location (FR-4.4) */

.courier-location {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 14px;
    border: 1px solid #ead8c7;
    border-radius: 8px;
    background: #fffdfa;
}

.courier-location p {
    margin: 0;
    color: #765a42;
    font-size: 13px;
}

.courier-location .courier-button {
    width: auto;
    min-height: 32px;
    padding: 6px 12px;
}

.delivery-distance {
    display: block;
    color: #b95000;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .courier-location .courier-button {
        width: 100%;
    }
}

.courier-location-address {
    display: block;
    color: #51331e;
    font-size: 14px;
}

.courier-location-detail {
    display: block;
    margin-top: 2px;
    font-size: 12px;
}

.courier-far-orders {
    margin: 12px 0 0;
    color: #8b7058;
    font-size: 12px;
    text-align: center;
}

/* Restaurant photo (card, banner and settings preview) */

.restaurant-photo {
    position: relative;
    overflow: hidden;
}

.restaurant-photo--has-image {
    padding: 0;
    border-style: solid;
}

.restaurant-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-photo--banner {
    height: 220px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .restaurant-photo--banner {
        height: 150px;
    }
}

.photo-editor {
    min-height: 0;
    margin-top: 36px;
}

.photo-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.photo-editor-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
}

.photo-editor-form input[type="url"] {
    width: 100%;
    height: 34px;
    padding: 6px 8px;
    border: 1px solid #ead5c2;
    background: white;
    color: #51331e;
    font: 13px Arial, sans-serif;
}

.photo-editor-hint {
    margin: 6px 0 0;
    color: #8b7058;
    font-size: 11px;
}

.photo-remove-button {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #a33120;
    font: 12px Arial, sans-serif;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 700px) {
    .photo-editor {
        margin-top: 18px;
    }

    .photo-editor-layout {
        grid-template-columns: 1fr;
    }
}

.photo-editor-form input[type="url"].has-error {
    border-color: #a33120;
    background: #fdeeeb;
}

.photo-editor-form input[type="url"].has-error:focus {
    outline: 2px solid #a33120;
    outline-offset: 1px;
}

.photo-editor-error {
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid #efc2b9;
    border-left: 4px solid #a33120;
    background: #fdeeeb;
    color: #a33120;
    font-size: 12px;
}

.photo-editor-success {
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid #b7dcc1;
    border-left: 4px solid #2f8a4c;
    background: #eef8f1;
    color: #1f6b38;
    font-size: 12px;
    font-weight: 700;
}

/* Customer restaurant map (FR-2.3) */

.customer-page main.map-page {
    width: min(100% - 32px, 1200px);
    margin: 24px auto 48px;
}

/* Only the page the customer is on is orange in the menu. */
header .header-link.is-current {
    color: #b95000;
    font-weight: 700;
}

.map-search {
    display: flex;
    max-width: 700px;
    border: 1px solid #ead5c2;
    background: #fffdfa;
}

.map-search input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: #51331e;
    font: 13px Arial, sans-serif;
}

.map-search button {
    width: 40px;
    border: 0;
    background: transparent;
    color: #b95000;
    cursor: pointer;
}

.map-search button svg {
    width: 20px;
    height: 20px;
}

.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.map-filter {
    display: inline-flex;
    border: 1px solid #ead5c2;
}

.map-filter-button {
    min-width: 90px;
    padding: 7px 14px;
    border: 0;
    background: #fffdfa;
    color: #765a42;
    font: 700 12px Arial, sans-serif;
    cursor: pointer;
}

.map-filter-button + .map-filter-button {
    border-left: 1px solid #ead5c2;
}

.map-filter-button[aria-pressed="true"] {
    background: #b95000;
    color: white;
}

.map-location-button {
    padding: 7px 12px;
    border: 1px solid #ead5c2;
    background: #f3e5d7;
    color: #765a42;
    font: 12px Arial, sans-serif;
    cursor: pointer;
}

.map-filter-button:focus-visible,
.map-location-button:focus-visible,
.map-search button:focus-visible {
    outline: 2px solid #b95000;
    outline-offset: 2px;
}

.map-status {
    margin: 10px 0;
    color: #765a42;
    font-size: 12px;
}

.map-status.is-error {
    color: #a33120;
    font-weight: 700;
}

.restaurant-map {
    height: min(65vh, 560px);
    min-height: 320px;
    border: 1px solid #ead8c7;
    background: #f3e5d7;
}

/* Leaflet markers are SVG paths; style them with the site colours. */
/* Strong colours with a white outline: the brand orange blends in with
   OpenStreetMap's orange roads and beige buildings. */
.map-restaurant-marker {
    fill: #d62828;
    fill-opacity: 1;
    stroke: #ffffff;
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.map-restaurant-marker.is-closed {
    fill: #4f5d6b;
}

.map-you-marker {
    fill: none;
    stroke: #51331e;
    stroke-width: 3;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.map-you-centre {
    fill: #51331e;
    fill-opacity: 1;
    stroke: #ffffff;
    stroke-width: 1;
}

.leaflet-tooltip.map-you-label {
    padding: 1px 6px;
    border: 0;
    border-radius: 999px;
    background: #51331e;
    color: white;
    font: 700 11px Arial, sans-serif;
    box-shadow: none;
}

.leaflet-tooltip.map-you-label::before {
    border-top-color: #51331e;
}

.map-radius {
    fill: #b95000;
    fill-opacity: 0.06;
    stroke: #b95000;
    stroke-opacity: 0.5;
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

@media (max-width: 480px) {
    .customer-page main.map-page {
        margin-top: 16px;
    }

    .restaurant-map {
        height: 60vh;
    }
}

/* Restaurant popup on the map (FR-2.5), styled like the mockup. */

.map-restaurant-popup .leaflet-popup-content-wrapper {
    border: 1px solid #ead8c7;
    border-radius: 0;
    background: #fffdfa;
    box-shadow: 0 2px 8px rgba(81, 51, 30, 0.2);
}

.map-restaurant-popup .leaflet-popup-content {
    margin: 10px 14px 12px;
    font: 12px Arial, sans-serif;
}

.map-popup-name {
    margin: 0 18px 4px 0;
    color: #b95000;
    font-size: 14px;
}

.map-popup p {
    margin: 0 0 2px;
    color: #765a42;
}

.map-popup-status {
    font-weight: 700;
    color: #1f6b38 !important;
}

.map-popup-status.is-closed {
    color: #4f5d6b !important;
}

.map-popup-link {
    display: inline-block;
    margin-top: 14px;
    color: #b95000 !important;
    font-weight: 700;
}

/* ---------- Responsive fixes (NFR-7.3): usable from 360 to 1920 px ---------- */

/* Hamburger menu: a 40 px tap target and roomier links. */
.menu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    font-size: 22px;
}

.menu-panel {
    min-width: 170px;
}

.menu-panel a,
.menu-panel button {
    padding: 9px 10px;
    font-size: 13px;
}

/* Restaurant list: cards fill the row evenly, 1 column on phones up to
   4 on wide screens. */
.restaurant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: stretch;
}

.restaurant-card {
    display: flex;
    flex-direction: column;
}

.restaurant-card .restaurant-actions {
    margin-top: auto;
}

.restaurant-card h2 {
    font-size: 14px;
}

.restaurant-tags,
.restaurant-meta {
    font-size: 12px;
}

/* "Delivering to" bar: site font, and the field wraps under the label on
   narrow screens instead of squeezing the button. */
.delivery-location form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.delivery-location label {
    font-size: 12px;
}

.delivery-location input {
    flex: 0 1 420px;
    min-width: 0;
    height: 32px;
    padding: 5px 8px;
    border: 1px solid #ead5c2;
    background: white;
    color: #51331e;
    font: 13px Arial, sans-serif;
}

.delivery-location button {
    height: 32px;
    padding: 5px 14px;
    border: 1px solid #b95000;
    background: #b95000;
    color: white;
    font: 700 12px Arial, sans-serif;
    cursor: pointer;
}

@media (max-width: 480px) {
    header {
        padding: 8px 16px;
    }

    /* Settings: room for the longest day name and for dish names. The
       table uses fixed layout, so widths come from the header row. */
    .hours-table th:first-child,
    .hours-table td:first-child {
        width: 46%;
    }

    .hours-table .hours-separator {
        width: 16px;
    }

    .settings-table th,
    .settings-table td {
        padding-left: 4px;
        padding-right: 4px;
    }

    .menu-table th:first-child {
        width: 46%;
    }

    .menu-table th:nth-child(2) {
        width: 30%;
    }

    .menu-table th:last-child {
        width: 24%;
    }
}

/* Order history: each order becomes a stacked card on narrow screens
   instead of a 9-column table that has to be scrolled sideways. */
@media (max-width: 700px) {
    .customer-orders-page main {
        width: calc(100% - 32px);
        margin: 24px 16px 48px;
    }

    .order-history-table {
        min-width: 0;
        background: none;
    }

    .order-history-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .order-history-table,
    .order-history-table tbody,
    .order-history-table tr,
    .order-history-table td {
        display: block;
    }

    .order-history-table tr {
        margin-bottom: 10px;
        border: 1px solid #ead8c7;
        background: #fffdfa;
    }

    .order-history-table td {
        display: grid;
        grid-template-columns: 9.5em 1fr;
        gap: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .order-history-table td::before {
        content: attr(data-label);
        color: #b95000;
        font-weight: 700;
    }

    .order-history-table .order-history-empty td {
        display: block;
    }

    .order-history-table .order-history-empty td::before {
        content: none;
    }
}

/* Keep Leaflet's internal layers (z-index up to 1000) inside the map, so the
   hamburger menu opens above the map instead of under it. */
.restaurant-map {
    position: relative;
    z-index: 0;
}

.menu-panel {
    z-index: 20;
}

/* Order buttons and schedule field on the restaurant page: same fonts,
   borders and field style as the rest of the site. */
.restaurant-order-submission {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 28px;
    margin-top: 16px;
}

.restaurant-schedule {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-left: 0;
}

.restaurant-schedule-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.restaurant-schedule-field label {
    color: #8b7058;
    font-size: 12px;
    font-weight: 700;
}

.restaurant-schedule-field input[type="datetime-local"] {
    height: 36px;
    padding: 5px 8px;
    border: 1px solid #ead5c2;
    border-radius: 0;
    background: white;
    color: #51331e;
    font: 13px Arial, sans-serif;
}

.restaurant-schedule-field input[type="datetime-local"]:focus-visible,
.restaurant-place-order:focus-visible {
    outline: 2px solid #b95000;
    outline-offset: 2px;
}

.restaurant-order-submission .restaurant-place-order {
    /* Line up with the bottom of the date field. */
    align-self: flex-end;
    height: 36px;
    min-width: 150px;
    min-height: 36px;
    margin-top: 0;
    padding: 8px 16px;
    border: 1px solid #ead5c2;
    border-radius: 0;
    font: 700 13px Arial, sans-serif;
    cursor: pointer;
}

.restaurant-order-submission .primary-action {
    border-color: #b95000;
    background: #b95000;
    color: white;
}

.restaurant-order-submission .secondary-action {
    background: #f3e5d7;
    color: #765a42;
}

.restaurant-schedule-error {
    flex-basis: 100%;
    margin: 0;
    color: #a33120;
    font-size: 12px;
    font-weight: 700;
}

.restaurant-schedule-error:empty {
    display: none;
}

@media (max-width: 700px) {
    .restaurant-order-submission,
    .restaurant-schedule {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .restaurant-schedule {
        padding-top: 12px;
        border-top: 1px solid #ead8c7;
    }

    .restaurant-schedule-field input[type="datetime-local"] {
        width: 100%;
    }

    .restaurant-order-submission .restaurant-place-order {
        align-self: stretch;
        width: 100%;
    }
}

/* "Schedule for later" panel next to the Place order button. */
.restaurant-order-submission {
    align-items: flex-start;
}

.restaurant-order-submission > .restaurant-place-order {
    align-self: flex-start;
    margin-top: 2px;
}

.restaurant-schedule {
    display: grid;
    flex: 1 1 340px;
    align-content: start;
    align-self: flex-start;
    gap: 12px;
    max-width: 480px;
    padding: 14px 16px;
    border: 1px solid #ead8c7;
    border-left: 4px solid #b95000;
    background: #fbf3ea;
}

.restaurant-schedule-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #b95000;
}

.restaurant-schedule-heading svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

.restaurant-schedule-heading h3 {
    margin: 0;
    color: #b95000;
    font-size: 14px;
}

.restaurant-schedule-heading p {
    margin: 2px 0 0;
    color: #8b7058;
    font-size: 12px;
}

.restaurant-schedule-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.restaurant-schedule-row .restaurant-schedule-field {
    flex: 1 1 200px;
}

.restaurant-schedule-row .restaurant-schedule-field input[type="datetime-local"] {
    width: 100%;
}

.restaurant-schedule-row .restaurant-place-order {
    background: white;
    border-color: #b95000;
    color: #b95000;
}

.restaurant-schedule-row .restaurant-place-order:hover {
    background: #b95000;
    color: white;
}

@media (max-width: 700px) {
    .restaurant-order-submission .restaurant-schedule {
        display: grid;
        flex: none;
        align-self: stretch;
        width: 100%;
        max-width: none;
        padding-top: 14px;
        border-top: 1px solid #ead8c7;
    }

    .restaurant-schedule-row {
        flex-direction: column;
        align-items: stretch;
    }

    .restaurant-schedule-row .restaurant-schedule-field {
        flex-basis: auto;
    }
}

/* Checkout column: totals, Place order and Schedule for later stacked in one
   column on the right, so the actions sit directly under the total. */
.restaurant-order-totals {
    max-width: 400px;
}

.restaurant-order-total {
    color: #51331e;
    font-size: 14px;
}

.restaurant-order-submission {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    max-width: 400px;
    margin: 16px 0 0 auto;
}

.restaurant-order-submission > .restaurant-place-order {
    align-self: stretch;
    width: 100%;
    height: 44px;
    margin-top: 0;
    font-size: 14px;
}

.restaurant-order-submission .restaurant-schedule {
    flex: none;
    align-self: stretch;
    width: 100%;
    max-width: none;
}

.restaurant-order-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9b7b61;
    font-size: 12px;
}

.restaurant-order-divider::before,
.restaurant-order-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #ead8c7;
}

.restaurant-schedule-row .restaurant-schedule-field {
    flex: 1 1 170px;
}

.restaurant-schedule-row .restaurant-place-order {
    min-width: 130px;
}

@media (max-width: 700px) {
    .restaurant-order-totals,
    .restaurant-order-submission {
        max-width: none;
        margin-left: 0;
    }

    .restaurant-order-submission .restaurant-schedule {
        padding-top: 14px;
    }

    /* The row stacks vertically here, so a flex-basis would become a height. */
    .restaurant-schedule-row .restaurant-schedule-field {
        flex: none;
    }
}

/* Shared text styles, so every page uses the same look instead of the
   browser's default 16 px text. */

/* Django messages: banners coloured by type (success, error, ...). */
.message {
    margin: 10px 0;
    padding: 10px 14px;
    border: 1px solid #ead8c7;
    border-left: 4px solid #b9a08a;
    background: #fffdfa;
    color: #51331e;
    font-size: 13px;
}

.message.success {
    border-color: #b7dcc1;
    border-left-color: #2f8a4c;
    background: #eef8f1;
    color: #1f6b38;
}

.message.error {
    border-color: #efc2b9;
    border-left-color: #a33120;
    background: #fdeeeb;
    color: #a33120;
}

.message.warning {
    border-color: #f1d9a6;
    border-left-color: #d08a00;
    background: #fdf6e6;
    color: #8a5a00;
}

/* The message under the "Delivering to" field sits inside that bar. */
.delivery-location .message {
    margin: 8px 0 0;
}

/* "Nothing here yet" texts: muted and the same size on every page. */
.empty-state {
    margin: 0;
    padding: 16px;
    border: 1px dashed #e2cdb9;
    color: #8b7058;
    font-size: 13px;
    text-align: center;
}
