/* Moresim cabinet design system. Tokens and components follow the design mockups in moresim-site/project. */

:root {
  --ms-ink: #14162E;
  --ms-paper: #F7F4ED;
  --ms-white: #FFFFFF;
  --ms-accent: #FF6A3D;
  --ms-accent-dark: #B23F1C;
  --ms-lime: #C6F24E;
  --ms-sand: #EDEAE0;
  --ms-muted: #5A5E78;
  --ms-placeholder: #9A9DB0;
  --ms-success: #7E9B4A;
  --ms-warning: #E0B94A;
  --ms-line: rgba(20, 22, 46, .1);
  --ms-line-strong: rgba(20, 22, 46, .16);
  --ms-font-display: "Unbounded", system-ui, sans-serif;
  --ms-font-text: "Golos Text", system-ui, sans-serif;
  --ms-radius-sm: 14px;
  --ms-radius: 16px;
  --ms-radius-md: 22px;
  --ms-radius-lg: 24px;
  --ms-radius-pill: 999px;
  --ms-shadow-accent: 0 10px 24px rgba(255, 106, 61, .28);
  --ms-ease: cubic-bezier(.2, .85, .2, 1);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ms-body { margin: 0; min-height: 100vh; background: var(--ms-paper); color: var(--ms-ink); font-family: var(--ms-font-text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.ms-body img { max-width: 100%; height: auto; }
:where(.ms-body) a { color: var(--ms-ink); text-decoration: none; transition: color .2s; }
:where(.ms-body) a:hover { color: var(--ms-accent); }
.ms-body ::selection { background: var(--ms-lime); }
.ms-body :focus-visible { outline: 3px solid var(--ms-accent); outline-offset: 2px; }
.ms-body [hidden] { display: none !important; }
.ms-skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; padding: 10px 16px; border-radius: var(--ms-radius-pill); background: var(--ms-ink); color: var(--ms-paper); }
.ms-skip-link:focus { top: 12px; color: var(--ms-paper); }

/* Typography */
.ms-h1, .ms-h2, .ms-h3 { margin: 0; font-family: var(--ms-font-display); font-weight: 600; letter-spacing: -.03em; }
.ms-h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.ms-h2 { margin-bottom: 8px; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.15; }
.ms-h3 { font-size: 20px; line-height: 1.2; }
.ms-lead { margin: 0 0 26px; font-size: 16px; line-height: 1.5; color: var(--ms-muted); }
.ms-note { margin: 18px 0 0; font-size: 14px; line-height: 1.5; color: var(--ms-muted); }
.ms-muted { color: var(--ms-muted); font-size: 14px; }
.ms-note p { margin: 0 0 8px; }
.ms-kicker { font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ms-muted); }
.ms-link { font-weight: 600; color: var(--ms-accent); }
:where(.ms-body) .ms-link { color: var(--ms-accent); }
:where(.ms-body) .ms-link:hover { color: var(--ms-accent-dark); }
:where(.ms-body) .ms-link--muted { color: var(--ms-muted); }
:where(.ms-body) .ms-link--muted:hover { color: var(--ms-ink); }

/* Buttons */
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 24px; border: 1.5px solid transparent; border-radius: var(--ms-radius-pill); font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; transition: transform .25s, box-shadow .25s, background-color .25s, border-color .25s, color .25s; }
.ms-btn:hover { transform: translateY(-2px); }
.ms-btn:disabled, .ms-btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; transform: none; }
.ms-btn.is-busy { pointer-events: none; opacity: .75; }
.ms-btn--accent { background: var(--ms-accent); color: #fff; box-shadow: var(--ms-shadow-accent); }
.ms-btn--accent:hover { color: #fff; box-shadow: 0 16px 32px rgba(255, 106, 61, .36); }
.ms-btn--ink { background: var(--ms-ink); color: var(--ms-paper); }
.ms-btn--ink:hover { background: var(--ms-accent); color: #fff; }
.ms-btn--lime { background: var(--ms-lime); color: var(--ms-ink); }
.ms-btn--lime:hover { color: var(--ms-ink); }
.ms-btn--outline { background: transparent; border-color: var(--ms-ink); color: var(--ms-ink); }
.ms-btn--outline:hover { background: var(--ms-ink); color: var(--ms-paper); }
.ms-btn--ghost { background: transparent; border-color: var(--ms-line-strong); color: var(--ms-muted); }
.ms-btn--ghost:hover { border-color: var(--ms-ink); color: var(--ms-ink); }
.ms-btn--sm { padding: 10px 16px; font-size: 14px; }
.ms-btn--block { width: 100%; }

/* Forms */
.ms-form { display: grid; gap: 16px; }
.ms-form__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ms-field { position: relative; display: grid; gap: 8px; align-content: start; }
.ms-field__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ms-field__label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ms-muted); }
.ms-field__action { padding: 0; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ms-accent); cursor: pointer; }
.ms-field__hint { margin: 0; font-size: 13px; color: var(--ms-muted); }
.ms-field__error { margin: 0; font-size: 13px; font-weight: 600; color: var(--ms-accent-dark); }
.ms-input { width: 100%; min-height: 54px; padding: 14px 18px; border: 1.5px solid var(--ms-line-strong); border-radius: var(--ms-radius); background: var(--ms-white); color: var(--ms-ink); font: inherit; font-size: 16px; outline: none; appearance: none; transition: border-color .25s, box-shadow .25s; }
.ms-input::placeholder { color: var(--ms-placeholder); }
.ms-input:focus { border-color: var(--ms-ink); box-shadow: 0 0 0 3px rgba(20, 22, 46, .08); }
.ms-input[aria-invalid="true"] { border-color: var(--ms-accent); }
.ms-input[readonly] { background: var(--ms-sand); }
.ms-select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2314162E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; }
.ms-input-group { display: flex; align-items: stretch; }
.ms-input-group__addon { display: grid; place-items: center; min-width: 64px; padding: 0 12px; border: 1.5px solid var(--ms-line-strong); border-right: 0; border-radius: var(--ms-radius) 0 0 var(--ms-radius); background: var(--ms-sand); font-weight: 600; }
.ms-input-group .ms-input { border-radius: 0 var(--ms-radius) var(--ms-radius) 0; }
.ms-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; }
.ms-stack { display: grid; gap: 10px; }

