/* Merchant menu tools: a single-column workspace for one decision at a time. */
.mi-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 32px 20px 64px;
    overflow-wrap: anywhere;
}
.mi-shell [hidden] {
    display: none !important;
}
.mi-back, .mi-return, .mi-discard {
    display: block;
    margin: 18px 0;
}
.mi-head h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 5vw, 54px);
}
.mi-head {
    margin: 30px 0;
}
.mi-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    list-style: none;
    gap: 4px;
    margin: 24px 0;
    padding: 0;
}
.mi-steps li {
    padding: 8px 3px;
    color: #526459;
    border-bottom: 2px solid var(--line);
    font-size: 13px;
}
.mi-steps b {
    margin-right: 3px;
}
.mi-steps li[aria-current] {
    border-color: var(--ink);
    color: var(--ink);
    font-weight: 700;
}
.mi-panel, .mi-item, .mi-cat, .mi-source {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(16px, 3vw, 26px);
    margin: 12px 0;
}
.mi-start > svg {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.6;
}
.mi-start {
    border-top: 3px solid var(--ink);
}
/* The existing pending-page refresh owns completion; animation only communicates activity. */
.mi-processing {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0;
}

.mi-processing h2 {
    margin: 0;
}

.mi-spinner {
    display: inline-block;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mi-processing-spin .85s linear infinite;
}

@keyframes mi-processing-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mi-spinner {
        animation: none;
    }
}

