/* Merkatics — phone styles. Part of the design system; not imported by styles.css.
   Plain rules with no queries: the app applies them at its own breakpoint, e.g.
   @import "responsive/phone.css" (max-width: 639px);
   Load after styles.css and tablet.css. */
/* Type: the size ramp steps up one notch so body text sits closer to the 16px inputs */
:root {
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 17px;
  --font-body-lg: 400 var(--text-lg)/1.6 var(--font-sans);
  --font-body: 400 var(--text-base)/1.55 var(--font-sans);
  --font-body-sm: 400 var(--text-sm)/1.5 var(--font-sans);
  --font-label: 700 var(--text-xs)/1.2 var(--font-sans);
  --font-code: 500 var(--text-sm)/1.35 var(--font-mono);
  --font-h4: 700 var(--text-md)/1.35 var(--font-sans);
}

/* Top bar: tighter, smaller logo; user details hide, the avatar stays */
.mk-topbar {
  gap: 10px;
  min-height: 56px;
  padding: 8px 16px;
}

.mk-topbar__logo {
  width: 112px;
}

.mk-topbar__user {
  display: none;
}

/* Page header: tighter band; icon and subtitle hide and the title steps down to h2; button actions turn icon-only (keep the label in aria-label/title); a pill card turns into a flat full-width row, edge to edge like a --bleed card, with a square tile and no second line */
.mk-pagehead {
  gap: 12px;
  padding-top: 16px;
  padding-left: 16px;
  padding-right: 16px;
}

.mk-pagehead:not(.mk-pagehead--plain) {
  padding-bottom: 16px;
}

.mk-pagehead>.mk-heading {
  flex: 1 1 0;
  min-width: 0;
}

.mk-pagehead .mk-heading>.mk-icontile,
.mk-pagehead .mk-heading__sub {
  display: none;
}

.mk-pagehead .mk-heading {
  grid-template-columns: minmax(0,1fr);
}

.mk-pagehead .mk-heading--lg .mk-heading__title {
  font: var(--font-h2);
  letter-spacing: var(--tracking-h2);
}

.mk-pagehead--plain>.mk-heading {
  flex-basis: 100%;
}

.mk-pagehead__actions>.mk-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  font-size: 0;
  border-radius: var(--radius-md);
}

.mk-pagehead__actions>.mk-btn svg {
  width: 18px;
  height: 18px;
}

.mk-pagehead:has(>.mk-pagehead__actions>.mk-card--pill) {
  padding-bottom: 0;
}

.mk-pagehead__actions:has(>.mk-card--pill) {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0 -16px;
}