/* Captcha markup rendered by the shared partials/captcha view */
.ms-form .form-group, .ms-form .mb-2, .ms-form .mb-3 { display: grid; gap: 8px; }
.ms-form .form-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ms-muted); }
.ms-form .form-control { width: 100%; min-height: 54px; padding: 14px 18px; border: 1.5px solid var(--ms-line-strong); border-radius: var(--ms-radius); background: var(--ms-white); font: inherit; }

/* Sign-up bot trap (partials/ui/bot_trap): off screen for people, still an input for bots */
.ms-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Checkbox */
.ms-check { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.ms-check__input { position: absolute; top: 0; left: 0; width: 22px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
.ms-check__box { display: grid; flex-shrink: 0; place-items: center; width: 22px; height: 22px; border: 1.5px solid rgba(20, 22, 46, .3); border-radius: 7px; transition: background-color .2s, border-color .2s; }
.ms-check__input:checked + .ms-check__box { background: var(--ms-lime); border-color: var(--ms-ink); }
.ms-check__input:checked + .ms-check__box::after { content: "✓"; font-size: 13px; font-weight: 700; color: var(--ms-ink); }
.ms-check__input:focus-visible + .ms-check__box { outline: 3px solid var(--ms-accent); outline-offset: 2px; }

/* Password strength meter */
.ms-strength { display: flex; align-items: center; gap: 6px; }
.ms-strength__bar { flex: 1; height: 4px; border-radius: var(--ms-radius-pill); background: rgba(20, 22, 46, .12); transition: background-color .25s; }
.ms-strength__label { min-width: 84px; font-size: 12px; text-align: right; color: var(--ms-muted); }
.ms-strength[data-score="1"] .ms-strength__bar:nth-child(-n+1) { background: var(--ms-accent); }
.ms-strength[data-score="2"] .ms-strength__bar:nth-child(-n+2) { background: var(--ms-warning); }
.ms-strength[data-score="3"] .ms-strength__bar:nth-child(-n+3) { background: var(--ms-success); }

/* Segmented switch */
.ms-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 28px; padding: 5px; border-radius: var(--ms-radius-pill); background: var(--ms-sand); }
.ms-switch__item { display: block; padding: 12px; border-radius: var(--ms-radius-pill); font-size: 15px; font-weight: 600; text-align: center; transition: background-color .3s var(--ms-ease), color .3s; }
:where(.ms-body) .ms-switch__item.is-active { background: var(--ms-ink); color: var(--ms-paper); }

/* Divider and alerts */
.ms-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 14px; font-size: 13px; color: var(--ms-muted); }
.ms-divider::before, .ms-divider::after { content: ""; flex: 1; height: 1px; background: var(--ms-line-strong); }
.ms-social-icon { width: 20px; height: 20px; flex: none; }
/* Sign-in buttons keep one line: on the narrowest phones the longest label, «Продолжить через Яндекс ID», would wrap */
.ms-btn--social { white-space: nowrap; }
@media (max-width: 374px) { .ms-btn--social { gap: 8px; padding-inline: 14px; font-size: 15px; } }
.ms-alert { padding: 12px 16px; border: 1px solid transparent; border-radius: var(--ms-radius-sm); font-size: 14px; line-height: 1.5; }
.ms-alert--error { background: rgba(255, 106, 61, .12); border-color: rgba(255, 106, 61, .4); color: var(--ms-accent-dark); }
.ms-alert--info { background: var(--ms-sand); border-color: var(--ms-line); color: var(--ms-ink); }
.ms-alert--success { background: rgba(198, 242, 78, .35); border-color: rgba(126, 155, 74, .5); color: var(--ms-ink); }

/* Verification code */
.ms-code { position: relative; }
.ms-code__input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; opacity: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.ms-code__boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ms-code__box { display: grid; place-items: center; max-height: 64px; aspect-ratio: 1 / 1.15; border: 1.5px solid var(--ms-line-strong); border-radius: var(--ms-radius-sm); background: var(--ms-white); font-family: var(--ms-font-display); font-size: 22px; font-weight: 600; transition: border-color .2s, box-shadow .2s; }
.ms-code__box.is-filled { border-color: var(--ms-ink); }
.ms-code:focus-within .ms-code__box.is-current { border-color: var(--ms-accent); box-shadow: 0 0 0 3px rgba(255, 106, 61, .15); }

/* Logo (wordmark files come from the static MoreSim site) */
.ms-logo { display: inline-flex; align-items: center; width: max-content; }
.ms-logo__image { display: block; width: auto; height: 34px; }
/* .ms-body img sets height:auto at a higher specificity, which collapses the
   max-content logo link to 0x0 - restate the size with the same weight */
.ms-body .ms-logo__image { width: auto; height: 34px; max-width: none; }

