/* =============================================================================
   Agent Meeko Phone: Inbound calls, Outbound calls and What Meeko knows
   (16 Nov 2026)

   One card per part, AM Navy: the icon sits in a soft tinted badge beside the
   title and its one line hint; facts are soft tags; groups inside a card are
   set apart by a rule, never by another card. Everything wraps or shrinks,
   so nothing is wider than the screen. Colours and sizes are tokens only.
   ============================================================================= */

.mpp-page { min-width: 0; }
.mpp-page > .mpp-notice { margin: 0 0 14px; }

/* ---- the card ------------------------------------------------------------- */

.mpp-card { min-width: 0; }
.mpp-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.mpp-card__badge {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px;
    border-radius: var(--radius-chip); background: var(--am-blue-soft, var(--accent-tint)); color: var(--am-blue, var(--accent));
}
.mpp-card__heading { flex: 1 1 auto; min-width: 0; }
.mpp-card__title { margin: 0; line-height: 1.3; }
.mpp-card__hint { margin-top: 3px; }
.mpp-card__head > .mpp-tag { flex: none; margin-top: 4px; }
.mpp-card > .gs-ai-row:first-of-type { margin-top: 6px; }

.mpp-group {
    margin-top: var(--gutter, 16px); padding-top: var(--gutter, 16px);
    border-top: var(--divider-width, 1px) solid var(--divider-colour, var(--border-subtle));
}
.mpp-group__title { margin: 0 0 2px; font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }

.mpp-notice { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mpp-notice .mpp-link { margin-left: auto; }
.mpp-loading, .mpp-empty { margin-top: 10px; }
.mpp-empty[hidden] { display: none; }

/* ---- soft tags and chips --------------------------------------------------- */

.mpp-tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mpp-tag {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 22px; padding: 2px 9px;
    border-radius: 5px; font-size: var(--font-size-small); font-weight: 500; line-height: 1.3;
    overflow-wrap: anywhere;
}
.mpp-tag--accent { background: var(--am-blue-soft, var(--accent-tint)); color: var(--am-blue-ink, var(--accent)); }
.mpp-tag--neutral { background: var(--status-neutral-tint); color: var(--status-neutral); }
.mpp-tag--success { background: var(--status-success-tint); color: var(--status-success); }
.mpp-tag--warning { background: var(--status-warning-tint); color: var(--status-warning-ink); }
.mpp-tag--removable { padding-right: 3px; }
.mpp-tag__remove {
    display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: inherit; cursor: pointer;
}
.mpp-tag__remove:hover { background: var(--am-blue-soft-hover, var(--accent-border)); }
.mpp-tag__remove:focus-visible { outline: none; box-shadow: var(--am-focus); }
.mpp-tags--editable { margin-top: 12px; }

.mpp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mpp-chip { height: 28px; padding: 0 10px; font-size: var(--font-size-small); }
.mpp-chip:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- fields and rows -------------------------------------------------------- */

.mpp-field, .mpp-text, .mpp-picker { min-width: 0; }
.mpp-text { margin-top: 12px; }
.mpp-text .vr-field--wide { margin-top: 0; }
.mpp-picker { margin-top: 10px; }
.mpp-picker .multi-select { max-width: 100%; }
.mpp-grid--pickers { align-items: end; }
.mpp-grid--pickers .mpp-picker { margin-top: 0; }

.mpp-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.mpp-links .gs-hint { flex: 1 1 100%; margin: 0; }

.mpp-add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 12px; }
.mpp-add-row .vr-field { flex: 1 1 180px; max-width: 280px; }
.mpp-add-row .am-btn { height: var(--input-height); }

/* ---- treatments ------------------------------------------------------------ */

