/* Local design adjustments kept separate from the recovered production bundle. */

.auth-screen__login {
  display: none;
}

.mk-system-result-card.result-view__result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 10px 14px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgb(0 0 0 / 14%);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.mk-system-result-card.result-view__result-card:hover {
  border-color: var(--border-2);
}

[data-theme="dark"] .mk-system-result-card.result-view__result-card {
  background: #151922;
  border-color: rgb(231 233 255 / 10%);
}

[data-theme="dark"] .mk-system-result-card .result-view__result-card-title {
  color: #f6f6f8;
}

[data-theme="dark"] .mk-system-result-card > .result-view__result-card-snippet {
  color: #acb0bd;
}

.mk-system-result-card .result-view__result-card-header,
.mk-system-result-card > .result-view__result-card-title {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  min-width: 0;
}

.mk-system-result-card .result-view__result-card-title {
  letter-spacing: -0.02em;
  font-size: clamp(18px, 5.2vw, 21px);
  line-height: 1.2;
  font-weight: 690;
}

.mk-system-result-card > .result-view__result-card-snippet {
  display: -webkit-box;
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  min-width: 0;
  overflow: hidden;
  font-size: clamp(13px, 3.8vw, 15px);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mk-system-result-card > .md-view,
.mk-system-result-card > .result-view__action-items,
.mk-system-result-card > .result-view__key-moments,
.mk-system-result-card > ol,
.mk-system-result-card > ul {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  margin-top: 4px;
}

.mk-system-result-card .result-view__result-card-collapse {
  display: none;
}

.mk-system-result-card .mk-system-result-card__actions {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: 44px 44px;
  grid-template-rows: 44px 44px;
  align-self: stretch;
  gap: 8px;
  width: 96px;
}

.mk-system-result-card .mk-system-result-card__actions > .download-menu {
  grid-column: 1;
  grid-row: 1;
  width: 44px;
  min-width: 44px;
}

.mk-system-result-card .mk-system-icon-button,
.mk-system-result-card .mk-system-result-card__actions > .mk-system-share-button,
.mk-system-result-card .mk-system-result-card__actions > .download-menu > .mk-system-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  color: #98a0ff;
  background: #2b315d;
  border: 0;
  border-radius: 11px;
  padding: 0;
  transition: background 160ms ease, transform 160ms ease;
}

/* mk-system-share-button: kept in place, styled like the other icon
   buttons (see rule above) and placed next to Download in the grid. */
.mk-system-result-card .mk-system-result-card__actions > .mk-system-share-button {
  grid-column: 2;
  grid-row: 1;
}

.mk-system-result-card .mk-system-result-card__actions > .download-menu > .mk-system-export-button {
  width: 96px;
  min-width: 96px;
  gap: 7px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 720;
}

.mk-system-result-card .mk-system-icon-button:hover,
.mk-system-result-card .mk-system-result-card__actions > .mk-system-share-button:hover,
.mk-system-result-card .mk-system-result-card__actions > .download-menu > .mk-system-icon-button:hover,
.mk-system-result-card .mk-system-detail-button:hover {
  background: #353c70;
}

.mk-system-result-card .mk-system-icon-button:active,
.mk-system-result-card .mk-system-result-card__actions > .mk-system-share-button:active,
.mk-system-result-card .mk-system-detail-button:active {
  transform: translateY(1px);
}

.mk-system-result-card .mk-system-icon-button img {
  display: block;
  width: 20px;
  height: 20px;
}

.mk-system-result-card .mk-system-icon-button:focus-visible,
.mk-system-result-card .mk-system-result-card__actions > .mk-system-share-button:focus-visible,
.mk-system-result-card .mk-system-detail-button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.mk-system-result-card .mk-system-result-card__actions > .mk-system-detail-button {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 96px;
  min-width: 96px;
  height: 44px;
  min-height: 44px;
  color: #98a0ff;
  background: #2b315d;
  border: 0;
  border-radius: 11px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
}

body.mk-system-result-modal-open {
  overflow: hidden;
}