.mi-shell h2 {
    font-size: clamp(23px, 3vw, 32px);
}
.mi-shell h3 {
    font-size: 20px;
    margin: 4px 0 14px;
}
.mi-subtitle {
    margin-top: 26px;
}
.mi-shell summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}
.mi-shell details[open] > summary {
    margin-bottom: 12px;
}
.mi-alert, .mi-ok {
    border-radius: 8px;
    padding: 14px 16px;
}
.mi-alert, .mi-flag {
    background: #fff1d4;
    color: #694210;
}
.mi-ok {
    background: #e4eedf;
}
.mi-flag {
    display: inline-block;
    border-radius: 6px;
    font-size: 13px;
    padding: 3px 9px;
    margin: 4px 0;
}
.mi-preview, .mi-source img {
    max-width: 100%;
    max-height: 55vh;
    display: block;
    margin: 12px auto;
    object-fit: contain;
}
.mi-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.mi-item-head, .mi-summary li, .mi-resume, .mi-actions, .menu-entry {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.mi-summary {
    list-style: none;
    padding: 0;
}
.mi-summary li, .mi-resume {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.mi-summary small, .mi-meta {
    display: block;
    color: #526459;
}
.mi-quote {
    border-left: 3px solid var(--line);
    padding-left: 12px;
}
.mi-check, .mi-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
    margin: 0;
    font-size: 14px;
}
.mi-discard {
    font-size: 13px;
}
.menu-entry {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
@media (max-width: 520px) {
    .mi-shell {
        padding: 12px 16px 44px;
    }
    .mi-steps li {
        font-size: 11px;
    }
    .mi-steps b {
        display: block;
    }
    .mi-shell .button {
        width: 100%;
    }
    .mi-head {
        margin: 20px 0;
    }
}

/* The fully transparent input receives native taps and keyboard focus over the branded control. */
.mp-panel {
    border-top: 3px solid var(--ink);
    padding: clamp(20px, 4vw, 34px);
}
.mp-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.mp-heading h2 {
    margin-bottom: 6px;
}
.mp-heading p {
    margin-bottom: 0;
}
.mp-camera-mark {
    position: relative;
    display: grid;
    flex: 0 0 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: var(--ink);
    background: #e9efe5;
}
.mp-camera-mark::after {
    position: absolute;
    top: 8px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}
.mp-actions {
    display: grid;
    gap: 14px;
    margin: 22px 0 16px;
}
.mp-picker {
    position: relative;
    overflow: hidden;
    gap: 10px;
    min-height: 48px;
    margin: 0;
}
.mp-picker input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.mp-picker:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
.mp-camera-form small, .mp-footnote {
    display: block;
    margin: 5px 0;
    color: #526459;
    font-size: 13px;
}
.mp-footnote:last-child {
    margin-bottom: 0;
}
.mp-mobile-text, .mp-touch .mp-desktop-text {
    display: none;
}
.mp-touch .mp-mobile-text {
    display: inline;
}
.mp-touch .mp-library {
    color: var(--ink);
    border-color: #b5c4b7;
    background: var(--surface);
}
.mp-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.mp-preview img {
    max-width: 112px;
    max-height: 120px;
    object-fit: contain;
}
.mp-status:empty {
    margin: 0;
}
.mp-analyse {
    margin-top: 8px;
}
.mp-panel[aria-busy=true] .mp-actions {
    opacity: .65;
    pointer-events: none;
}
.fm-editor, .fm-review-format {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 14px 0;
    padding: 14px 0 0;
}
.fm-editor legend {
    font-weight: 700;
}
.mi-summary .fm-summary-card {
    display: block;
}
.fm-table-heading, .fm-gap {
    display: none;
}
.fm-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}
.fm-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.fm-price strong {
    font-variant-numeric: tabular-nums;
}
.fm-price em {
    font-size: 12px;
}
.fm-out strong {
    opacity: .66;
}
.menu-product.fm-multi, .menu-product.fm-aligned {
    display: grid;
    gap: 12px;
}
@media (min-width: 800px) {
    .fm-table-heading, .menu-product.fm-aligned {
        display: grid;
        grid-template-columns: minmax(11rem, 2fr) repeat(var(--fm-n), minmax(0, 1fr));
        align-items: start;
        gap: 12px;
    }
    .fm-table-heading {
        font-size: 13px;
        padding: 8px 0;
    }
    .fm-aligned .fm-prices {
        display: contents;
    }
    .fm-aligned .fm-price small {
        /* Retain the label for assistive technology. */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .fm-aligned .fm-gap {
        display: block;
    }
    .menu-product.fm-multi:not(.fm-aligned) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .fm-multi:not(.fm-aligned) .fm-prices {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    }
}
.fm-kind {
    display: block;
    margin: 2px 0 7px;
}

/* Real worker milestones use the same quiet green surfaces as the merchant dashboard. */
.mi-progress-panel {
    max-width: 760px;
}
.mi-progress-intro {
    color: var(--muted, #6f7c71);
    margin: 16px 0 24px;
}
.mi-progress-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}
.mi-progress-list li {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 16px;
    border-radius: 16px;
    color: var(--muted, #6f7c71);
}
.mi-progress-list li + li {
    margin-top: 8px;
}
.mi-progress-list h3 {
    font-family: inherit;
    font-size: 18px;
    font-weight: 650;
    margin: 1px 0 5px;
    line-height: 1.4;
}
.mi-progress-list p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}
.mi-progress-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 36px;
    height: 36px;
    border: 1px solid var(--line, #dfe4d8);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}
.mi-progress-check {
    display: none;
}
.mi-progress-list .is-active {
    color: var(--ink, #173e32);
    background: #edf2e7;
}
.mi-progress-list .is-active .mi-progress-mark {
    border-color: transparent;
}
.mi-progress-list .is-active .mi-progress-mark::after {
    content: '';
    position: absolute;
    inset: -1px;
    border: 2px solid #d6e1ca;
    border-top-color: #173e32;
    border-radius: 50%;
    animation: mi-processing-spin 1.1s linear infinite;
}
.mi-progress-list .is-complete .mi-progress-mark {
    color: #fff;
    border-color: #173e32;
    background: #173e32;
}
.mi-progress-list .is-complete .mi-progress-number {
    display: none;
}
.mi-progress-list .is-complete .mi-progress-check {
    display: inline;
}
.mi-description {
    margin-top: 16px;
}
.mi-summary-description {
    margin: 8px 0 14px;
    font-size: 15px;
    line-height: 1.5;
}
@media (max-width: 540px) {
    .mi-progress-list li {
        gap: 12px;
        padding: 16px 10px;
    }
    .mi-progress-list h3 {
        font-size: 16px;
    }
    .mi-progress-list p {
        font-size: 14px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .mi-progress-list .is-active .mi-progress-mark::after {
        animation: none;
    }
}