.mk-pagehead__actions>.mk-card--pill {
  flex: 1;
  min-width: 0;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

.mk-pagehead__actions>.mk-card--pill>.mk-icontile--round {
  border-radius: 14px;
}

.mk-pagehead__actions>.mk-card--pill>.mk-card__heading {
  flex: 1;
}

.mk-pagehead__actions>.mk-card--pill .mk-card__sub {
  display: none;
}

.mk-pagehead__actions>.mk-card--pill .mk-card__title {
  white-space: normal;
  line-height: 1.25;
  text-wrap: balance;
}

/* Editor header: tighter; the URL hides and the published state shows under the title; other actions move into the ⋯ menu (when the markup has one); save turns icon-only; tabs below go equal width with the icon over the label, scrolling past ~5 */
.mk-editorhead {
  gap: 8px;
  padding: 10px 12px;
}

.mk-editorhead__title {
  font-size: var(--text-lg);
}

.mk-editorhead__heading>.mk-meta>.mk-code,
.mk-editorhead__heading>.mk-meta>.mk-code+.mk-divider {
  display: none;
}

.mk-editorhead__state {
  display: inline-flex;
}

hr.mk-editorhead__state {
  display: block;
}

.mk-editorhead__actions:has(>.mk-editorhead__more)>:not(.mk-editorhead__more):not(.mk-btn--primary) {
  display: none;
}

.mk-editorhead__actions>.mk-editorhead__more {
  display: block;
}

.mk-editorhead__actions>.mk-btn--primary {
  width: 36px;
  padding: 0;
  gap: 0;
  font-size: 0;
  border-radius: var(--radius-md);
}

.mk-editorhead__actions>.mk-btn--primary svg {
  width: 17px;
  height: 17px;
}

.mk-editorhead+.mk-tabs {
  padding: 0 4px;
}

.mk-editorhead+.mk-tabs>.mk-tab {
  flex: 1 0 72px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 6px 8px;
  font-size: var(--text-sm);
}

.mk-editorhead+.mk-tabs>.mk-tab .mk-ico {
  width: 18px;
  height: 18px;
}

.mk-editorhead+.mk-tabs>.mk-tabs__spacer,
.mk-editorhead+.mk-tabs>.mk-tabs__sep {
  display: none;
}

/* Toolbar: every control takes its own full-width row (search, switcher, view switch share it evenly) */
.mk-toolbar {
  gap: 10px;
}

.mk-toolbar>*,
.mk-toolbar>.mk-toolbar__end {
  flex: 1 1 100%;
  min-width: 0;
  max-width: none;
  margin-left: 0;
}

.mk-toolbar>.mk-dropdown>.mk-switcher,
.mk-toolbar .mk-viewswitch {
  width: 100%;
}

.mk-toolbar .mk-viewswitch>label {
  flex: 1;
  justify-content: center;
}

.mk-toolbar>.mk-dropdown>.mk-switcher>.mk-chev {
  margin-left: auto;
}

/* Action bar: one row; back keeps its size, next takes the rest */
.mk-actionbar {
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.mk-actionbar>.mk-btn:not(.mk-btn--icon) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mk-actionbar>.mk-btn:first-child:not(:only-child) {
  flex: 0 0 auto;
}

/* Tabs: up to three tabs share the width */
.mk-tabs:not(:has(>.mk-tab:nth-of-type(4)))>.mk-tab {
  flex: 1;
  justify-content: center;
}

/* Card: tighter padding; a heading in the card head drops its large icon tile; a collapsible card's head keeps just its title; --bleed cards (single-column pages) run edge to edge, the app drops its page padding around them */
.mk-card:not(.mk-card--flush):not(.mk-card--pill) {
  padding: 16px;
}

.mk-card__head:has(>.mk-card__toggle) .mk-card__sub {
  display: none;
}

.mk-card__head:has(>.mk-card__toggle) {
  flex-wrap: nowrap;
  align-items: center;
}

.mk-card__head>.mk-card__toggle {
  flex-shrink: 0;
  margin-left: auto;
}

.mk-card__head:has(>.mk-card__toggle)>.mk-card__heading {
  flex: 1;
  min-width: 0;
}

.mk-card__head:has(>.mk-card__toggle) .mk-card__title {
  text-wrap: balance;
}

.mk-card__head>.mk-card__toggle {
  margin-right: calc(-1 * var(--space-3));
}

/* the hidden second line no longer takes a row: tile and title center on each other */
:is(.mk-card__head:has(>.mk-card__toggle),.mk-pagehead__actions>.mk-card--pill) .mk-card__heading>:is(.mk-icontile,.mk-avatar,.mk-ring) {
  grid-row: span 1;
}

:is(.mk-card__head:has(>.mk-card__toggle),.mk-pagehead__actions>.mk-card--pill) .mk-card__title {
  align-self: center;
}

.mk-card__head>.mk-heading>.mk-icontile--xl {
  display: none;
}

.mk-card__head>.mk-heading:has(>.mk-icontile--xl) {
  grid-template-columns: minmax(0,1fr);
}

.mk-card--bleed {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

/* List: a list card drops its card chrome and runs edge to edge, like a native list (the app removes its page padding around it); row text buttons hide, the row menu stays */
.mk-card--flush:has(>.mk-list) {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

.mk-card--flush>.mk-list>.mk-list__item {
  padding-left: 16px;
  padding-right: 16px;
}

.mk-card--flush:has(>.mk-list)>*,
.mk-card--flush:has(>.mk-list)>.mk-list>* {
  border-radius: 0;
}

.mk-list__actions>.mk-btn:not(.mk-btn--icon) {
  display: none;
}

/* Pagination: just the count and previous / next */
.mk-pagination {
  flex-wrap: nowrap;
}

.mk-pagination>.mk-page:not(.mk-page--arrow),
.mk-pagination>.mk-pagination__gap {
  display: none;
}

.mk-pagination>.mk-page--arrow {
  width: 40px;
  height: 40px;
}

/* Dropdown menu: opens as a bottom sheet, its title shows */
.mk-dropdown>.mk-menu {
  position: fixed;
  top: auto!important;
  left: 8px!important;
  right: 8px!important;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 140;
  width: auto!important;
  padding: 8px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-4);
}

.mk-dropdown>.mk-menu>.mk-menu__head {
  display: block;
}

/* Dialog: bottom sheet, footer buttons share the width (--full: full screen) */
.mk-scrim:not(.mk-scrim--end) {
  padding: 0;
  align-items: flex-end;
}

.mk-dialog {
  max-width: none;
  max-height: 92vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.mk-dialog__foot>.mk-btn {
  flex: 1;
}

.mk-wizard {
  padding: 20px 20px 24px;
}

/* Modal, --full dialog, search: full screen */
.mk-dialog--full,
.mk-scrim--top>.mk-dialog,
.mk-modal {
  max-width: none;
  max-height: none;
  height: 100%;
  border-radius: 0;
}

.mk-scrim:has(>.mk-modal),
.mk-scrim--top {
  align-items: stretch;
}

.mk-scrim--top>.mk-dialog {
  gap: 8px;
  padding: 12px 0 0;
}

.mk-scrim--top>.mk-dialog>* {
  margin: 0 12px;
}

.mk-scrim--top>.mk-dialog>.mk-dialog__body {
  flex: 1;
  margin: 0;
  padding: 0 12px calc(16px + env(safe-area-inset-bottom));
}

/* Drawer: full width, footer buttons share the width */
.mk-drawer {
  width: 100%;
  border-left: 0;
}

.mk-drawer__foot>.mk-btn:not(.mk-btn--icon) {
  flex: 1;
}

.mk-drawer__foot {
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

/* Toast: at the top, full width */
.mk-toaster {
  left: 12px;
  right: 12px;
  top: calc(12px + env(safe-area-inset-top));
  bottom: auto;
  transform: none;
}

.mk-toaster>.mk-toast {
  width: 100%;
  max-width: none;
}

/* Heading subs fill the line (pretty wrapping breaks early on narrow screens) */
.mk-heading__sub {
  text-wrap: wrap;
}

/* Badge: grows with the larger phone text */
.mk-badge:not(.mk-badge--plain) {
  height: auto;
  min-height: 26px;
  padding: 5px 10px;
}

.mk-badge--plain {
  height: auto;
}