.mk-system-result-modal[hidden] {
  display: none;
}

.mk-system-result-modal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(5 7 12 / 78%);
  padding: 20px;
  backdrop-filter: blur(6px);
}

.mk-system-result-modal__shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(860px, 100%);
  height: min(820px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  min-height: 360px;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgb(0 0 0 / 45%);
}

[data-theme="dark"] .mk-system-result-modal__shell {
  background: #151922;
  border-color: rgb(231 233 255 / 12%);
}

.mk-system-result-modal__header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  gap: 14px;
  padding: 22px 24px 18px;
  background: inherit;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 24px rgb(0 0 0 / 8%);
}

.mk-system-result-modal__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.mk-system-result-modal__top h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.025em;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.2;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.mk-system-result-modal__close {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  background: var(--surface-2);
  border: 0;
  border-radius: 12px;
}

.mk-system-result-modal__close:hover {
  background: var(--surface-3);
}

.mk-system-result-modal__close img,
.mk-system-result-modal__action img {
  display: block;
  width: 20px;
  height: 20px;
}

.mk-system-result-modal__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 8px;
}

/* Format picker and share modal opened from the result modal sit above it. */
.mk-system-result-modal-open .download-menu__backdrop,
.mk-system-result-modal-open .download-menu__panel,
.mk-system-result-modal-open .settings-modal__backdrop {
  z-index: 310;
}

.mk-system-result-modal-open .download-menu__panel--sheet {
  z-index: 311;
}

.mk-system-result-modal__action,
.mk-system-result-modal__rename-save,
.mk-system-result-modal__rename-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  color: #98a0ff;
  background: #2b315d;
  border: 0;
  border-radius: 11px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.mk-system-result-modal__action:hover,
.mk-system-result-modal__rename-save:hover,
.mk-system-result-modal__rename-cancel:hover {
  background: #353c70;
}

.mk-system-result-modal__close:focus-visible,
.mk-system-result-modal__action:focus-visible,
.mk-system-result-modal__rename-input:focus-visible,
.mk-system-result-modal__rename-save:focus-visible,
.mk-system-result-modal__rename-cancel:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.mk-system-result-modal__rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.mk-system-result-modal__rename-form[hidden] {
  display: none;
}

.mk-system-result-modal__rename-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 11px;
  outline: 0;
  padding: 0 13px;
  font-size: 16px;
}

.mk-system-result-modal__rename-save,
.mk-system-result-modal__rename-cancel {
  padding-inline: 12px;
}

.mk-system-result-modal__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px;
  font-size: 16px;
  line-height: 1.65;
}

.mk-system-result-modal__body > :first-child {
  margin-top: 0;
}

.mk-system-result-modal__body > :last-child {
  margin-bottom: 0;
}

.mk-system-result-modal__body .md-view {
  font-size: inherit;
  line-height: inherit;
}

.mk-system-result-modal__body .result-view__action-items,
.mk-system-result-modal__body .result-view__key-moments,
.mk-system-result-modal__body > ol,
.mk-system-result-modal__body > ul {
  margin: 0;
}

.mk-system-result-modal__body::-webkit-scrollbar {
  width: 10px;
}

.mk-system-result-modal__body::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border: 3px solid transparent;
  border-radius: 10px;
  background-clip: content-box;
}

.mk-system-toast {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  left: 50%;
  max-width: calc(100vw - 32px);
  color: var(--bg);
  background: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mk-system-toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mk-clipboard-paste__dropzone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mk-clipboard-paste__group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.mk-clipboard-paste {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--border));
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.mk-clipboard-paste:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent-soft) 78%, var(--accent));
}

.mk-clipboard-paste:active {
  transform: translateY(1px);
}

.mk-clipboard-paste:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.mk-clipboard-paste:disabled {
  opacity: 0.6;
  cursor: wait;
}

.mk-clipboard-paste__link-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mk-clipboard-paste--link {
  width: 100%;
  min-height: 44px;
  color: var(--text-2);
  background: var(--bg);
  border-color: var(--border-2);
}

.mk-clipboard-paste__shortcut {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.3;
}