.mpp-search { margin-top: 12px; max-width: 360px; }
.mpp-treatments { display: grid; gap: 0; margin-top: 6px; }
.mpp-treatment { padding: 14px 0; border-top: 1px solid var(--border-subtle); min-width: 0; }
.mpp-treatment:first-child { border-top: 0; }
.mpp-treatment[hidden] { display: none; }
.mpp-treatment__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mpp-treatment__name { font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.mpp-treatment .mpp-text { margin-top: 10px; }

.mpp-catalogue { min-width: 0; }
/* The note toggle on a ticked product in the Projects catalogue editor. */
.mpp-note { margin-top: 8px; }

/* ---- phones ----------------------------------------------------------------- */

@media (max-width: 560px) {
    /* The card's own gutter halves, so a switch row and its hint keep the width. */
    .mpp-card { padding: 16px 14px 18px; }
    .mpp-card .gs-ai-row__hint { margin-left: 0; }
    .mpp-card__head { gap: 10px; }
    .mpp-card__badge { width: 30px; height: 30px; }
    .mpp-card__head > .mpp-tag { display: none; }
    .mpp-notice .mpp-link { margin-left: 0; }
    .mpp-add-row .vr-field { max-width: none; }
    .mpp-search { max-width: none; }
    /* iOS zooms the page on a focused control smaller than 16px. */
    .mpp-page input, .mpp-page textarea, .mpp-page select { font-size: 16px; }
}

/* ---- day tiles: Meeko Patterns and opening times (17 Nov 2026) --------------
   Seven tiles, one per day, each with a switch and up to two time ranges.
   They wrap to as many columns as fit, and stack on a phone with the day
   beside its times, so a week never pushes the page sideways. */

/* The week answers to its own width (container queries), not the window's: seven columns when
   there is room, else four or two with the copy action as the eighth cell, so no tile sits alone. */
.mpt { margin-top: 12px; min-width: 0; container-type: inline-size; container-name: mpt-week; }
.mpt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
@container mpt-week (min-width: 560px) { .mpt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } }
@container mpt-week (min-width: 1000px) {
    .mpt-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .mpt-grid > .mpt-actions { grid-column: 1 / -1; }
    .mpt-grid > .mpt-actions--empty { display: none; }
}
.mpt-day {
    container-type: inline-size;
    display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px;
    /* The AM soft card: a tinted tile with a soft edge, so a day reads as a tile, not a bare box. */
    border: 1px solid var(--am-blue-soft, var(--border-subtle)); border-radius: var(--radius-button, var(--radius-chip, 10px));
    background: var(--am-blue-tint, var(--surface-subtle));
}
.mpt-day--off { background: var(--surface-subtle); border-style: dashed; }
.mpt-day__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.mpt-day__name { font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }
.mpt-day--off .mpt-day__name { color: var(--text-secondary, var(--text-primary)); }
.mpt-day__switch { flex: none; }
.mpt-day__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mpt-day__off { margin: 0; font-size: var(--font-size-small); color: var(--text-secondary, var(--text-primary)); }
.mpt-day__error { margin: 0; font-size: var(--font-size-small); color: var(--status-danger, var(--status-warning-ink)); }
.mpt-day__error[hidden] { display: none; }

.mpt-range { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mpt-range__to { flex: none; font-size: var(--font-size-small); color: var(--text-secondary, var(--text-primary)); }
.mpt-time {
    flex: 1 1 0; min-width: 0; height: var(--control-height-small, 32px); padding: 0 6px;
    border: 1px solid var(--border-default, var(--border-subtle)); border-radius: 6px;
    background: var(--surface-panel); color: var(--text-primary);
    font: inherit; font-size: var(--font-size-small); font-variant-numeric: tabular-nums;
}
.mpt-time:focus-visible { outline: none; box-shadow: var(--am-focus); }
.mpt-time:disabled { opacity: 0.6; cursor: not-allowed; }
.mpt-range__remove, .mpt-day__add {
    display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; cursor: pointer;
    color: var(--am-blue, var(--accent)); font: inherit; font-size: var(--font-size-small);
}
.mpt-range__remove { flex: none; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--text-secondary, var(--text-primary)); }
.mpt-range__remove:hover { background: var(--am-blue-soft, var(--accent-tint)); }
.mpt-day__add { align-self: flex-start; min-height: 28px; }
.mpt-day__add:hover span { text-decoration: underline; }
.mpt-range__remove:focus-visible, .mpt-day__add:focus-visible { outline: none; box-shadow: var(--am-focus); }
.mpt-range__remove:disabled, .mpt-day__add:disabled { opacity: 0.5; cursor: not-allowed; }

.mpt-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; min-width: 0;
    border: 1px dashed var(--border-default, var(--border-subtle)); border-radius: var(--radius-chip, 10px); padding: 10px; }
.mpt-actions .am-btn { max-width: 100%; white-space: normal; text-align: center; }
@container mpt-week (min-width: 1000px) { .mpt-grid > .mpt-actions { justify-content: flex-start; border: 0; padding: 2px 0 0; } }
.mpt-actions--empty { border-style: dashed; }
/* A narrow tile stacks its two times, so each select keeps a readable width. */
@container (max-width: 190px) {
    .mpt-range { flex-wrap: wrap; }
    .mpt-range .mpt-time { flex: 1 1 100%; }
    .mpt-range__to { display: none; }
    .mpt-range__remove { margin-left: auto; }
}
.mpt-status { margin-top: 10px; }
.mpt-holder[hidden] { display: none; }
.mpt-holder > .mpt-title { margin: 16px 0 0; }

/* Out of hours message, the main extension and the warnings beside them. */
.mpp-sub { margin-top: var(--gutter, 16px); padding-top: var(--gutter, 16px);
    border-top: var(--divider-width, 1px) solid var(--divider-colour, var(--border-subtle)); }
.mpp-sub__title { margin: 0 0 2px; font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }
.mp-main-extension { min-width: 0; max-width: 360px; }

@media (max-width: 560px) {
    .mpt-day { padding: 10px 12px; }
    .mpt-time { height: var(--input-height, 40px); font-size: 16px; }
    .mpt-range__remove { width: 36px; height: 36px; }
    .mp-main-extension { max-width: none; }
}