/* Guest layout (auth screens) */
.ms-guest { display: grid; min-height: 100vh; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.ms-guest__aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 36px; min-height: 420px; padding: clamp(26px, 4vw, 48px); overflow: hidden; background: var(--ms-ink); color: var(--ms-paper); }
.ms-guest__pitch { position: relative; z-index: 2; max-width: 38ch; }
.ms-guest__title { margin: 0 0 16px; font-family: var(--ms-font-display); font-size: clamp(26px, 3.2vw, 40px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; }
.ms-guest__text { margin: 0 0 26px; font-size: 17px; line-height: 1.55; opacity: .74; }
.ms-checklist { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ms-checklist li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.ms-checklist li::before { content: "✓"; display: grid; flex-shrink: 0; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ms-lime); color: var(--ms-ink); font-size: 13px; font-weight: 700; }
.ms-guest__orbit { position: absolute; right: -140px; bottom: -140px; display: grid; place-items: center; width: 420px; height: 420px; opacity: .9; pointer-events: none; }
.ms-guest__globe { position: absolute; width: 44%; animation: ms-orbit 90s linear infinite; }
.ms-guest__pulse { position: absolute; width: 44%; aspect-ratio: 1; border: 2px solid rgba(198, 242, 78, .4); border-radius: 50%; animation: ms-pulse 3.2s ease-out infinite; }
.ms-guest__ring { position: absolute; aspect-ratio: 1; border-radius: 50%; }
.ms-guest__ring--inner { width: 62%; border: 1px solid rgba(247, 244, 237, .16); animation: ms-orbit 22s linear infinite; }
.ms-guest__ring--outer { width: 86%; border: 1px dashed rgba(247, 244, 237, .14); animation: ms-orbit-reverse 38s linear infinite; }
.ms-guest__plane { position: absolute; top: -15px; left: 50%; width: 30px; margin-left: -15px; transform: rotate(45deg); opacity: .9; }
.ms-guest__sim { position: absolute; z-index: 3; width: 13%; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .55)); }
.ms-guest__panel { display: flex; align-items: center; justify-content: center; padding: clamp(26px, 4vw, 48px); }
.ms-guest__inner { width: 100%; max-width: 440px; }
.ms-guest--wide .ms-guest__inner { max-width: 560px; }
.ms-guest__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; font-size: 14px; }
.ms-guest__help { font-size: 13px; color: var(--ms-muted); }
.ms-closed { display: grid; justify-items: start; gap: 12px; }
@media (max-width: 880px) {
  .ms-guest__aside { gap: 18px; min-height: 0; }
  .ms-guest__text, .ms-checklist { display: none; }
  .ms-guest__orbit { right: -110px; bottom: -110px; width: 300px; height: 300px; opacity: .5; }
}

/* Toasts */
.ms-toasts { position: fixed; top: 16px; right: 16px; left: 16px; z-index: 150; display: grid; justify-items: end; gap: 10px; pointer-events: none; }
.ms-toast { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; width: min(380px, 100%); padding: 14px 16px; border-radius: 18px; background: var(--ms-ink); color: var(--ms-paper); box-shadow: 0 20px 44px rgba(20, 22, 46, .3); pointer-events: auto; animation: ms-rise-in .3s var(--ms-ease); }
.ms-toast.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
.ms-toast__dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--ms-lime); }
.ms-toast--error .ms-toast__dot { background: var(--ms-accent); }
.ms-toast--warning .ms-toast__dot { background: var(--ms-warning); }
.ms-toast--info .ms-toast__dot { background: #8FB8FF; }
.ms-toast__title { display: block; font-size: 14px; font-weight: 700; }
.ms-toast__message { margin: 2px 0 0; font-size: 14px; opacity: .85; overflow-wrap: anywhere; }
.ms-toast__close { padding: 2px; border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; opacity: .7; cursor: pointer; }

/* Cookie banner. moresim.js reserves its height (.ms-body--cookie) while it is shown. On a phone it is a bar on
   the TOP edge: at the bottom it sat on the «Pay» button of the express checkout on first load (iPhone 13: 77 % of
   the button hidden, a 360×640 Android: all of it), and the reserved padding only helped someone who scrolled */
.ms-cookie { position: fixed; left: 16px; bottom: 16px; z-index: 140; display: grid; gap: 14px; width: min(420px, calc(100% - 32px)); padding: 18px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-md); background: var(--ms-white); box-shadow: 0 20px 50px rgba(20, 22, 46, .18); }
.ms-cookie__text { margin: 0; font-size: 14px; color: var(--ms-muted); }
.ms-body--cookie { padding-bottom: var(--ms-cookie-h, 0px); }
@media (max-width: 640px) {
  .ms-cookie { top: 0; left: 0; right: 0; bottom: auto; width: auto; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; border-top: 0; border-radius: 0 0 var(--ms-radius-md) var(--ms-radius-md); }
  .ms-body--cookie { padding-bottom: 0; padding-top: var(--ms-cookie-h, 0px); }
  .ms-cookie__text { font-size: 13px; line-height: 1.35; }
}

/* Cabinet shell */
.ms-cabinet { min-height: 100vh; }
.ms-topbar { position: sticky; top: 0; z-index: 60; border-bottom: 1px solid var(--ms-line); background: rgba(247, 244, 237, .92); backdrop-filter: blur(12px); }
.ms-topbar__inner { display: flex; align-items: center; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 14px 20px; }
.ms-topbar .ms-logo__image { height: 30px; }
.ms-topbar__side { display: flex; flex-shrink: 0; align-items: center; gap: 10px; margin-left: auto; }
.ms-nav { display: flex; flex: 1 1 auto; gap: 22px; min-width: 0; padding: 2px 0; overflow-x: auto; scrollbar-width: none; font-size: 15px; font-weight: 500; }
.ms-nav::-webkit-scrollbar { display: none; }
.ms-nav__link { white-space: nowrap; }
:where(.ms-body) .ms-nav__link.is-active { color: var(--ms-accent); font-weight: 600; }
.ms-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--ms-line-strong); border-radius: var(--ms-radius-pill); font-size: 14px; white-space: nowrap; }
.ms-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ms-lime); animation: ms-blink 2s infinite; }
.ms-pill__count { font-weight: 700; }
.ms-menu { position: relative; }
.ms-menu__toggle { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 0; border-radius: var(--ms-radius-pill); background: var(--ms-ink); color: var(--ms-paper); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ms-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ms-lime); color: var(--ms-ink); font-size: 13px; font-weight: 700; }
.ms-menu__list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; display: grid; min-width: 230px; margin: 0; padding: 8px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-md); background: var(--ms-white); box-shadow: 0 20px 50px rgba(20, 22, 46, .18); list-style: none; }
.ms-menu__link { display: block; padding: 10px 12px; border-radius: var(--ms-radius-sm); font-size: 15px; }
.ms-menu__link:hover { background: var(--ms-sand); }
.ms-menu__sep { height: 1px; margin: 6px 4px; background: var(--ms-line); }
/* Переключатель языка: язык подписан на самом себе, текущий не кликается */
.ms-lang { display: inline-flex; align-items: center; gap: 2px; }
.ms-lang__item { padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1; color: var(--ms-muted); white-space: nowrap; }
.ms-lang__item:hover { color: var(--ms-ink); background: var(--ms-sand); }
.ms-lang__item.is-active { color: var(--ms-ink); background: var(--ms-sand); cursor: default; }
.ms-lang--menu { display: flex; padding: 4px 6px; }
.ms-lang--menu .ms-lang__item { flex: 1; text-align: center; }
/* Переключатель валюты: символы ₽ $ € без слов, активный не кликается */
.ms-currency { display: inline-flex; align-items: center; gap: 2px; }
.ms-currency__item { padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1; color: var(--ms-muted); white-space: nowrap; }
.ms-currency__item:hover { color: var(--ms-ink); background: var(--ms-sand); }
.ms-currency__item.is-active { color: var(--ms-ink); background: var(--ms-sand); cursor: default; }
.ms-page { display: grid; gap: 20px; max-width: 1240px; margin: 0 auto; padding: 32px 20px 80px; }
.ms-page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ms-page__back { display: inline-block; margin-bottom: 8px; font-size: 14px; }
@media (max-width: 720px) {
  .ms-topbar__inner { flex-wrap: wrap; row-gap: 10px; }
  .ms-nav { order: 3; flex-basis: 100%; }
  .ms-pill__label, .ms-menu__name { display: none; }
}