.mk-result-preview .cookie-banner,
.mk-result-preview .result-view__process-more {
  display: none;
}

@media (width <= 900px) {
  .auth-screen__form {
    order: 1;
    position: relative;
    padding-top: 104px;
  }

  .auth-screen__aside {
    order: 2;
  }

  .auth-screen__form > .logo {
    position: absolute;
    top: 24px;
    left: 24px;
    margin: 0;
  }

  .auth-screen__lang {
    top: 24px;
    right: 24px;
    gap: 8px;
  }

  .auth-screen__lang .simple-theme-toggle {
    display: none;
  }

  .auth-screen__lang .lang-switcher__btn {
    height: 44px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 4px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
  }

  .auth-screen__lang .lang-switcher__caret {
    display: none;
  }

  .auth-screen__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    color: var(--on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 12px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
  }

  .auth-screen__login:hover {
    background: var(--accent-2);
  }
}

@media (width <= 390px) {
  .mk-system-result-card.result-view__result-card {
    gap: 10px 12px;
    padding: 16px;
  }

  .mk-system-result-card .result-view__result-card-title {
    font-size: 18px;
  }

  .mk-system-result-card > .result-view__result-card-snippet {
    font-size: 13px;
  }
}

/* The source-type badge repeats information users already get from the row.
   Removing it gives the title the full first column without disturbing the
   selection checkbox spacing when bulk-select mode is active. */
.job-row__badge {
  display: none;
}

.job-row__cell--actions > .icon-btn--pencil {
  display: none;
}

