:root {
  --mk-bg: #f0f4f8;
  --mk-surface: #fff;
  --mk-text: #1e293b;
  --mk-muted: #55657a;
  --mk-faint: #64748b;
  --mk-border: #e4e8ef;
  --mk-soft: #eef1f5;
  --mk-primary: #2563eb;
  --mk-primary-dark: #1d4ed8;
  --mk-primary-soft: #eff6ff;
  --mk-success: #16825d;
  --mk-success-soft: #ecfdf5;
  --mk-warning: #b45309;
  --mk-warning-soft: #fff7ed;
  --mk-danger: #c2414c;
  --mk-danger-soft: #fff1f2;
  --mk-shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 8px 24px rgb(15 23 42 / 5.5%);
  --mk-radius: 14px;
}

body.mk-app,
body.mk-login-page {
  margin: 0;
  color: var(--mk-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.mk-app { background: var(--mk-bg); }
body.mk-login-page { background: #fff; }
.mk-app button,
.mk-app input,
.mk-login-page button,
.mk-login-page input { font: inherit; }
.mk-app a,
.mk-login-page a { color: inherit; text-decoration: none; }
.mk-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.mk-icon--sm { width: 15px; height: 15px; }
.mk-skip-link { z-index: 100; border-radius: 7px; color: var(--mk-text); }
.mk-skip-link:focus { top: 10px; }

/* Shared tenant shell */
.mk-shell { min-height: 100vh; min-height: 100dvh; padding-left: 248px; }
.mk-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: 248px; flex-direction: column; border-right: 1px solid var(--mk-border); background: #fff; transition: transform .2s ease; }
.mk-brand { display: flex; height: 70px; align-items: center; gap: 11px; padding: 0 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-brand__mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--mk-primary); color: #fff; box-shadow: 0 2px 6px rgb(15 23 42 / 16%); font-size: 16px; font-weight: 800; line-height: 1; }
.mk-brand__name { display: block; font-size: 17px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; }
.mk-brand__tag { display: block; margin-top: 4px; color: var(--mk-faint); font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace; font-size: 9px; font-weight: 650; line-height: 1; letter-spacing: .07em; text-transform: uppercase; }
.mk-nav { flex: 1; padding: 22px 12px; }
.mk-nav__label { padding: 0 12px 8px; color: var(--mk-faint); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .1em; text-transform: uppercase; }
.mk-nav__item { position: relative; display: flex; height: 42px; align-items: center; gap: 12px; margin: 2px 0; padding: 0 12px; border-radius: 8px; color: #536176; font-size: 13px; font-weight: 550; }
.mk-nav__item:hover { background: #f8fafc; color: var(--mk-text); }
.mk-nav__item.is-active { background: var(--mk-primary-soft); color: var(--mk-primary); font-weight: 700; }
.mk-nav__item.is-active::before { position: absolute; top: 9px; left: -12px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--mk-primary); content: ""; }
.mk-workspace { margin: 12px; padding: 13px; border: 1px solid var(--mk-border); border-radius: 10px; background: #fbfcfe; }
.mk-workspace__row { display: flex; min-width: 0; align-items: center; gap: 10px; }
.mk-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #e8eef8; color: #3b4f70; font-size: 11px; font-weight: 750; line-height: 1; }
.mk-workspace__text { min-width: 0; }
.mk-workspace__name { display: block; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mk-workspace__meta { display: block; overflow: hidden; color: var(--mk-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mk-workspace__exit { margin: 0 0 0 auto; }
.mk-workspace__exit button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--mk-faint); cursor: pointer; }
.mk-workspace__exit button:hover { background: var(--mk-soft); color: var(--mk-text); }
.mk-main { min-width: 0; min-height: 100vh; min-height: 100dvh; }
.mk-topbar { position: sticky; top: 0; z-index: 30; display: flex; height: 60px; align-items: center; padding: 0 32px; border-bottom: 1px solid var(--mk-border); background: #fff; }
.mk-menu { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; margin: 0 8px 0 -7px; border: 0; border-radius: 8px; background: transparent; color: var(--mk-muted); cursor: pointer; }
.mk-crumbs { display: flex; align-items: center; gap: 8px; color: var(--mk-muted); font-size: 12px; }
.mk-crumbs b { color: var(--mk-text); font-weight: 650; }
.mk-topbar__end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mk-search { display: flex; width: 260px; height: 36px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--mk-border); border-radius: 8px; background: #f8fafc; color: var(--mk-faint); }
.mk-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--mk-text); font-size: 12px; }
.mk-search input::placeholder { color: var(--mk-faint); }
.mk-userchip { display: flex; height: 36px; align-items: center; gap: 9px; padding: 0 4px 0 8px; }
.mk-userchip__name { font-size: 12px; font-weight: 650; }
.mk-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 42px; }
.mk-backdrop { display: none; }

/* Shared work surfaces */
.mk-kicker { color: var(--mk-faint); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: .09em; text-transform: uppercase; }
.mk-title { margin: 5px 0 0; color: var(--mk-text); font-size: 30px; font-weight: 720; line-height: 1.16; letter-spacing: -.026em; }
.mk-subtitle { margin: 6px 0 0; color: var(--mk-muted); font-size: 13px; }
.mk-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.mk-button { display: inline-flex; height: 36px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid var(--mk-border); border-radius: 8px; background: #fff; color: #334155; box-shadow: 0 1px 2px rgb(15 23 42 / 3.5%); font-size: 12px; font-weight: 650; cursor: pointer; }
.mk-button:hover { border-color: #cbd5e1; background: #f8fafc; color: #334155; }
.mk-button--primary { border-color: var(--mk-primary); background: var(--mk-primary); color: #fff; box-shadow: 0 2px 5px rgb(15 23 42 / 15%); }
.mk-button--primary:hover { border-color: var(--mk-primary-dark); background: var(--mk-primary-dark); color: #fff; }
.mk-button[aria-busy="true"] { opacity: .7; pointer-events: none; }
.mk-button:focus-visible,
.mk-order-link:focus-visible,
.mk-nav__item:focus-visible,
.mk-tab:focus-visible,
.mk-search:focus-within,
.mk-work-search:focus-within,
.mk-workspace__exit button:focus-visible,
.mk-menu:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgb(37 99 235 / 17%); }
.mk-summary { display: grid; overflow: hidden; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--mk-border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgb(15 23 42 / 2.5%); }
.mk-summary__item { display: flex; align-items: center; gap: 10px; padding: 11px 17px; border-right: 1px solid var(--mk-soft); }
.mk-summary__item:last-child { border-right: 0; }
.mk-summary__item:hover { background: #f8fafc; }
.mk-summary__item:focus-visible { outline: 2px solid var(--mk-primary); outline-offset: -2px; }
.mk-summary__value { font-size: 19px; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.mk-summary__label { margin-top: 3px; color: var(--mk-muted); font-size: 11px; }
.mk-summary__dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--mk-primary); }
.mk-summary__dot--overdue { background: #e05260; }
.mk-summary__dot--today { background: #f59e0b; }
.mk-summary__dot--work { background: var(--mk-primary); }
.mk-summary__dot--ready { background: #10b981; }
.mk-work-queue { overflow: hidden; border: 1px solid var(--mk-border); border-radius: var(--mk-radius); background: #fff; box-shadow: var(--mk-shadow); }
.mk-work-toolbar { display: flex; min-height: 59px; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--mk-soft); }
.mk-work-search { display: flex; width: 310px; height: 34px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--mk-border); border-radius: 7px; background: #fff; color: var(--mk-faint); }
.mk-work-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--mk-text); font-size: 12px; }
.mk-work-search input::placeholder { color: var(--mk-faint); }
.mk-tabs { display: flex; align-items: center; gap: 3px; }
.mk-tab { display: inline-flex; height: 30px; align-items: center; padding: 0 10px; border-radius: 7px; color: var(--mk-muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.mk-tab:hover { background: #f5f7fa; color: var(--mk-text); }
.mk-tab.is-active { background: #eef2f7; color: var(--mk-text); }
.mk-work-toolbar__link { color: var(--mk-primary); font-size: 11px; font-weight: 700; }
.mk-work-toolbar__link:hover { color: var(--mk-primary-dark); }
.mk-work-toolbar__count { margin-left: auto; color: var(--mk-faint); font-size: 11px; white-space: nowrap; }
.mk-active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 0 16px; border-bottom: 1px solid var(--mk-soft); color: var(--mk-muted); font-size: 12px; }
.mk-active-filter strong { color: var(--mk-text); }
.mk-filter-clear { display: inline-flex; min-height: 44px; align-items: center; color: var(--mk-primary); font-size: 11px; font-weight: 700; }
.mk-filter-clear:hover { text-decoration: underline; text-underline-offset: 3px; }
.mk-filter-clear:focus-visible { outline: 2px solid var(--mk-primary); outline-offset: 2px; border-radius: 4px; }
.mk-tablewrap { overflow-x: auto; }
.mk-orders-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.mk-orders-table th { padding: 10px 14px; border-bottom: 1px solid var(--mk-border); background: #fbfcfe; color: #607086; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: .045em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.mk-orders-table td { min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--mk-soft); color: var(--mk-text); font-size: 12px; vertical-align: middle; }
.mk-orders-table tbody tr:last-child td { border-bottom: 0; }
.mk-orders-table tbody tr:hover { background: #fbfdff; }
.mk-orders-table th:nth-child(1) { width: 21%; }
.mk-orders-table th:nth-child(2) { width: 29%; }
.mk-orders-table th:nth-child(3) { width: 22%; }
.mk-orders-table th:nth-child(4) { width: 13%; }
.mk-orders-table th:nth-child(5) { width: 15%; text-align: right; }
.mk-orders-table--compact th:nth-child(1) { width: 25%; }
.mk-orders-table--compact th:nth-child(2) { width: 36%; }
.mk-orders-table--compact th:nth-child(3) { width: 23%; }
.mk-orders-table--compact th:nth-child(4) { width: 16%; }
.mk-order-row--late { background: #fffafb; }
.mk-order-row[data-order-id] { cursor: pointer; }
.mk-order-row:focus-within { outline: 2px solid var(--mk-primary); outline-offset: -2px; }
.mk-order-row form { cursor: auto; }
.mk-order-link { display: inline-flex; max-width: 100%; min-height: 44px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; border-radius: 6px; outline: 0; }
.mk-order-link:hover .mk-order-number { text-decoration: underline; text-underline-offset: 3px; }
.mk-order-number { display: inline-flex; max-width: 100%; align-items: baseline; gap: .18em; color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; white-space: nowrap; vertical-align: baseline; }
.mk-order-number__sign { flex: 0 0 auto; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
.mk-order-number__value { font-family: ui-monospace, "Cascadia Mono", monospace; font-variant-numeric: tabular-nums; }
.mk-order-link .mk-order-number { color: var(--mk-primary); font-size: 13.5px; font-weight: 800; line-height: 1.3; }
.mk-order-number .mk-icon { width: 13px; height: 13px; opacity: .46; transition: transform .16s ease, opacity .16s ease; }
.mk-order-link:hover .mk-order-number .mk-icon { opacity: .8; transform: translateX(2px); }
.mk-order-customer { overflow: hidden; max-width: 100%; color: var(--mk-text); font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mk-order-phone { color: var(--mk-muted); font-size: 11px; }
.mk-order-item { overflow: hidden; color: var(--mk-text); font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.mk-order-work { overflow: hidden; margin-top: 2px; color: var(--mk-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mk-deadline { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 12.5px; font-weight: 800; line-height: 1.35; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.mk-deadline.is-late { color: var(--mk-danger); }
.mk-deadline.is-ready { color: var(--mk-success); }
.mk-deadline-note,
.mk-deadline-cell .due-hint { display: block; margin-top: 3px; color: var(--mk-muted); font-size: 11px; font-weight: 650; }
.mk-deadline-cell--danger .due-hint { color: var(--mk-danger); }
.mk-deadline-cell--today .due-hint { color: var(--mk-warning); }
.mk-deadline-cell--ready .due-hint { color: var(--mk-success); }
.mk-status { display: inline-flex; min-height: 20px; align-items: center; gap: 6px; color: #475569; font-size: 11px; font-weight: 700; white-space: nowrap; }
.mk-status::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; content: ""; }
.mk-status--in_progress { color: #1d4ed8; }
.mk-status--in_progress::before { background: #3b82f6; }
.mk-status--ready { color: #047857; }
.mk-status--ready::before { background: #10b981; }
.mk-status--paused { color: #9a4d08; }
.mk-status--paused::before { background: #f59e0b; }
.mk-status--issued { color: #52657d; }
.mk-status--issued::before { background: #64748b; }
.mk-status--cancelled { color: #9f3b46; }
.mk-status--cancelled::before { background: #e05260; }
.mk-order-action { text-align: right; }
.mk-order-action form { margin: 0; }
.mk-order-action__button { min-width: 92px; border-color: #bfd2f6; color: var(--mk-primary); box-shadow: none; }
.mk-order-action__button:hover { border-color: #8eb1f5; background: var(--mk-primary-soft); color: var(--mk-primary-dark); }
.mk-order-action__button--strong { border-color: var(--mk-primary); background: var(--mk-primary); color: #fff; box-shadow: 0 2px 5px rgb(15 23 42 / 12%); }
.mk-order-action__button--strong:hover { border-color: var(--mk-primary-dark); background: var(--mk-primary-dark); color: #fff; }
.mk-order-action__button--paused { min-width: 108px; border-color: #e7d4ba; color: #8a480b; }
.mk-order-action__button--paused:hover { border-color: #d4ae7a; background: var(--mk-warning-soft); color: #713b09; }
.mk-no-action { color: #9aa6b6; }
.mk-mobile-label { display: none; }
.mk-orders-page .pagination-bar { margin-top: 20px; }

/* Login */
.mk-login { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(380px, 1fr) minmax(500px, 1fr); background: #fff; }
.mk-login__visual { position: relative; isolation: isolate; display: grid; overflow: hidden; grid-template-rows: auto 1fr auto; padding: 38px 48px; background: #245ed8; color: #fff; }
.mk-login__visual > :not(.mk-login__waves) { position: relative; z-index: 1; }
.mk-login__waves { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.mk-login__waves span { --wave-low: .19; --wave-high: .26; position: absolute; top: 50%; left: 69%; width: 510px; aspect-ratio: 1; border: 1px solid rgb(255 255 255 / 52%); border-radius: 50%; opacity: var(--wave-low); transform: translate(-50%, -50%) scale(.99); animation: mk-login-wave 11s ease-in-out infinite; will-change: transform, opacity; }
.mk-login__waves span:nth-child(2) { --wave-low: .13; --wave-high: .18; width: 700px; animation-duration: 13s; animation-delay: -4s; }
.mk-login__waves span:nth-child(3) { --wave-low: .08; --wave-high: .12; width: 890px; animation-duration: 14s; animation-delay: -8s; }
@keyframes mk-login-wave { 0%, 100% { opacity: var(--wave-low); transform: translate(-50%, -50%) scale(.99); } 50% { opacity: var(--wave-high); transform: translate(-49.65%, -50.35%) scale(1.012); } }
.mk-login__brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 750; line-height: 1; }
.mk-login__brand .mk-brand__mark { background: #fff; color: var(--mk-primary); box-shadow: none; }
.mk-login__message { align-self: center; max-width: 520px; margin: 0; transform: translateY(-6px); }
.mk-login__eyebrow { color: rgb(255 255 255 / 82%); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: .09em; text-transform: uppercase; }
.mk-login__message h1 { max-width: 510px; margin: 13px 0 15px; color: #fff; font-size: 40px; font-weight: 720; line-height: 1.07; letter-spacing: -.035em; text-wrap: balance; }
.mk-login__message p { max-width: 420px; margin: 0; color: rgb(255 255 255 / 74%); font-size: 14px; }
.mk-login__flow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.mk-login__flow span { padding: 7px 10px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 7px; background: rgb(255 255 255 / 5.5%); color: rgb(255 255 255 / 86%); font-size: 11px; font-weight: 650; }
.mk-login__foot { color: rgb(255 255 255 / 48%); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 9px; font-weight: 600; line-height: 1; letter-spacing: .08em; text-transform: uppercase; }
.mk-login__formside { display: flex; align-items: center; justify-content: center; padding: 48px 64px; background: #fff; }
.mk-login__form { width: 100%; max-width: 385px; }
.mk-login__formhead { max-width: 385px; margin: 0 auto 28px; text-align: center; }
.mk-login__formhead h2 { margin: 0 0 8px; color: var(--mk-text); font-size: 29px; font-weight: 720; line-height: 1.15; letter-spacing: -.025em; text-wrap: balance; }
.mk-login__formhead p { max-width: 350px; margin: 0 auto; color: var(--mk-muted); font-size: 13px; text-wrap: pretty; }
.mk-login__field { display: grid; gap: 7px; margin-bottom: 16px; }
.mk-login__field label { color: #475569; font-size: 11px; font-weight: 700; }
.mk-login__input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #d7dee8; border-radius: 8px; outline: 0; background: #fff; color: var(--mk-text); }
.mk-login__input:focus { border-color: #7aa4f8; box-shadow: 0 0 0 3px rgb(37 99 235 / 9%); }
.mk-login__input.is-invalid { border-color: #dc3545; }
.mk-login__field .invalid-feedback { display: block; font-size: 11px; }
.mk-login__submit { width: 100%; height: 45px; margin-top: 5px; font-weight: 700; }
.mk-login__help { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--mk-soft); color: var(--mk-muted); font-size: 11px; text-align: center; }
.mk-login__form > .alert { margin-bottom: 18px; border-radius: 8px; font-size: 12px; }

/* Legacy inner pages remain readable inside the new shell during the transition. */
.mk-app .form-page,
.mk-app .error-page { width: 100%; }
.mk-app .subscription-banner { margin-top: 0; }
.mk-app .app-footer,
.mk-app .workspace-label,
.mk-app .app-header { display: none; }

@media (max-width: 1100px) and (min-width: 721px) {
  .mk-shell { padding-left: 72px; }
  .mk-sidebar { width: 72px; }
  .mk-brand { justify-content: center; padding: 0; }
  .mk-brand__text,
  .mk-nav__label,
  .mk-nav__item span,
  .mk-workspace__text { display: none; }
  .mk-nav { padding: 22px 10px; }
  .mk-nav__item { justify-content: center; padding: 0; }
  .mk-nav__item.is-active::before { left: -10px; }
  .mk-workspace { display: flex; justify-content: center; margin: 10px; padding: 6px; }
  .mk-workspace__row { display: grid; justify-items: center; gap: 4px; }
  .mk-workspace__exit { margin: 0; }
  .mk-content { padding-right: 24px; padding-left: 24px; }
  .mk-topbar { padding: 0 24px; }
  .mk-work-search { width: 280px; }
}

@media (max-width: 720px) {
  body.mk-menu-open { overflow: hidden; }
  .mk-shell { padding-left: 0; }
  .mk-sidebar { width: 280px; transform: translateX(-101%); box-shadow: 20px 0 50px rgb(15 23 42 / 14%); }
  .mk-shell.is-menu-open .mk-sidebar { transform: translateX(0); }
  .mk-backdrop { position: fixed; z-index: 40; inset: 0; border: 0; background: rgb(15 23 42 / 35%); }
  .mk-shell.is-menu-open .mk-backdrop { display: block; }
  .mk-shell.is-menu-open .mk-backdrop:focus { outline: 0; }
  .mk-menu { display: flex; }
  .mk-menu { width: 44px; height: 44px; margin-left: -11px; margin-right: 4px; }
  .mk-topbar { height: 56px; padding: 0 16px; }
  .mk-crumbs span:first-child,
  .mk-userchip__name { display: none; }
  .mk-search { display: none; }
  .mk-content { padding: 20px 16px 32px; }
  .mk-pagehead { align-items: flex-start; margin-bottom: 17px; }
  .mk-title { font-size: 25px; }
  .mk-create-order { width: 44px; height: 44px; padding: 0; }
  .mk-create-order span { display: none; }
  .mk-summary { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
  .mk-summary__item { padding: 10px 13px; }
  .mk-summary__item:nth-child(2) { border-right: 0; }
  .mk-summary__item:nth-child(-n+2) { border-bottom: 1px solid var(--mk-soft); }
  .mk-summary__value { font-size: 18px; }
  .mk-summary__label { font-size: 10px; }
  .mk-work-toolbar { align-items: stretch; flex-wrap: wrap; padding: 12px; }
  .mk-work-search { order: -1; width: 100%; height: 44px; }
  .mk-tabs { width: 100%; overflow-x: auto; }
  .mk-tab { min-width: 44px; height: 44px; }
  .mk-work-toolbar__link { display: inline-flex; min-height: 36px; align-items: center; }
  .mk-work-toolbar__count { display: none; }
  .mk-tablewrap { overflow: visible; }
  .mk-orders-table,
  .mk-orders-table tbody,
  .mk-orders-table tr,
  .mk-orders-table td { display: block; width: 100%; }
  .mk-orders-table { table-layout: auto; }
  .mk-orders-table thead { display: none; }
  .mk-orders-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "identity status" "item item" "deadline action"; column-gap: 12px; row-gap: 10px; padding: 13px 13px 12px; border-bottom: 1px solid var(--mk-border); }
  .mk-orders-table tbody tr:last-child { border-bottom: 0; }
  .mk-orders-table td { position: static; width: auto; margin: 0; padding: 0; border: 0; }
  .mk-orders-table td:nth-child(1) { grid-area: identity; padding-right: 8px; }
  .mk-orders-table td:nth-child(2) { grid-area: item; }
  .mk-orders-table td:nth-child(3) { grid-area: deadline; }
  .mk-orders-table td:nth-child(4) { grid-area: status; align-self: start; justify-self: end; }
  .mk-orders-table td:nth-child(5) { grid-area: action; align-self: end; justify-self: end; }
  .mk-orders-table--compact tbody tr { grid-template-areas: "identity status" "item item" "deadline deadline"; }
  .mk-order-link { gap: 0; }
  .mk-order-link .mk-order-number { font-size: 13px; }
  .mk-order-customer { margin-top: 2px; font-size: 12.5px; }
  .mk-order-phone { font-size: 10.5px; }
  .mk-order-item { font-size: 12.5px; }
  .mk-order-work { font-size: 11px; white-space: normal; }
  .mk-deadline { font-size: 12.5px; }
  .mk-deadline-note { font-size: 10.5px; }
  .mk-status { font-size: 10.5px; }
  .mk-order-action__button { min-width: 98px; height: 44px; padding: 0 13px; }
  .mk-order-action__button--paused { min-width: 118px; }
  .mk-mobile-label { display: block; margin-bottom: 3px; color: var(--mk-faint); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 8px; font-weight: 700; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; }

  .mk-login { display: block; background: #fff; }
  .mk-login__visual { min-height: 278px; grid-template-rows: auto 1fr; padding: 24px; }
  .mk-login__waves span { left: 80%; width: 280px; }
  .mk-login__waves span:nth-child(2) { width: 400px; }
  .mk-login__waves span:nth-child(3) { width: 520px; }
  .mk-login__message { align-self: center; margin: 0; transform: translateY(-8px); }
  .mk-login__message h1 { max-width: 310px; margin-top: 10px; font-size: 28px; line-height: 1.09; }
  .mk-login__message p,
  .mk-login__flow,
  .mk-login__foot { display: none; }
  .mk-login__formside { padding: 30px 24px 34px; }
  .mk-login__formhead { margin-bottom: 26px; }
  .mk-login__formhead h2 { font-size: 26px; }
  .mk-login__input { height: 44px; font-size: 16px; }
  .mk-nav__item { height: 44px; }
  .mk-workspace__exit button { width: 44px; height: 44px; }
}

@media (max-width: 390px) {
  .mk-pagehead__copy .mk-subtitle { display: none; }
}

/* Shared subscription and recovery surfaces. */
.mk-support-page { width: min(620px, 100%); margin: 52px auto; padding: 36px; border: 1px solid var(--mk-border); border-radius: 13px; background: #fff; box-shadow: var(--mk-shadow); text-align: center; }
.mk-support-page__mark { display: grid; width: 40px; height: 40px; place-items: center; margin: 0 auto 16px; border-radius: 10px; background: var(--mk-primary); color: #fff; font-weight: 800; }
.mk-support-page .mk-kicker { margin: 0 0 7px; }
.mk-support-page h1 { margin: 0; color: var(--mk-text); font-size: 27px; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.mk-support-page > p:not(.mk-kicker) { margin: 17px 0 0; }
.mk-support-page .mk-support-page__muted { margin-top: 4px; color: var(--mk-muted); }
.mk-support-page .mk-button { margin-top: 24px; }
.mk-subscription-price { display: block; margin-top: 22px; color: var(--mk-primary); font-size: 18px; }
.mk-subscription-contact { font-weight: 700; }
@media (max-width: 600px) { .mk-support-page { margin: 24px auto; padding: 28px 20px; }.mk-support-page h1 { font-size: 23px; } }

@media (prefers-reduced-motion: reduce) {
  .mk-app *,
  .mk-app *::before,
  .mk-app *::after,
  .mk-login-page *,
  .mk-login-page *::before,
  .mk-login-page *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .mk-login__waves span { opacity: var(--wave-low); transform: translate(-50%, -50%) scale(1); }
}

/* Phase 2B: authenticated operational detail and form surfaces. */
.mk-mono { font-family: ui-monospace, "Cascadia Mono", monospace; font-variant-numeric: tabular-nums; }
.mk-back-link { display: inline-flex; min-height: 36px; align-items: center; margin-bottom: 16px; color: var(--mk-muted); font-size: 12px; font-weight: 650; }
.mk-back-link:hover { color: var(--mk-primary); }
.mk-button--danger { border-color: #c63d4d; background: #c63d4d; color: #fff; }
.mk-button--danger:hover { border-color: #a92f3e; background: #a92f3e; color: #fff; }
.mk-back-link:focus-visible,
.mk-photo:focus-visible,
.mk-photo-upload > summary:focus-visible,
.mk-contact-actions a:focus-visible,
.mk-contact-utilities button:focus-visible,
.mk-action-links a:focus-visible,
.mk-action-links button:focus-visible,
.mk-section-head > a:focus-visible,
.mk-client-summary a:focus-visible,
.mk-customer-row:focus-visible,
.mk-form-page .suggestion-button:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgb(37 99 235 / 17%); }

/* Frozen Order Detail integration. */
.mk-order-detail-page .mk-content { max-width: 1320px; }
.mk-order-detail-page .mk-order-hero { overflow: hidden; margin-bottom: 16px; border: 1px solid var(--mk-border); border-radius: 14px; background: #fff; box-shadow: var(--mk-shadow); }
.mk-order-detail-page .mk-order-hero__top { display: flex; align-items: flex-start; gap: 22px; padding: 18px 22px; border-bottom: 1px solid var(--mk-soft); }
.mk-order-detail-page .mk-order-hero__identity { min-width: 190px; }
.mk-order-detail-page .mk-order-hero__number { margin: 4px 0 0; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }
.mk-order-detail-page .mk-order-hero__state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mk-order-detail-page .mk-overdue-label { display: inline-flex; align-items: center; gap: 6px; color: var(--mk-danger); font-size: 11px; font-weight: 700; }
.mk-order-detail-page .mk-overdue-label::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.mk-order-detail-page .mk-order-hero__deadline { margin-left: auto; padding-right: 22px; text-align: right; }
.mk-order-detail-page .mk-order-hero__deadline strong { display: block; margin-top: 5px; font-size: 20px; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mk-order-detail-page .mk-order-hero__deadline .due-hint { display: block; margin-top: 4px; }
.mk-order-detail-page .mk-order-hero__deadline.is-late strong,
.mk-order-detail-page .mk-order-hero__deadline.is-late .due-hint { color: var(--mk-danger); }
.mk-order-detail-page .mk-order-hero__deadline.is-ready strong,
.mk-order-detail-page .mk-order-hero__deadline.is-ready .due-hint { color: var(--mk-success); }
.mk-order-detail-page .mk-order-hero__action { align-self: center; }
.mk-order-detail-page .mk-order-hero__action form { margin: 0; }
.mk-order-detail-page .mk-order-hero__action .mk-button { min-width: 168px; height: 38px; }
.mk-order-detail-page .mk-order-hero__body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); gap: 24px; padding: 17px 22px; }
.mk-order-detail-page .mk-order-hero__item { font-size: 17px; font-weight: 720; line-height: 1.3; }
.mk-order-detail-page .mk-order-hero__work { margin-top: 4px; color: var(--mk-muted); font-size: 12px; }
.mk-order-detail-page .mk-order-hero__meta { display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: var(--mk-muted); font-size: 11px; }
.mk-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(285px, .75fr); align-items: start; gap: 16px; }
.mk-detail-surface { overflow: hidden; border: 1px solid var(--mk-border); border-radius: 12px; background: #fff; box-shadow: var(--mk-shadow); }
.mk-detail-head { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-detail-head h2 { margin: 0; font-size: 16px; font-weight: 720; }
.mk-current-step { display: inline-flex; align-items: center; gap: 6px; color: var(--mk-primary); font-size: 10.5px; font-weight: 700; }
.mk-current-step::before { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; content: ""; }
.mk-operational-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, .95fr); padding: 0 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-next-step,
.mk-customer-contact { padding: 18px 0; }
.mk-next-step h3,
.mk-customer-contact h3 { margin: 6px 0 3px; font-size: 15px; font-weight: 720; line-height: 1.3; }
.mk-next-step > p,
.mk-contact-note { max-width: 390px; margin: 0; color: var(--mk-muted); font-size: 11.5px; line-height: 1.5; }
.mk-next-step > .mk-ready-note { margin-top: 9px; color: var(--mk-success); font-weight: 650; }
.mk-next-step > .mk-state-note { margin-top: 9px; }
.mk-customer-contact { margin-left: 20px; padding-left: 20px; border-left: 1px solid var(--mk-soft); }
.mk-customer-contact .contact-menu { width: 100%; margin-top: 7px; }
.mk-customer-contact .contact-menu > summary { min-height: 32px; align-items: center; color: var(--mk-primary); font-size: 11px; font-weight: 700; }
.mk-customer-contact .contact-menu[open] > summary { background: transparent; }
.mk-contact-draft h4 { margin: 3px 0 2px; font-size: 12px; }
.mk-contact-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.mk-contact-actions a,
.mk-contact-actions button,
.mk-contact-actions span { display: inline-flex; min-height: 32px; align-items: center; padding: 0 9px; border: 1px solid #dce2ea; border-radius: 7px; background: #fff; color: #475569; font-size: 11px; font-weight: 650; }
.mk-contact-actions a:hover, .mk-contact-actions button:hover { border-color: #bdc8d6; background: #f8fafc; color: var(--mk-text); }
.mk-contact-actions form { margin: 0; }
.mk-contact-actions button:focus-visible { outline: 2px solid var(--mk-primary); outline-offset: 2px; }
.mk-contact-actions button:disabled, .mk-intake-action button:disabled { opacity: .55; cursor: not-allowed; }
.mk-contact-confirmation { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mk-border); }
.mk-contact-confirmation > p { margin: 0 0 10px; font-size: 12px; }
.mk-contact-confirmation .mk-check { align-items: flex-start; margin-bottom: 12px; font-size: 12px; }
.mk-contact-confirmation .mk-check input { flex: 0 0 auto; }
.mk-order-hero .mk-intake-contact { margin: 0; padding: 14px 22px; border: 0; border-top: 1px solid var(--mk-soft); }
.mk-intake-contact .mk-contact-note { max-width: 65ch; }
.mk-intake-contact .mk-contact-draft { max-width: 720px; }
.mk-intake-action { padding: 0 22px 20px; }
.mk-contact-actions span[aria-disabled="true"] { background: #f5f6f8; color: #9aa6b6; }
.mk-contact-draft { margin-top: 5px; }
.mk-contact-draft textarea { width: 100%; min-height: 98px; margin-top: 9px; padding: 10px; border: 1px solid var(--mk-border); border-radius: 7px; background: #fbfcfe; color: var(--mk-text); font-size: 11px; resize: vertical; }
.mk-contact-utilities { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.mk-contact-utilities button { min-height: 32px; border: 1px solid var(--mk-border); border-radius: 7px; background: #fff; color: #475569; font-size: 11px; }
.mk-contact-draft > p,
.mk-contact-feedback { margin: 7px 0 0; color: var(--mk-muted); font-size: 10.5px; }
.mk-contact-feedback { min-height: 16px; color: var(--mk-success); font-weight: 650; }
.mk-panel-section { padding: 18px 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-panel-section:last-child { border-bottom: 0; }
.mk-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.mk-section-head h3,
.mk-other-actions > h3 { margin: 0; font-size: 13.5px; font-weight: 720; }
.mk-section-head > span { color: var(--mk-muted); font-size: 10.5px; }
.mk-section-head > a { color: var(--mk-primary); font-size: 11px; font-weight: 700; }
.mk-photo-row { display: flex; align-items: stretch; flex-wrap: wrap; gap: 9px; }
.mk-photo { display: flex; width: 124px; aspect-ratio: 4 / 3; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; border: 1px solid #dfe5ec; border-radius: 7px; background: #f1f4f7; color: #718096; font-size: 10px; }
.mk-photo img { width: 100%; min-height: 0; flex: 1 1 auto; object-fit: cover; }
.mk-photo > span { padding: 0 5px 7px; }
.mk-photo-upload { position: relative; }
.mk-photo-upload > summary { list-style: none; }
.mk-photo-upload > summary::-webkit-details-marker { display: none; }
.mk-photo--add { width: 92px; border-style: dashed; background: #fff; color: var(--mk-primary); cursor: pointer; }
.mk-photo--add > span:first-child { padding: 0; font-size: 24px; line-height: 1; }
.mk-photo--add:hover { border-color: #a9bfe9; background: var(--mk-primary-soft); }
.mk-photo-upload form { display: grid; position: absolute; z-index: 5; top: calc(100% + 8px); right: 0; width: min(360px, calc(100vw - 48px)); gap: 8px; padding: 14px; border: 1px solid var(--mk-border); border-radius: 9px; background: #fff; box-shadow: 0 12px 30px rgb(15 23 42 / 12%); }
.mk-photo-upload form label { font-size: 11px; font-weight: 700; }
.mk-photo-upload form input { width: 100%; min-width: 0; font-size: 11px; }
.mk-photo-upload form p,
.mk-empty-copy { margin: 10px 0 0; color: var(--mk-muted); font-size: 10.5px; line-height: 1.5; }
.mk-note { margin: 0; padding: 1px 0 1px 12px; border-left: 2px solid #bfdbfe; color: #475569; font-size: 12px; line-height: 1.55; }
.mk-history-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mk-history-list > li { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: baseline; gap: 14px; }
.mk-history-list time { color: var(--mk-muted); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 10px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.mk-history-list strong { display: block; font-size: 11.5px; line-height: 1.4; }
.mk-history-list small { display: block; margin-top: 2px; color: var(--mk-muted); font-size: 10.5px; }
.mk-history-list p { margin: 4px 0 0; color: var(--mk-muted); font-size: 10.5px; }
.mk-history-list ul { margin: 5px 0 0; padding-left: 16px; color: #475569; font-size: 10.5px; }
.mk-history-list ul span { color: var(--mk-muted); }
.mk-team-layout { display: grid; grid-template-columns: minmax(240px, 310px) minmax(0, 1fr); align-items: start; gap: 18px; }
.mk-team-user-list, .mk-team-activity-list { margin: 0; padding: 0; list-style: none; }
.mk-team-user-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-team-user-list li:last-child, .mk-team-activity-list li:last-child { border-bottom: 0; }
.mk-team-user-list strong, .mk-team-user-list li span, .mk-team-activity-list strong, .mk-team-activity-list li span, .mk-team-activity-list small { display: block; }
.mk-team-user-list strong { font-size: 12px; }.mk-team-user-list li div > span, .mk-team-activity-list small { color: var(--mk-muted); font-size: 10.5px; }
.mk-team-state { flex: 0 0 auto; color: #14765a; font-size: 10.5px; font-weight: 700; }.mk-team-state--off { color: var(--mk-muted); }
.mk-team-activity .mk-detail-head > span { color: var(--mk-muted); font-size: 11px; }
.mk-team-activity-list li { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--mk-soft); }
.mk-team-activity-list time { color: var(--mk-muted); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 10px; white-space: nowrap; }
.mk-team-activity-list strong { font-size: 12px; }.mk-team-activity-list li span { font-size: 11px; }.mk-team-activity-list small { margin-top: 2px; overflow-wrap: anywhere; }
.mk-team-pages { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; color: var(--mk-muted); font-size: 11px; }.mk-team-pages a { color: var(--mk-primary); font-weight: 700; }
@media (max-width: 900px) { .mk-team-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 390px) { .mk-team-activity-list li { grid-template-columns: minmax(0, 1fr); gap: 3px; } }
.mk-client-summary { padding-bottom: 13px; border-bottom: 1px solid var(--mk-soft); }
.mk-client-summary > a:first-child { display: block; color: var(--mk-text); font-size: 15px; font-weight: 720; line-height: 1.3; }
.mk-client-phone { display: inline-block; margin-top: 3px; color: var(--mk-muted); font-size: 11px; }
.mk-client-phone:hover { color: var(--mk-primary); }
.mk-money-list { margin: 8px 0 0; }
.mk-money-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 7px 0; }
.mk-money-list dt { color: var(--mk-muted); font-size: 11.5px; font-weight: 400; }
.mk-money-list dd { margin: 0; font-size: 13px; font-weight: 720; font-variant-numeric: tabular-nums; }
.mk-money-list > .mk-money-list__balance { margin-top: 3px; padding-top: 11px; border-top: 1px solid var(--mk-soft); }
.mk-money-list__balance dt { color: var(--mk-text); font-weight: 700; }
.mk-money-list__balance dd { color: var(--mk-primary); font-size: 18px; font-weight: 760; line-height: 1; }
.mk-side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.mk-side-actions .mk-button { box-shadow: none; }
.mk-notification-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mk-notification-list > li { padding-bottom: 12px; border-bottom: 1px solid var(--mk-soft); }
.mk-notification-list > li:last-child { padding-bottom: 0; border-bottom: 0; }
.mk-notification-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mk-notification-head strong { font-size: 11.5px; }
.mk-notification-list p { margin: 4px 0 0; color: var(--mk-muted); font-size: 10.5px; line-height: 1.45; }
.mk-notice-status { display: inline-flex; align-items: center; gap: 5px; color: var(--mk-muted); font-size: 10px; font-weight: 700; text-align: right; }
.mk-notice-status::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; content: ""; }
.mk-notice-status--success { color: var(--mk-success); }
.mk-notice-status--success::before { background: #10b981; }
.mk-notice-status--danger { color: var(--mk-danger); }
.mk-notice-status--danger::before { background: #e05260; }
.mk-notice-status--warning { color: var(--mk-warning); }
.mk-notice-status--warning::before { background: #f59e0b; }
.mk-notifications .mk-notice-warning { color: var(--mk-danger); }
.mk-notice-warning a { text-decoration: underline; }
.mk-notification-details { margin-top: 6px; color: var(--mk-muted); font-size: 10.5px; }
.mk-notification-details summary { cursor: pointer; }
.mk-notification-details ul { margin: 6px 0 0; padding-left: 17px; }
.mk-notification-list form { margin-top: 8px; }
.mk-notification-list .mk-button { height: 32px; padding: 0 9px; }
.mk-action-links { display: grid; margin-top: 8px; }
.mk-action-links form { margin: 0; }
.mk-action-links a,
.mk-action-links button { display: flex; width: 100%; min-height: 34px; align-items: center; border: 0; border-radius: 6px; padding: 0 4px; background: transparent; color: #475569; font-size: 11.5px; font-weight: 650; text-align: left; cursor: pointer; }
.mk-action-links a:hover,
.mk-action-links button:hover { background: #f8fafc; color: var(--mk-text); }
.mk-action-links .is-danger { margin-top: 8px; padding-top: 9px; border-top: 1px solid #f0dadd; border-radius: 0; color: var(--mk-danger); }

/* Shared v0.5 forms. */
.mk-form-wrap { width: min(820px, 100%); margin: 0 auto; }
.mk-form-wrap--narrow { width: min(590px, 100%); }
.mk-form-heading { margin-bottom: 18px; }
.mk-form-heading h1 { margin: 6px 0 0; font-size: 29px; font-weight: 740; line-height: 1.18; letter-spacing: -.025em; }
.mk-form-heading > p { margin: 7px 0 0; color: var(--mk-muted); font-size: 12.5px; }
.mk-form-surface { overflow: hidden; border: 1px solid var(--mk-border); border-radius: 12px; background: #fff; box-shadow: var(--mk-shadow); }
.mk-form-section { padding: 23px 25px; border-bottom: 1px solid var(--mk-soft); }
.mk-form-section__head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 21px; }
.mk-form-section__head > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--mk-primary-soft); color: var(--mk-primary); font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 9px; font-weight: 800; }
.mk-form-section__head h2 { margin: 1px 0 0; font-size: 15px; font-weight: 720; }
.mk-form-section__head p { margin: 3px 0 0; color: var(--mk-muted); font-size: 11px; }
.mk-form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.mk-form-grid--single { grid-template-columns: 1fr; }
.mk-form-page .field { min-width: 0; margin-bottom: 18px; }
.mk-form-page .full-width { grid-column: 1 / -1; }
.mk-form-page .form-label { display: block; margin-bottom: 7px; color: #475569; font-size: 11px; font-weight: 700; }
.mk-form-page .required { color: var(--mk-danger); }
.mk-form-page .form-control { width: 100%; min-height: 42px; border: 1px solid #d7dee8; border-radius: 8px; background: #fff; color: var(--mk-text); font-size: 13px; }
.mk-form-page textarea.form-control { min-height: 92px; resize: vertical; }
.mk-form-page .form-control:focus { border-color: #7aa4f8; box-shadow: 0 0 0 3px rgb(37 99 235 / 9%); }
.mk-form-page .form-control.is-invalid { border-color: #dc3545; }
.mk-form-page .form-text { min-height: 0; margin-top: 5px; color: var(--mk-muted); font-size: 10.5px; }
.mk-form-page .invalid-feedback { font-size: 10.5px; }
.mk-form-page .alert { margin: 18px 25px 0; font-size: 12px; }
.mk-check { display: flex; align-items: flex-start; gap: 9px; color: #334155; font-size: 12px; font-weight: 650; line-height: 1.45; }
.mk-check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--mk-primary); }
.mk-check-help { margin: 6px 0 0 26px; color: var(--mk-muted); font-size: 10.5px; line-height: 1.5; }
.mk-form-actions { display: flex; align-items: center; gap: 9px; padding: 18px 25px; }
.mk-form-actions .mk-button--primary,
.mk-form-actions .mk-button--danger { min-width: 150px; }
.mk-customer-choice { margin: 0 0 20px; padding: 15px; border: 1px solid #dbe5f5; border-radius: 9px; background: #f8fbff; }
.mk-customer-choice > p { margin: 0 0 13px; color: #475569; font-size: 11.5px; }
.mk-customer-choice .field { margin-bottom: 0; }
.mk-form-callout { margin: 0; padding: 10px 12px; border-left: 2px solid #bfdbfe; background: #f8fbff; color: #475569; font-size: 11px; line-height: 1.5; }
.field[data-suggest-field] { position: relative; }
.mk-form-page .field-suggestions { position: absolute; z-index: 8; top: calc(100% - 13px); right: 0; left: 0; padding: 7px; border: 1px solid var(--mk-border); border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgb(15 23 42 / 11%); }
.mk-form-page .field-suggestions p { margin: 3px 7px 6px; }
.mk-form-page .suggestion-button { display: block; width: 100%; min-height: 36px; border: 0; border-radius: 6px; padding: 0 8px; background: #fff; color: var(--mk-text); font-size: 12px; text-align: left; }
.mk-form-page .suggestion-button:hover { background: var(--mk-primary-soft); }
.mk-action-context { display: flex; align-items: center; gap: 12px; margin-top: 9px; color: var(--mk-muted); font-size: 11px; }
.mk-current-value { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--mk-soft); border-radius: 8px; background: #fbfcfe; }
.mk-current-value span { color: var(--mk-muted); font-size: 11px; }
.mk-current-value strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.mk-destructive-note { margin-bottom: 18px; padding: 13px 14px; border: 1px solid #f2d5d9; border-radius: 8px; background: #fff8f8; color: #9f3b46; }
.mk-destructive-note strong { font-size: 12.5px; }
.mk-destructive-note p { margin: 4px 0 0; font-size: 11px; line-height: 1.5; }

/* Customers: compact operational directory. */
.mk-customer-surface { overflow: hidden; border: 1px solid var(--mk-border); border-radius: 12px; background: #fff; box-shadow: var(--mk-shadow); }
.mk-customer-toolbar { display: flex; min-height: 59px; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--mk-soft); }
.mk-customer-toolbar > span { margin-left: auto; color: var(--mk-muted); font-size: 11px; }
.mk-customer-list { display: grid; grid-template-columns: 1fr 1fr; }
.mk-customer-row { display: grid; min-height: 88px; grid-template-columns: 40px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 14px 16px; border-right: 1px solid var(--mk-soft); border-bottom: 1px solid var(--mk-soft); color: var(--mk-text); }
.mk-customer-row:nth-child(2n) { border-right: 0; }
.mk-customer-row:hover { background: #fbfdff; }
.mk-customer-avatar { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--mk-primary-soft); color: var(--mk-primary); font-size: 12px; font-weight: 800; }
.mk-customer-identity { min-width: 0; }
.mk-customer-identity strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mk-customer-identity > span { display: block; margin-top: 3px; color: var(--mk-muted); font-size: 11px; }
.mk-customer-orders { display: grid; justify-items: end; color: var(--mk-muted); font-size: 9.5px; }
.mk-customer-orders b { color: var(--mk-text); font-size: 15px; }
.mk-customer-row > .mk-icon { width: 16px; color: #9aa6b6; }
.mk-empty-state { grid-column: 1 / -1; padding: 52px 22px; text-align: center; }
.mk-empty-state > span { color: #a7b4c4; font-size: 34px; }
.mk-empty-state h2 { margin: 10px 0 0; font-size: 17px; }
.mk-empty-state p { margin: 6px 0 0; color: var(--mk-muted); font-size: 12px; }
.mk-customers-page .pagination-bar,
.mk-customer-detail-page .pagination-bar { margin-top: 20px; }
.mk-customer-profile { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 20px 22px; border: 1px solid var(--mk-border); border-radius: 12px; background: #fff; box-shadow: var(--mk-shadow); }
.mk-customer-profile__identity { display: flex; align-items: center; gap: 14px; }
.mk-customer-profile__identity .mk-customer-avatar { width: 48px; height: 48px; }
.mk-customer-profile h1 { margin: 3px 0 0; font-size: 24px; font-weight: 740; }
.mk-customer-profile__actions { display: flex; align-items: center; gap: 14px; }
.mk-customer-profile__actions > span { color: var(--mk-muted); font-size: 11px; }
.mk-customer-profile__actions b { color: var(--mk-text); font-size: 16px; }
.mk-customer-orders-head { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--mk-soft); }
.mk-customer-orders-head h2 { margin: 0; font-size: 15px; }
.mk-customer-orders-head span { color: var(--mk-muted); font-size: 11px; }

@media (max-width: 720px) {
  .mk-back-link { min-height: 44px; margin-bottom: 10px; }
  .mk-order-detail-page .mk-content { padding: 14px 12px 28px; }
  .mk-order-detail-page .mk-topbar { padding-right: 12px; padding-left: 14px; }
  .mk-order-detail-page .mk-back-to-orders { height: 36px; padding: 0 10px; }
  .mk-order-detail-page .mk-order-hero { display: grid; overflow: visible; gap: 0; margin-bottom: 12px; padding: 16px; }
  .mk-order-detail-page .mk-order-hero__top,
  .mk-order-detail-page .mk-order-hero__body { display: contents; }
  .mk-order-detail-page .mk-order-hero__identity { order: 1; min-width: 0; }
  .mk-order-detail-page .mk-order-hero__number { font-size: 25px; }
  .mk-order-detail-page .mk-order-hero__deadline { order: 2; margin: 13px 0 0; padding: 13px 0 0; border-top: 1px solid var(--mk-soft); text-align: left; }
  .mk-order-detail-page .mk-order-hero__deadline strong { font-size: 19px; }
  .mk-order-detail-page .mk-order-hero__product { order: 3; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--mk-soft); }
  .mk-order-detail-page .mk-order-hero__work { line-height: 1.45; }
  .mk-order-detail-page .mk-order-hero__action { order: 4; margin-top: 15px; }
  .mk-order-detail-page .mk-order-hero .mk-intake-contact { order: 4; margin-top: 14px; padding: 14px 0 0; }
  .mk-order-detail-page .mk-order-hero .mk-intake-action { order: 5; padding: 0; }
  .mk-order-detail-page .mk-order-hero__action .mk-button { width: 100%; min-width: 0; height: 44px; }
  .mk-order-detail-page .mk-order-hero__meta { order: 5; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 10.5px; }
  .mk-detail-grid { display: flex; width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .mk-detail-work,
  .mk-detail-side,
  .mk-operational-area { display: contents; }
  .mk-detail-work__head { order: 1; }
  .mk-next-step { order: 2; }
  .mk-detail-side__head { order: 3; }
  .mk-client-finance { order: 4; }
  .mk-customer-contact { order: 5; }
  .mk-photos { order: 6; }
  .mk-notifications { order: 7; }
  .mk-comment { order: 8; }
  .mk-history { order: 9; }
  .mk-other-actions { order: 10; }
  .mk-detail-grid .mk-detail-head,
  .mk-detail-grid .mk-panel-section,
  .mk-detail-grid .mk-next-step,
  .mk-detail-grid .mk-customer-contact { width: 100%; margin: 0; padding: 16px; border: 0; border-right: 1px solid var(--mk-border); border-bottom: 1px solid var(--mk-soft); border-left: 1px solid var(--mk-border); border-radius: 0; background: #fff; }
  .mk-detail-grid .mk-detail-work__head { border-top: 1px solid var(--mk-border); border-radius: 12px 12px 0 0; }
  .mk-detail-grid .mk-other-actions { border-bottom-color: var(--mk-border); border-radius: 0 0 12px 12px; }
  .mk-contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mk-contact-actions a,
  .mk-contact-actions button,
  .mk-contact-actions span { min-height: 44px; justify-content: center; }
  .mk-contact-actions form, .mk-contact-actions button { width: 100%; }
  .mk-contact-confirmation .mk-button { width: 100%; min-height: 44px; }
  .mk-contact-utilities button { min-height: 44px; }
  .mk-photo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mk-photo,
  .mk-photo--add { width: 100%; min-width: 0; }
  .mk-photo--add > span:last-child { display: none; }
  .mk-photo-upload form { position: fixed; z-index: 60; right: 12px; bottom: 12px; left: 12px; top: auto; width: auto; }
  .mk-history-list > li { grid-template-columns: max-content minmax(0, 1fr); gap: 10px; }
  .mk-action-links a,
  .mk-action-links button { min-height: 44px; }
  .mk-form-heading h1 { font-size: 25px; }
  .mk-form-section { padding: 20px 17px; }
  .mk-form-grid { grid-template-columns: 1fr; }
  .mk-form-page .form-control { min-height: 44px; font-size: 16px; }
  .mk-form-actions { align-items: stretch; flex-direction: column; padding: 16px 17px; }
  .mk-form-actions .mk-button { width: 100%; height: 44px; }
  .mk-customer-toolbar { align-items: stretch; flex-wrap: wrap; padding: 12px; }
  .mk-customer-toolbar .mk-work-search { width: 100%; }
  .mk-customer-toolbar > span { margin-left: 0; }
  .mk-customer-list { grid-template-columns: 1fr; }
  .mk-customer-row { min-height: 82px; border-right: 0; }
  .mk-customer-profile { align-items: flex-start; flex-direction: column; padding: 17px; }
  .mk-customer-profile__actions { width: 100%; justify-content: space-between; }
  .mk-customer-profile__actions .mk-button { height: 44px; }
}

@media (max-width: 390px) {
  .mk-order-detail-page .mk-userchip { display: none; }
  .mk-order-detail-page .mk-crumbs span:nth-child(2) { display: none; }
  .mk-order-detail-page .mk-crumbs b { font-size: 11px; }
}