/* Cards */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.ms-card { position: relative; min-width: 0; padding: 24px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-lg); background: var(--ms-white); }
.ms-card--dark { overflow: hidden; border-color: transparent; background: var(--ms-ink); color: var(--ms-paper); }
.ms-card--lime { border-color: transparent; background: var(--ms-lime); }
.ms-card--flush { padding: 0; overflow: hidden; }
.ms-card__orbit { position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border: 1px dashed rgba(198, 242, 78, .3); border-radius: 50%; animation: ms-orbit 30s linear infinite; pointer-events: none; }
.ms-card__label { position: relative; margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ms-muted); }
.ms-card--dark .ms-card__label { color: var(--ms-lime); }
.ms-card__value { position: relative; margin: 12px 0 6px; font-family: var(--ms-font-display); font-size: 32px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.ms-card__value--sm { font-size: 22px; }
.ms-card__text { position: relative; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ms-muted); }
.ms-card--dark .ms-card__text { color: inherit; opacity: .72; }
.ms-card--lime .ms-card__text { color: var(--ms-ink); }
.ms-card__actions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.ms-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; font-size: 14px; color: var(--ms-muted); }

/* Tabs */
.ms-tabs { position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; max-width: 520px; border-bottom: 1px solid var(--ms-line-strong); }
.ms-tabs__indicator { position: absolute; bottom: -1px; left: 0; width: calc(100% / var(--ms-tab-count, 1)); height: 3px; border-radius: var(--ms-radius-pill); background: var(--ms-accent); transform: translateX(calc(100% * var(--ms-tab-index, 0))); transition: transform .4s var(--ms-ease); }
.ms-tab { padding: 14px 4px; border: 0; background: transparent; color: var(--ms-muted); font: inherit; font-size: 15px; font-weight: 600; text-align: center; cursor: pointer; transition: color .3s; }
.ms-tab[aria-selected="true"], :where(.ms-body) .ms-tab.is-active { color: var(--ms-ink); }
.ms-tab-panel { min-width: 0; animation: ms-rise-in .35s ease; }