.job-row__title--clickable {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

/* The result title itself owns rename now, leaving only the two primary file
   actions in the header. */
.result-view__header > .icon-btn--pencil {
  display: none !important;
}

.mk-result-title--renamable {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.mk-result-title--renamable:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 4px;
  border-radius: 5px;
}

/* One clear mobile account entry replaces the separate top-up and settings
   buttons. The existing account actions are presented as a bottom sheet. */
.header-bar__mobile-controls > .header-topup-btn--icon {
  display: none !important;
}

.header-bar__mobile-controls {
  gap: 0;
}

.mobile-gear-menu__trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: linear-gradient(145deg, #9b8cff, #7165e8);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgb(113 101 232 / 28%);
}

.mobile-gear-menu__trigger:hover {
  border-color: transparent;
  background: linear-gradient(145deg, #aaa0ff, #7c70ee);
}

.mobile-gear-menu__trigger:active {
  transform: translateY(1px);
}

.mobile-gear-menu__trigger:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.mobile-gear-menu__trigger svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-gear-menu__panel {
  top: auto;
  right: 50%;
  bottom: 0;
  width: min(100%, 520px);
  max-width: 100%;
  max-height: min(86dvh, 720px);
  gap: 14px;
  padding: 34px 20px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 48px rgb(0 0 0 / 28%);
  transform: translate(50%, 100%);
}

.mobile-gear-menu__panel::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 42px;
  height: 4px;
  background: var(--border-2);
  border-radius: 999px;
  transform: translateX(-50%);
}

.mobile-gear-menu__panel.is-open {
  transform: translate(50%, 0);
}

.mobile-gear-menu__close {
  top: 15px;
  right: 16px;
  left: auto;
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.mobile-gear-menu__panel .account-menu__email {
  order: 1;
  padding-right: 36px;
  font-size: 17px;
}

.mobile-gear-menu__panel .account-menu__usage {
  position: relative;
  order: 2;
  min-height: 74px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 14px 112px 14px 14px;
}

.mobile-gear-menu__panel .account-menu__usage::after {
  content: attr(data-mk-action-label);
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-50%);
}

.mobile-gear-menu__panel .account-menu__usage > .mono {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.mobile-gear-menu__panel .mobile-gear-menu__row {
  min-height: 48px;
  background: var(--surface-2);
  border-radius: 13px;
  padding: 8px 12px;
}

.mobile-gear-menu__panel .mobile-gear-menu__langs {
  gap: 8px;
}

.mobile-gear-menu__panel .mobile-gear-menu__lang {
  flex: 1;
  min-width: 52px;
  min-height: 38px;
  text-align: center;
  border-radius: 10px;
}

.mobile-gear-menu__panel > .btn {
  min-height: 48px;
  border-radius: 13px;
}

/* Download formats use the same compact bottom-sheet language as the account
   menu. The original buttons stay wired to React; only their order and visual
   presentation are adjusted here. */
.download-menu__option.mk-download-format--hidden {
  display: none !important;
}

body.mk-export-sheet-open {
  overflow: hidden;
}

.download-menu__panel--sheet {
  right: auto;
  left: 50%;
  width: min(100%, 520px);
  max-width: 100%;
  max-height: min(86dvh, 720px);
  gap: 0;
  padding: 34px 20px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  animation: 220ms cubic-bezier(.2, .8, .2, 1) both mk-download-sheet-slide-in;
  box-shadow: 0 -18px 48px rgb(0 0 0 / 28%);
}

@keyframes mk-download-sheet-slide-in {
  from {
    transform: translate(-50%, 100%);
  }

  to {
    transform: translate(-50%, 0);
  }
}

.download-menu__panel--sheet::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 42px;
  height: 4px;
  background: var(--border-2);
  border-radius: 999px;
  transform: translateX(-50%);
}

.download-menu__panel--sheet .download-menu__title {
  min-height: 38px;
  color: var(--text);
  padding: 2px 52px 12px 0;
  font-family: inherit;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.015em;
}

.mk-export-sheet-close {
  position: absolute;
  top: 20px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 12px;
  padding: 0;
}

.mk-export-sheet-close img {
  display: block;
  width: 20px;
  height: 20px;
}

.mk-export-sheet-close:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.download-menu__panel--sheet .mk-download-sheet-option:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

.download-menu__panel--sheet .mk-download-sheet-option {
  justify-content: flex-start;
  min-height: 62px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 0;
  gap: 12px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 680;
}

.download-menu__panel--sheet .mk-download-option--first {
  border-radius: 15px 15px 0 0;
}

.download-menu__panel--sheet .mk-download-option--last {
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 15px 15px;
}

.download-menu__panel--sheet .mk-download-option--first.mk-download-option--last {
  border-radius: 15px;
}

.download-menu__panel--sheet .mk-download-sheet-option:hover {
  background: color-mix(in oklab, var(--accent) 8%, var(--surface-2));
}

.download-menu__panel--sheet .mk-download-sheet-option:active {
  background: color-mix(in oklab, var(--accent) 13%, var(--surface-2));
}

.download-menu__panel--sheet .mk-download-back-option {
  align-self: flex-start;
  min-height: 34px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 9px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 680;
}

.mk-export-text-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 66px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 8px 9px 8px 8px;
  text-align: left;
}

.mk-export-text-action__copy {
  order: 1;
}

.mk-export-text-action:hover,
.mk-export-text-action:active {
  background: color-mix(in oklab, var(--accent) 9%, var(--surface-2));
}

.mk-export-text-action--compact {
  display: inline-flex;
  width: auto;
  min-height: auto;
  margin-top: 14px;
  background: none;
  border: 0;
  padding: 6px 2px;
}

.mk-export-text-action--compact:hover,
.mk-export-text-action--compact:active {
  background: none;
  text-decoration: underline;
}

.mk-export-text-action--compact .mk-export-text-action__icon {
  display: none;
}

.mk-export-text-action--compact .mk-export-text-action__copy {
  gap: 0;
}

.mk-export-text-action--compact .mk-export-text-action__copy strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  white-space: normal;
}

.mk-export-text-action--compact .mk-export-text-action__copy small {
  display: block;
  color: var(--text-3);
  font-size: 11px;
}

.mk-export-text-action:focus-visible,
.mk-export-format-download:focus-visible,
.mk-export-format-share:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.mk-export-text-action__icon {
  order: 2;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  border-radius: 11px;
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 7%, transparent);
}

.mk-export-text-action__icon img,
.mk-export-format-share__visual img {
  width: 20px;
  height: 20px;
}

