:root {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #142c3a;
  background: #edf2f5;
  --line: #d9e3e9;
  --muted: #4d6475;
  --brand: #192b35;
  --danger: #b4232f;
  --danger-tint: #fde8ea;
  --warn: #8a5a00;
  --warn-tint: #fff3d6;
  --ok: #1f6b4c;
  --ok-tint: #e3f4ea;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea {
  min-height: 2.75rem;
  color: inherit;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: .6rem;
}
button { font-weight: 650; cursor: pointer; }
button:hover:not(:disabled) { background: #edf4f7; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--aireva-focus, #2f86c8); outline-offset: 2px; }
.primary { color: #fff; background: var(--aireva-blue, #28596e); border-color: var(--aireva-blue, #28596e); }
.primary:hover:not(:disabled) { color: #fff; background: var(--aireva-blue-hover, #1f4a5c); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mt-wrap { width: min(100%, 52rem); margin: 0 auto; padding: 0 1rem; }

.mt-header { background: var(--brand); color: #fff; padding: 1.25rem 0 1.4rem; }
.mt-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mt-kicker { color: #9fc0d3; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.mt-header h1 { font-size: clamp(1.45rem, 5vw, 1.9rem); line-height: 1.2; }
.mt-hours { margin-top: .35rem; color: #c7d8e2; font-size: .92rem; }
.mt-home { flex: none; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .9rem; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / .25); color: #fff; text-decoration: none; font-weight: 650; font-size: .9rem; }
.mt-home:hover { background: rgb(255 255 255 / .1); }

.mt-manager { margin-top: 1rem; padding: .9rem 1rem; border-radius: .9rem; background: var(--ok-tint); border: 1px solid #b9dfc9;
  color: var(--ok); display: grid; gap: .7rem; font-size: .93rem; }
.mt-manager-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.mt-day { margin: 1rem 0 2rem; }
.mt-date-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.mt-arrow { width: 2.75rem; padding: 0; font-size: 1.4rem; line-height: 1; }
.mt-date input { min-width: 10.5rem; }
.mt-chips { display: flex; gap: .4rem; margin-left: auto; }
.mt-chips button[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.mt-day-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin: 1.1rem 0 .7rem; }
.mt-day-head h2 { font-size: 1.2rem; color: var(--brand); }
.mt-day-head p { color: var(--muted); font-size: .92rem; }
.mt-message { padding: .75rem 1rem; border-radius: .75rem; background: var(--danger-tint); color: var(--danger); margin-bottom: .75rem; }
.mt-weekend { padding: 1.5rem 1rem; text-align: center; border-radius: .9rem; background: #fff; border: 1px dashed var(--line); color: var(--muted); }

.mt-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.mt-slot { border-radius: .8rem; border: 1px solid var(--line); background: #fff; }
.mt-time { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; font-size: .9rem; white-space: nowrap;
  padding: .25rem .55rem; border-radius: .45rem; background: #eef4f7; }
.mt-lunch, .mt-past { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; color: var(--muted); font-size: .92rem; }
.mt-lunch { background: #e4ecf0; border-color: #cfdbe2; font-weight: 600; }
.mt-past { opacity: .6; background: #f5f8fa; }
.mt-free { border-color: #cfe3d8; }
.mt-free-button { width: 100%; display: flex; align-items: center; gap: .75rem; min-height: 3rem; border: 0; border-radius: inherit;
  background: none; text-align: left; font-weight: 600; }
.mt-free-button:hover:not(:disabled) { background: var(--ok-tint); }
.mt-free-label { color: var(--ok); }
.mt-free-action { margin-left: auto; color: var(--ok); font-weight: 750; white-space: nowrap; }

.mt-booking { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem;
  border-color: #f0c4c9; }
.mt-booking .mt-time { background: var(--danger-tint); color: #7d1820; }
.mt-booking-main { display: flex; align-items: flex-start; gap: .75rem; min-width: 0; flex: 1 1 18rem; }
.mt-details { min-width: 0; }
.mt-company { font-weight: 700; color: var(--brand); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; overflow-wrap: anywhere; }
.mt-meta, .mt-notes { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.mt-notes { font-style: italic; }
.mt-badge { font-size: .72rem; font-weight: 700; color: #fff; background: var(--brand); padding: .1rem .45rem; border-radius: .35rem; }
.mt-mine { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.mt-blocked { background: var(--warn-tint); border-color: #f1d79a; }
.mt-blocked .mt-time { background: #f6e2b3; color: var(--warn); }
.mt-blocked .mt-company { color: var(--warn); }
.mt-done-slot { opacity: .65; }
.mt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: auto; }
.mt-state { font-size: .82rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--danger-tint); color: var(--danger); }
.mt-blocked .mt-state { background: #f6e2b3; color: var(--warn); }
.mt-cancel { color: var(--danger); border-color: #f0c4c9; font-size: .88rem; }
.mt-cancel:hover:not(:disabled) { background: var(--danger-tint); }
.mt-code-button { font-size: .82rem; color: var(--muted); }
.mt-call { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .8rem; border-radius: .6rem; background: var(--ok);
  color: #fff; font-weight: 700; text-decoration: none; font-size: .9rem; }

.mt-now { display: flex; align-items: center; gap: .5rem; color: var(--danger); font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; }
.mt-now::before, .mt-now::after { content: ""; height: 2px; background: var(--danger); flex: 1; }
.mt-now::before { flex: 0 0 .75rem; }

.mt-done { margin-bottom: 2rem; padding: 1.1rem 1.2rem; border-radius: 1rem; background: var(--ok-tint); border: 1px solid #b9dfc9; display: grid; gap: .6rem; }
.mt-done h2 { color: var(--ok); font-size: 1.1rem; }
.mt-code { font: 800 2rem/1.1 ui-monospace, Consolas, monospace; letter-spacing: .2em; color: var(--brand); }
.mt-done button { justify-self: start; }

dialog { width: min(100% - 1.5rem, 30rem); max-height: calc(100dvh - 1.5rem); padding: 0; border: 0; border-radius: 1rem;
  box-shadow: 0 24px 60px rgb(10 25 35 / .35); }
dialog::backdrop { background: rgb(10 25 35 / .55); }
dialog form { display: grid; gap: .8rem; padding: 1.1rem; }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
dialog header h2 { font-size: 1.1rem; color: var(--brand); }
dialog header button { width: 2.75rem; padding: 0; font-size: 1.4rem; border: 0; }
dialog label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
dialog input, dialog select, dialog textarea { width: 100%; color: #142c3a; font-weight: 400; }
#mtBookFields, #mtBlockFields { display: grid; gap: .8rem; }
.mt-form-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: .7rem; }
.mt-hint { font-size: .82rem; color: var(--ok); }
.mt-form-message { color: var(--danger); font-size: .9rem; font-weight: 600; }
.mt-form-message:empty { display: none; }
dialog footer { display: flex; justify-content: flex-end; gap: .5rem; }

@media (max-width: 34rem) {
  .mt-chips { margin-left: 0; width: 100%; }
  .mt-chips button { flex: 1; }
  .mt-date { flex: 1; }
  .mt-date input { width: 100%; min-width: 0; }
  .mt-booking-main { flex-direction: column; gap: .35rem; }
  .mt-free-label { display: none; }
}