/* eSIM list */
.ms-layout-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; gap: 20px; }
.ms-list { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.ms-sim { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; width: 100%; padding: 18px; border: 1.5px solid var(--ms-line); border-radius: var(--ms-radius-md); background: var(--ms-white); color: var(--ms-ink); font: inherit; text-align: left; cursor: pointer; transition: transform .25s, border-color .25s; }
.ms-sim:hover { transform: translateY(-3px); }
.ms-sim[aria-selected="true"] { border-color: var(--ms-ink); }
.ms-sim__body { display: grid; gap: 6px; min-width: 0; }
.ms-sim__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ms-sim__name { font-family: var(--ms-font-display); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.ms-sim__meta { font-size: 14px; color: var(--ms-muted); }
.ms-sim__side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.ms-sim__amount { font-family: var(--ms-font-display); font-size: 16px; font-weight: 600; white-space: nowrap; }
.ms-sim__hint { font-size: 13px; color: var(--ms-muted); }
.ms-sim--add { grid-template-columns: auto 1fr; border-style: dashed; border-color: rgba(20, 22, 46, .25); color: var(--ms-muted); font-size: 15px; font-weight: 600; }
:where(.ms-body) .ms-sim--add:hover { border-color: var(--ms-ink); color: var(--ms-ink); }
.ms-sim__plus { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ms-sand); font-size: 18px; }
.ms-flag { display: grid; flex-shrink: 0; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: var(--ms-radius-sm); background: var(--ms-ink); box-shadow: inset 0 0 0 1px rgba(20, 22, 46, .12); color: var(--ms-lime); font-size: 13px; font-weight: 700; }
.ms-flag--on-dark { background: rgba(198, 242, 78, .16); box-shadow: inset 0 0 0 1px rgba(247, 244, 237, .18); }
.ms-flag__image { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 480px) {
  .ms-sim { grid-template-columns: auto 1fr; }
  .ms-sim__side { grid-column: 2; justify-items: start; text-align: left; }
}

/* Badges */
.ms-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: var(--ms-radius-pill); background: var(--ms-sand); color: var(--ms-muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.ms-badge--active { background: var(--ms-lime); color: var(--ms-ink); }
.ms-badge--ready { background: rgba(255, 106, 61, .14); color: var(--ms-accent-dark); }
.ms-badge--done { background: var(--ms-sand); color: var(--ms-muted); }
.ms-badge--pending { background: rgba(224, 185, 74, .24); color: #6B4F08; }
.ms-badge--error { background: var(--ms-accent-dark); color: #fff; }

/* eSIM panel and remaining-data ring */
.ms-panel { display: grid; gap: 18px; min-width: 0; padding: 26px; border-radius: var(--ms-radius-lg); background: var(--ms-ink); color: var(--ms-paper); }
@media (min-width: 900px) { .ms-panel--sticky { position: sticky; top: 96px; } }
.ms-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ms-panel__status { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--ms-lime); }
.ms-panel__title { margin: 8px 0 0; font-family: var(--ms-font-display); font-size: 24px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ms-panel__meta { margin: 6px 0 0; font-size: 14px; opacity: .7; }
.ms-panel .ms-note { margin: 0; color: inherit; opacity: .75; }
.ms-panel .ms-btn--outline { border-color: rgba(247, 244, 237, .4); color: var(--ms-paper); }
.ms-panel .ms-btn--outline:hover { border-color: var(--ms-lime); background: transparent; color: var(--ms-paper); }
.ms-ring { --ms-ring-deg: 0deg; display: grid; place-items: center; width: 170px; height: 170px; margin: 6px auto; border-radius: 50%; background: conic-gradient(var(--ms-accent) var(--ms-ring-deg), rgba(247, 244, 237, .12) 0); }
.ms-ring__hole { display: grid; place-items: center; width: 130px; height: 130px; padding: 10px; border-radius: 50%; background: var(--ms-ink); text-align: center; }
.ms-ring__value { font-family: var(--ms-font-display); font-size: 20px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.ms-ring__caption { margin-top: 4px; font-size: 13px; opacity: .65; }
.ms-ring--light { background: conic-gradient(var(--ms-accent) var(--ms-ring-deg), var(--ms-sand) 0); }
.ms-ring--light .ms-ring__hole { background: var(--ms-white); }
.ms-facts { display: grid; gap: 10px; margin: 0; }
.ms-card__text + .ms-facts { margin-top: 12px; }
.ms-facts__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 13px 16px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-sm); background: var(--ms-paper); font-size: 14px; }
.ms-facts__row dt { color: var(--ms-muted); }
.ms-facts__row dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.ms-panel .ms-facts__row { border-color: rgba(247, 244, 237, .14); background: rgba(247, 244, 237, .06); }
/* Short summaries (the express checkout): label over value, two tiles to a row, an odd last tile takes the row.
   Half the height of full-width rows, so the e-mail field and «Pay» fit on the first screen of a phone */
.ms-facts--tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ms-facts--tiles .ms-facts__row { display: grid; align-content: start; gap: 2px; padding: 9px 12px; }
.ms-facts--tiles .ms-facts__row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ms-facts--tiles .ms-facts__row dt { font-size: 12px; line-height: 1.3; }
.ms-facts--tiles .ms-facts__row dd { font-size: 15px; line-height: 1.3; text-align: left; }
.ms-panel .ms-facts__row dt { color: inherit; opacity: .75; }

/* Rows and stats */
.ms-rows { margin: 0; padding: 0; list-style: none; }
.ms-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid rgba(20, 22, 46, .08); }
.ms-row--plain { grid-template-columns: 1fr auto; }
.ms-row__main { display: grid; gap: 4px; min-width: 0; }
.ms-row__title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ms-row__meta { font-size: 13px; color: var(--ms-muted); overflow-wrap: anywhere; }
.ms-row__side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.ms-row__amount { font-family: var(--ms-font-display); font-size: 16px; font-weight: 600; white-space: nowrap; }
.ms-row__amount--plus { color: #4F6B22; }
@media (max-width: 480px) {
  .ms-row, .ms-row--plain { grid-template-columns: 1fr; }
  .ms-row__side { justify-items: start; text-align: left; }
}
.ms-stats { display: grid; gap: 14px; margin: 18px 0; }
.ms-stats__row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--ms-line-strong); font-size: 16px; }
.ms-stats__row:last-child { padding-bottom: 0; border-bottom: 0; }
.ms-stats__row dd { margin: 0; font-family: var(--ms-font-display); font-weight: 600; }
.ms-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ms-copy__value { flex: 1 1 220px; min-width: 0; padding: 14px 18px; border: 1.5px solid var(--ms-line-strong); border-radius: var(--ms-radius-sm); background: var(--ms-white); color: var(--ms-ink); font: inherit; font-size: 15px; font-weight: 600; text-overflow: ellipsis; }

/* Empty state and pagination */
.ms-blank { display: grid; justify-items: center; gap: 12px; padding: 40px 24px; border: 1.5px dashed rgba(20, 22, 46, .2); border-radius: var(--ms-radius-lg); text-align: center; }
.ms-blank__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ms-sand); font-size: 24px; }
.ms-blank__title { margin: 0; font-family: var(--ms-font-display); font-size: 18px; font-weight: 600; }
.ms-blank__text { max-width: 42ch; margin: 0; font-size: 15px; color: var(--ms-muted); }
.ms-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.ms-pagination__link { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1.5px solid var(--ms-line-strong); border-radius: var(--ms-radius-pill); font-size: 15px; font-weight: 600; }
.ms-pagination__link.is-active { border-color: var(--ms-ink); background: var(--ms-ink); color: var(--ms-paper); }
.ms-pagination__link.is-disabled { opacity: .45; }