.mk-export-text-action__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mk-export-text-action__copy strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-export-text-action__copy small {
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-export-files-label {
  margin: 18px 0 8px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mk-export-format-list {
  display: grid;
}

.mk-export-format-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: center;
  gap: 2px;
  min-height: 66px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: 0;
  padding: 8px 9px 8px 8px;
}

.mk-export-format-row--download-only {
  grid-template-columns: minmax(0, 1fr);
}

.mk-export-format-row.mk-download-option--first {
  border-radius: 15px 15px 0 0;
}

.mk-export-format-row.mk-download-option--last {
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 15px 15px;
}

.mk-export-format-row.mk-download-option--first.mk-download-option--last {
  border-radius: 15px;
}

.mk-export-format-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-menu__panel--sheet .mk-export-format-download {
  display: grid !important;
  align-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 11px;
  padding: 6px 8px !important;
  text-align: left;
}

.mk-export-format-download__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mk-export-format-hint {
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-menu__panel--sheet .mk-export-format-share {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  width: 60px;
  min-width: 60px;
  height: 58px;
  min-height: 58px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 15px;
  padding: 0 !important;
  text-align: center;
  line-height: 0;
}

.mk-export-format-share__visual {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  border-radius: 11px;
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 7%, transparent);
}

.download-menu__panel--sheet .mk-export-format-share__visual img {
  display: block;
  flex: 0 0 20px;
  margin: 0 !important;
}

.download-menu__panel--sheet .mk-export-format-share[hidden] {
  display: none !important;
}

.mk-combined-export-status {
  min-height: 18px;
  margin: -8px 0 12px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
}

.download-menu__panel--sheet .mk-export-format-download:hover {
  background: color-mix(in oklab, var(--accent) 9%, transparent);
}

.download-menu__panel--sheet .mk-export-format-share:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}

.download-menu__panel--sheet .mk-export-format-download:disabled,
.download-menu__panel--sheet .mk-export-format-share:disabled,
.mk-export-text-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.mk-download-format__icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 11px;
}

.mk-download-format__icon img {
  width: 20px;
  height: 20px;
}

/* Keep the original React controls as the source of truth, but expose them
   through a shorter, task-oriented account menu. */
.mobile-gear-menu__panel .mk-account-original-theme,
.mobile-gear-menu__panel .mk-account-original-languages,
.mobile-gear-menu__panel > .mk-account-original-settings,
.mobile-gear-menu__panel > .mk-account-original-logout {
  display: none !important;
}

.mk-account-menu {
  display: grid;
  order: 3;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.mk-account-menu__item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.mk-account-menu__item:last-child {
  border-bottom: 0;
}

.mk-account-menu__item:hover {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}

.mk-account-menu__item:active {
  background: color-mix(in oklab, var(--accent) 13%, transparent);
}

.mk-account-menu__item:focus-visible,
.mk-account-subview__back:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

.mk-account-menu__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 11px;
}

.mk-account-menu__icon svg {
  width: 21px;
  height: 21px;
}