/* Modal */
.ms-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(20, 22, 46, .55); backdrop-filter: blur(6px); animation: ms-rise-in .25s ease; }
.ms-modal__dialog { display: grid; gap: 18px; width: min(460px, 100%); max-height: calc(100vh - 40px); margin: 0; padding: clamp(22px, 3vw, 32px); overflow-y: auto; border-radius: 28px; background: var(--ms-paper); box-shadow: 0 30px 70px rgba(20, 22, 46, .4); }
.ms-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ms-modal__title { margin: 0; font-family: var(--ms-font-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.ms-modal__close { flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ms-sand); color: var(--ms-ink); font: inherit; font-size: 16px; cursor: pointer; }
.ms-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
body.ms-modal-open { overflow: hidden; }

/* Selectable options, QR, steps and tags */
.ms-options { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ms-option { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1.5px solid var(--ms-line); border-radius: 18px; background: var(--ms-white); cursor: pointer; transition: border-color .25s, box-shadow .25s; }
.ms-option__input { position: absolute; opacity: 0; pointer-events: none; }
.ms-option:has(.ms-option__input:checked) { border-color: var(--ms-ink); box-shadow: 0 0 0 3px rgba(20, 22, 46, .08); }
.ms-option:has(.ms-option__input:focus-visible) { outline: 3px solid var(--ms-accent); outline-offset: 2px; }
.ms-option__main { display: grid; gap: 4px; min-width: 0; }
.ms-option__title { font-family: var(--ms-font-display); font-size: 17px; font-weight: 600; }
.ms-option__meta { font-size: 13px; color: var(--ms-muted); }
.ms-option__price { font-family: var(--ms-font-display); font-size: 17px; font-weight: 600; white-space: nowrap; }
/* Acceptance marks of the payment methods: the brands' own colours, so they sit on a white surface */
.ms-paylogos { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ms-paylogos--center { justify-content: center; }
/* .ms-body img sets height:auto at a higher specificity, so the marks are pinned through .ms-paylogos; widths follow the artwork */
.ms-paylogos .ms-paylogos__logo { display: block; width: auto; max-width: none; }
.ms-paylogos .ms-paylogos__logo--mastercard { height: 22px; }
.ms-paylogos .ms-paylogos__logo--sbp { height: 26px; }
.ms-paylogos .ms-paylogos__logo--mir { height: 15px; }
.ms-paylogos .ms-paylogos__logo--visa { height: 14px; }
.ms-qr { display: grid; justify-items: center; gap: 12px; margin: 16px 0; padding: 20px; border-radius: var(--ms-radius-md); background: var(--ms-paper); text-align: center; }
.ms-qr__image { width: min(240px, 100%); height: auto; aspect-ratio: 1; background: var(--ms-white); }
.ms-qr__canvas { width: min(240px, 100%); aspect-ratio: 1; padding: 12px; border-radius: var(--ms-radius-sm); background: var(--ms-white); }
.ms-qr__canvas svg { display: block; width: 100%; height: 100%; }
.ms-steps { display: grid; gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: ms-step; }
.ms-steps__item { display: grid; grid-template-columns: auto 1fr; gap: 14px; counter-increment: ms-step; }
.ms-steps__item::before { content: counter(ms-step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ms-lime); font-weight: 700; }
.ms-steps__title { margin: 0 0 4px; font-weight: 600; }
.ms-steps__text { margin: 0; font-size: 14px; color: var(--ms-muted); }
.ms-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ms-tags__item { padding: 6px 12px; border-radius: var(--ms-radius-pill); background: var(--ms-sand); font-size: 14px; }
/* Card heading gap; it collapses with the top margin of .ms-qr and .ms-ring, so those gaps do not add up */
.ms-card > .ms-h3 { margin-bottom: 16px; }
/* A card label that is a product name keeps its spelling ("eSIM") */
.ms-card__label--plain { text-transform: none; }
/* Unlimited plan: nothing to measure against, so the ring is full; moresim.js leaves it alone when the total is not positive */
.ms-ring--unlimited { --ms-ring-deg: 360deg; }

@keyframes ms-blink { 50% { opacity: .25; } }

/* Catalogue */
.ms-search { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; max-width: 640px; }
.ms-search .ms-field { flex: 1 1 260px; }
.ms-dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.ms-dest { display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px 16px; border: 1.5px solid var(--ms-line); border-radius: var(--ms-radius-md); background: var(--ms-white); transition: transform .25s, border-color .25s; }
.ms-dest:hover { transform: translateY(-2px); border-color: var(--ms-ink); }
.ms-dest__body { display: grid; gap: 2px; min-width: 0; }
.ms-dest__name { font-weight: 600; overflow-wrap: anywhere; }
.ms-dest__meta { font-size: 13px; color: var(--ms-muted); }

/* Plan choice */
.ms-plan-form { display: grid; gap: 16px; }
.ms-option__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Motion */
@keyframes ms-orbit { to { transform: rotate(360deg); } }
@keyframes ms-orbit-reverse { to { transform: rotate(-360deg); } }
@keyframes ms-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes ms-rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* Order list row title: .ms-link makes the whole row read as an accent-colored link; keep it ink-colored like sibling rows and only hint the link on hover/focus */
a.ms-row__title { color: inherit; text-decoration: none; }
a.ms-row__title:hover, a.ms-row__title:focus-visible { text-decoration: underline; }

/* Page head lead line, e.g. the wallet balance under the "Wallet" heading */
.ms-page__lead { margin: 6px 0 0; font-size: 15px; color: var(--ms-muted); }

/* Narrow single-column card for the password and two-factor "off" screens */
.ms-card--narrow { max-width: 560px; }

/* KYC form: checkbox/radio groups rendered as a fieldset, file input styled like a text field */
.ms-field--group { margin: 0; padding: 0; border: 0; min-width: 0; }
.ms-input--file { padding: 12px 14px; min-height: 0; }
.ms-input--file::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: var(--ms-radius-pill); background: var(--ms-ink); color: var(--ms-paper); font: inherit; font-size: 14px; cursor: pointer; }
.ms-check__input[type="radio"] + .ms-check__box { border-radius: 50%; }
.ms-check__input[type="radio"]:checked + .ms-check__box::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ms-ink); }

/* Support ticket thread */
.ms-page__side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ms-thread { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.ms-message { padding: 18px 20px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-md); background: var(--ms-white); }
.ms-message--staff { border-color: rgba(198, 242, 78, .9); background: rgba(198, 242, 78, .16); }
.ms-message__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0 0 8px; font-size: 13px; color: var(--ms-muted); }
.ms-message__author { font-weight: 700; color: var(--ms-ink); }
.ms-message__time { font-weight: 400; }
.ms-message__body { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ms-message__files { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }

/* Error pages (resources/views/errors) */
.ms-error { display: grid; align-content: center; justify-items: center; gap: 28px; min-height: 100vh; padding: 32px 16px; }
.ms-error__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--ms-font-display); font-size: 20px; font-weight: 600; }
.ms-error__card { width: 100%; max-width: 560px; padding: 36px 28px; border-radius: var(--ms-radius-lg); background: var(--ms-white); box-shadow: 0 20px 50px rgba(20, 22, 46, .08); text-align: center; }
.ms-error__code { margin: 0 0 8px; font-family: var(--ms-font-display); font-size: clamp(56px, 12vw, 88px); font-weight: 700; line-height: 1; letter-spacing: -.04em; color: var(--ms-accent); }
.ms-error__card .ms-lead { margin: 12px 0 24px; }
.ms-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* HTML from the admin content manager: policies, maintenance notice */
.ms-prose { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.ms-prose > :first-child { margin-top: 0; }
.ms-prose > :last-child { margin-bottom: 0; }
.ms-prose h1, .ms-prose h2, .ms-prose h3, .ms-prose h4, .ms-prose h5 { margin: 1.4em 0 .5em; font-family: var(--ms-font-display); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.ms-prose h1, .ms-prose h2 { font-size: 24px; }
.ms-prose h3, .ms-prose h4, .ms-prose h5 { font-size: 19px; }
.ms-prose p, .ms-prose ul, .ms-prose ol { margin: 0 0 1em; }
.ms-prose ul, .ms-prose ol { padding-left: 1.3em; }
.ms-prose a { color: var(--ms-accent); text-decoration: underline; }
.ms-prose img { max-width: 100%; height: auto; }
.ms-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.ms-prose [style*="font-family"] { font-family: inherit !important; }
.ms-maintenance .ms-prose { text-align: center; }
.ms-maintenance__image { display: block; max-width: 220px; margin: 0 auto 20px; }

/* Auth density: the guest screens have to fit one viewport without scrolling.
   Every vertical step is a custom property, so the tiers below only retune numbers. */
.ms-guest {
  --ms-auth-pad: clamp(26px, 4vw, 48px);
  --ms-auth-top-mb: 26px;
  --ms-auth-switch-mb: 28px;
  --ms-auth-switch-pad: 5px;
  --ms-auth-switch-item-pad: 12px;
  --ms-auth-switch-item-size: 15px;
  --ms-auth-h2-mb: 8px;
  --ms-auth-lead-mb: 26px;
  --ms-auth-form-gap: 16px;
  --ms-auth-field-gap: 8px;
  --ms-auth-input-h: 54px;
  --ms-auth-input-pad: 14px;
  --ms-auth-btn-pad: 15px;
  min-height: 100svh;
}
.ms-guest__aside, .ms-guest__panel { padding: var(--ms-auth-pad); }
.ms-guest .ms-guest__top { margin-bottom: var(--ms-auth-top-mb); }
.ms-guest .ms-switch { margin-bottom: var(--ms-auth-switch-mb); padding: var(--ms-auth-switch-pad); }
.ms-guest .ms-switch__item { padding: var(--ms-auth-switch-item-pad); font-size: var(--ms-auth-switch-item-size); }
.ms-guest .ms-h2 { margin-bottom: var(--ms-auth-h2-mb); }
.ms-guest .ms-lead { margin-bottom: var(--ms-auth-lead-mb); }
.ms-guest .ms-form { gap: var(--ms-auth-form-gap); }
.ms-guest .ms-field, .ms-guest .ms-form .form-group { gap: var(--ms-auth-field-gap); }
.ms-guest .ms-input, .ms-guest .ms-form .form-control { min-height: var(--ms-auth-input-h); padding-block: var(--ms-auth-input-pad); }
.ms-guest .ms-btn { padding-block: var(--ms-auth-btn-pad); }
.ms-guest .ms-divider { margin: calc(var(--ms-auth-form-gap) + 4px) 0 var(--ms-auth-form-gap); }

/* Laptops and every phone: trim the rhythm so the register form stops overflowing */
@media (max-height: 880px), (max-width: 600px) {
  .ms-guest {
    --ms-auth-pad: clamp(22px, 3vw, 34px);
    --ms-auth-top-mb: 16px;
    --ms-auth-switch-mb: 18px;
    --ms-auth-switch-pad: 4px;
    --ms-auth-switch-item-pad: 9px;
    --ms-auth-switch-item-size: 14px;
    --ms-auth-h2-mb: 6px;
    --ms-auth-lead-mb: 14px;
    --ms-auth-form-gap: 12px;
    --ms-auth-field-gap: 6px;
    --ms-auth-input-h: 48px;
    --ms-auth-input-pad: 10px;
    --ms-auth-btn-pad: 12px;
  }
  .ms-guest .ms-h2 { font-size: clamp(22px, 2.2vw, 28px); }
  .ms-guest .ms-lead { font-size: 15px; }
  .ms-guest__aside { min-height: 0; }
}

/* Short viewports: squeeze the remaining air out of the form */
@media (max-height: 740px), (max-width: 480px) {
  .ms-guest {
    --ms-auth-pad: clamp(18px, 2.4vw, 28px);
    --ms-auth-top-mb: 12px;
    --ms-auth-switch-mb: 14px;
    --ms-auth-switch-item-pad: 8px;
    --ms-auth-h2-mb: 4px;
    --ms-auth-lead-mb: 10px;
    --ms-auth-form-gap: 10px;
    --ms-auth-field-gap: 5px;
    --ms-auth-input-h: 46px;
    --ms-auth-input-pad: 9px;
    --ms-auth-btn-pad: 11px;
  }
  .ms-guest .ms-lead { font-size: 14px; }
}

/* Phones: the dark panel becomes a brand strip instead of a half-screen hero */
@media (max-width: 880px) {
  .ms-guest__aside { gap: 14px; padding-block: 16px; }
  .ms-guest__title { margin-bottom: 0; font-size: 22px; }
  .ms-guest__orbit { right: -120px; bottom: -150px; width: 260px; height: 260px; opacity: .45; }
}
@media (max-width: 880px) and (max-height: 1000px) {
  .ms-guest { grid-template-rows: auto 1fr; }
  .ms-guest__aside { flex-direction: row; align-items: center; gap: 16px; padding-block: 12px; }
  .ms-guest__pitch { display: none; }
  .ms-guest__orbit { right: -130px; bottom: -110px; width: 200px; height: 200px; opacity: .35; }
}

/* Wide but short (short laptop windows, phones in landscape): the supporting
   line is the first thing to go, the dark column stays because it costs no height */
@media (min-width: 601px) and (max-height: 660px) {
  .ms-guest .ms-lead { display: none; }
}

/* Small phones: the register form only fits once the decorative panel
   and the supporting line give up their space */
@media (max-width: 600px) and (max-height: 760px) {
  .ms-guest {
    --ms-auth-pad: 16px;
    --ms-auth-top-mb: 8px;
    --ms-auth-switch-mb: 8px;
    --ms-auth-form-gap: 7px;
    --ms-auth-field-gap: 4px;
    --ms-auth-input-h: 44px;
    --ms-auth-input-pad: 8px;
    --ms-auth-btn-pad: 10px;
  }
  .ms-guest__aside { padding-block: 8px; }
  .ms-guest .ms-lead { display: none; }
  /* validation text needs the strip's height more than the page needs the strip */
  .ms-guest:has(.ms-field__error:not([hidden])) { --ms-auth-top-mb: 6px; --ms-auth-switch-mb: 6px; }
  .ms-guest:has(.ms-field__error:not([hidden])) .ms-guest__aside { display: none; }
}

/* Below 340px the brand strip no longer earns its height either */
@media (max-width: 340px) {
  .ms-guest__aside { display: none; }
}

/* Very small phones: pair the name fields so the register form keeps one screen */
@media (max-width: 380px) {
  .ms-guest {
    --ms-auth-pad: 14px;
    --ms-auth-form-gap: 7px;
    --ms-auth-input-h: 42px;
    --ms-auth-input-pad: 7px;
    --ms-auth-btn-pad: 10px;
  }
  .ms-guest .ms-grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ms-guest .ms-field__label, .ms-guest .ms-form .form-label { font-size: 12px; letter-spacing: .06em; }
}

/* Phones in landscape and very short windows: only the form survives */
@media (max-height: 500px) {
  .ms-guest {
    --ms-auth-pad: 14px;
    --ms-auth-top-mb: 8px;
    --ms-auth-switch-mb: 10px;
    --ms-auth-form-gap: 8px;
    --ms-auth-field-gap: 4px;
    --ms-auth-input-h: 42px;
    --ms-auth-input-pad: 8px;
    --ms-auth-btn-pad: 10px;
  }
  .ms-guest__aside { display: none; }
  .ms-guest .ms-lead { display: none; }
}

/* Validation text on the guest screens is the one thing that can grow the form
   after it was sized, so it stays as tight as it can while staying readable */
.ms-guest .ms-field__error { font-size: 12px; line-height: 1.35; }

/* Once validation messages are on screen the supporting line has done its job,
   so it steps aside and keeps the form on one screen (no-op where :has is missing) */
.ms-guest:has(.ms-field__error:not([hidden])) .ms-lead { display: none; }

/* Plan picker: a destination can hold 70+ plans, so the list is filtered, sorted and shown in pages */
.ms-plan-tools { display: grid; gap: 12px; margin-bottom: 18px; }
.ms-plan-tools__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* On a phone the chips ride in one swipeable row instead of stacking three deep above the plans */
@media (max-width: 640px) {
  .ms-plan-tools__row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ms-plan-tools__row::-webkit-scrollbar { display: none; }
  .ms-plan-tools__row > * { flex: 0 0 auto; }
}
.ms-plan-tools__label { font-size: 13px; color: var(--ms-muted); margin-right: 2px; }
.ms-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--ms-line); border-radius: var(--ms-radius-pill); background: transparent; color: var(--ms-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.ms-chip:hover { border-color: var(--ms-ink); }
.ms-chip[aria-pressed="true"] { background: var(--ms-ink); border-color: var(--ms-ink); color: var(--ms-paper); }
.ms-chip__count { font-size: 11px; font-weight: 500; opacity: .6; }
.ms-plan-tools__found { font-size: 14px; color: var(--ms-muted); }
.ms-options__more { display: flex; justify-content: center; margin-top: 12px; }

/* Plans as tiles: four to a row on a desktop, each with its own Buy button */
.ms-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.ms-plan-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1.5px solid var(--ms-line); border-radius: 18px; background: var(--ms-white); transition: border-color .25s, box-shadow .25s; }
.ms-plan-card:hover { border-color: var(--ms-ink); }
.ms-plan-card.is-chosen { border-color: var(--ms-ink); box-shadow: 0 0 0 3px rgba(20, 22, 46, .08); }
.ms-plan-card__title { font-family: var(--ms-font-display); font-size: 17px; font-weight: 600; margin: 0; }
.ms-plan-card__meta { font-size: 13px; color: var(--ms-muted); margin: 0; }
.ms-plan-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ms-plan-card__price { font-family: var(--ms-font-display); font-size: 20px; font-weight: 600; margin: 4px 0 0; }
.ms-plan-card__buy { margin-top: auto; padding: 12px 18px; font-size: 15px; }
.ms-plan-card[hidden] { display: none; }