.mk-account-menu__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mk-account-menu__label {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-account-menu__detail {
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mk-account-menu__chevron {
  color: var(--text-2);
  font-size: 28px;
  line-height: 1;
}

.mk-account-menu__item--logout {
  color: var(--err);
}

.mk-account-menu__item--logout .mk-account-menu__icon {
  color: var(--err);
  background: color-mix(in oklab, var(--err) 12%, transparent);
}

.mk-account-menu__item--logout .mk-account-menu__chevron {
  visibility: hidden;
}

.mk-account-subview,
.mk-account-section-label {
  display: none;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .account-menu__email,
.mobile-gear-menu__panel.mk-account-sheet--appearance .account-menu__usage,
.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-menu {
  display: none;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-subview {
  display: flex;
  order: 1;
  align-items: center;
  min-height: 44px;
  padding-right: 34px;
}

.mk-account-subview__back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 11px;
  padding: 0 0 3px;
  font-size: 34px;
  line-height: 1;
}

.mk-account-subview h2 {
  flex: 1;
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  text-align: center;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-section-label {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-section-label--theme {
  order: 2;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-original-theme {
  display: flex !important;
  order: 3;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-section-label--language {
  order: 4;
  margin-top: 4px;
}

.mobile-gear-menu__panel.mk-account-sheet--appearance .mk-account-original-languages {
  display: flex !important;
  order: 5;
}

/* A profile entry contains both personal data and password. Balance and
   integrations open as focused screens instead of returning to four tabs. */
.settings-modal.mk-settings-modal--profile .settings-modal__tabs > button:nth-child(n + 3),
.settings-modal.mk-settings-modal--payments .settings-modal__tabs,
.settings-modal.mk-settings-modal--integrations .settings-modal__tabs {
  display: none;
}

.settings-modal.mk-settings-modal--profile .settings-modal__tabs {
  align-self: stretch;
  width: 100%;
}

.settings-modal.mk-settings-modal--profile .settings-modal__tabs > button {
  flex: 1;
}

@media (width > 720px) {
  .job-row__main {
    grid-template-columns: minmax(220px, 1fr) 110px 80px 160px auto;
  }
}

@media (width <= 800px) {
  .result-view__header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    grid-template-rows: minmax(44px, auto);
    align-items: start;
    gap: 8px;
  }

  .result-view__header > .result-view__back {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .result-view__header > .result-view__header-text {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .result-view__header > .result-view__header-text h1,
  .result-view__header > .result-view__header-text .text-muted {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .result-view__header > .download-menu {
    grid-column: 3;
    grid-row: 1;
    justify-self: stretch;
    width: 44px;
    height: 44px;
  }

  .result-view__header > .icon-btn--folder {
    grid-column: 4;
    grid-row: 1;
  }

  .result-view__header > .download-menu > button,
  .result-view__header > .icon-btn--folder {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 11px;
  }

  .result-view__mobile-results,
  .result-view__mobile-extras {
    gap: 18px;
  }

  .result-view__mobile-results > .mk-system-result-card,
  .result-view__mobile-extras > .mk-system-result-card {
    margin-bottom: 0;
  }

  .result-view > .result-view__headline.mk-system-result-card {
    margin-bottom: 0;
  }

  .result-view__player audio {
    display: block;
    min-height: 54px;
  }

  .mk-system-result-modal {
    align-items: flex-end;
    padding: 12px 0 0;
  }

  .mk-system-result-modal__shell {
    width: 100%;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    min-height: 0;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
  }

  .mk-system-result-modal__header {
    gap: 12px;
    padding: 18px 16px 14px;
  }

  .mk-system-result-modal__top h2 {
    font-size: 23px;
  }

  .mk-system-result-modal__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mk-export-format-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 2px;
    padding-right: 4px;
  }

  .mk-export-format-row--download-only {
    grid-template-columns: minmax(0, 1fr);
  }

  .download-menu__panel--sheet .mk-export-format-share {
    width: 58px;
    min-width: 58px;
    height: 56px;
    min-height: 56px;
  }

  .mk-system-result-modal__action {
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 60px;
    padding: 6px 4px;
    font-size: 11.5px;
  }

  .mk-system-result-modal__rename-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mk-system-result-modal__rename-cancel {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  .mk-system-result-modal__body {
    padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
    font-size: 15.5px;
  }

  .mk-clipboard-paste {
    min-height: 44px;
    font-size: 13.5px;
  }

  .console__link > .mk-clipboard-paste--link {
    order: 4;
  }

  .console__badges-wrap {
    order: 5;
  }

  .console__body > .console__info,
  .console__body > .console__section,
  .console__body > .console__estimate,
  .console__body > .console__insufficient-banner {
    order: 6;
  }

  .console__submit {
    order: 7;
  }
}

@media (width <= 420px) {
  .auth-screen__form > .logo {
    left: 16px;
  }

  .auth-screen__lang {
    right: 16px;
  }

  .auth-screen__login {
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-system-result-card *,
  .mk-system-toast {
    transition: none;
  }
}
