/* ===========================================================================
   MAGMA Store Platform — design system.

   One stylesheet for the three surfaces:
     .ms-*  dashboards (platform + store), English, light admin look
     .sf-*  public storefront, bilingual (LTR / RTL)
   White cards on a light background, rounded, soft shadows, accent #880290.
   Mobile first: every layout is written for a phone and widened from there.
   =========================================================================== */

:root {
    --acc: #880290;
    --acc-dark: #6a0171;
    --acc-soft: rgba(136, 2, 144, .08);
    --acc-line: rgba(136, 2, 144, .22);
    --acc-rgb: 136, 2, 144;

    --bg: #f7f4fa;
    --card: #ffffff;
    --ink: #1d1520;
    --ink-2: #5a5164;
    --ink-3: #8b8396;
    --line: #eae4f0;
    --line-2: #f4f0f8;

    --ok: #0f8a5f;
    --ok-soft: rgba(15, 138, 95, .1);
    --warn: #b47300;
    --warn-soft: rgba(180, 115, 0, .12);
    --err: #c02634;
    --err-soft: rgba(192, 38, 52, .1);
    --mute-soft: #f1edf5;

    --r: 18px;
    --r-sm: 12px;
    --r-xs: 10px;
    --sh: 0 1px 2px rgba(29, 21, 32, .05), 0 10px 26px rgba(29, 21, 32, .06);
    --sh-sm: 0 1px 2px rgba(29, 21, 32, .05), 0 4px 14px rgba(29, 21, 32, .05);
    --sh-lg: 0 24px 60px rgba(29, 21, 32, .18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

[dir="rtl"],
.ar,
.ms-ar {
    font-family: "Cairo", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.is-hidden {
    display: none !important;
}

.ms-wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -.01em;
}

p {
    margin: 0;
}

a {
    color: var(--acc);
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ============================== buttons ================================= */

.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--mute-soft);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
    white-space: nowrap;
}

.ms-btn:hover {
    background: #eae4f1;
}

.ms-btn:active {
    transform: translateY(1px);
}

.ms-btn[disabled] {
    opacity: .55;
    cursor: default;
}

.ms-btn-primary {
    background: var(--acc);
    color: #fff;
    box-shadow: 0 8px 20px rgba(var(--acc-rgb), .22);
}

.ms-btn-primary:hover {
    background: var(--acc-dark);
}

.ms-btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-2);
}

.ms-btn-ghost:hover {
    background: var(--line-2);
}

.ms-btn-danger {
    background: #fff;
    border-color: rgba(192, 38, 52, .25);
    color: var(--err);
}

.ms-btn-danger:hover {
    background: var(--err-soft);
}

.ms-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.ms-btn-block {
    width: 100%;
}

.ms-linkbtn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--acc);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* ============================== cards =================================== */

.ms-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-sm);
    padding: 18px;
}

.ms-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ms-card-title {
    font-size: 16px;
    font-weight: 600;
}

.ms-card-sub {
    font-size: 13px;
    color: var(--ink-3);
    margin-top: 2px;
}

.ms-sec {
    margin-top: 18px;
}

.ms-muted {
    color: var(--ink-3);
    font-size: 13px;
}

/* ============================== topbar ================================== */

.ms-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.ms-topbar-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    max-width: 1180px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.ms-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ms-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--acc), #b93fc4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.02em;
    box-shadow: 0 8px 18px rgba(var(--acc-rgb), .3);
}

.ms-brand-txt {
    min-width: 0;
}

.ms-brand-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
}

.ms-brand-sub {
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
}

.ms-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================== page head =============================== */

.ms-page {
    padding: 18px 0 48px;
}

.ms-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ms-h1 {
    font-size: 22px;
    font-weight: 600;
}

.ms-lead {
    font-size: 14px;
    color: var(--ink-2);
    margin-top: 4px;
    max-width: 62ch;
}

/* ============================== KPI grid ================================ */

.ms-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ms-kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 14px;
    box-shadow: var(--sh-sm);
}

.ms-kpi-k {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.ms-kpi-v {
    font-size: 21px;
    font-weight: 600;
    margin-top: 6px;
    line-height: 1.15;
    word-break: break-word;
}

.ms-kpi-v-sm {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.ms-kpi-sub {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 4px;
}

/* ============================== forms =================================== */

.ms-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.ms-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ms-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.ms-hint {
    font-size: 12px;
    color: var(--ink-3);
}

.ms-input,
.ms-select,
.ms-textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ms-input:focus,
.ms-select:focus,
.ms-textarea:focus {
    outline: 0;
    border-color: var(--acc-line);
    box-shadow: 0 0 0 3px var(--acc-soft);
}

.ms-textarea {
    min-height: 88px;
    resize: vertical;
}

.ms-input[dir="rtl"],
.ms-textarea[dir="rtl"] {
    font-family: "Cairo", "Poppins", sans-serif;
}

.ms-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--ink-2);
    cursor: pointer;
    padding: 8px 0;
}

.ms-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--acc);
    margin: 0;
}

.ms-note {
    display: none;
    font-size: 13px;
    border-radius: var(--r-xs);
    padding: 10px 12px;
    margin-top: 12px;
}

.ms-note.is-on {
    display: block;
}

.ms-note.is-err {
    background: var(--err-soft);
    color: var(--err);
}

.ms-note.is-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

/* ============================== badges / pills ========================== */

.ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--mute-soft);
    color: var(--ink-2);
    white-space: nowrap;
}

.ms-badge.is-on {
    background: var(--ok-soft);
    color: var(--ok);
}

.ms-badge.is-off {
    background: var(--err-soft);
    color: var(--err);
}

.ms-badge.is-plan {
    background: var(--acc-soft);
    color: var(--acc);
}

.ms-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--mute-soft);
    color: var(--ink-2);
}

.ms-pill.is-new {
    background: var(--acc-soft);
    color: var(--acc);
}

.ms-pill.is-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.ms-pill.is-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.ms-pill.is-done {
    background: #eef2f6;
    color: #46586b;
}

.ms-pill.is-off {
    background: var(--err-soft);
    color: var(--err);
}

/* ============================== rows / lists ============================ */

.ms-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ms-row {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-sm);
}

.ms-row-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.ms-thumb {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
    background: var(--mute-soft);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--acc);
    font-size: 15px;
    overflow: hidden;
}

.ms-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-row-title {
    font-size: 14.5px;
    font-weight: 600;
    word-break: break-word;
}

.ms-row-sub {
    font-size: 12.5px;
    color: var(--ink-3);
    word-break: break-word;
}

.ms-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.ms-row-meta b {
    display: block;
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 600;
}

.ms-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ms-row-head {
    display: none;
}

.ms-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ms-toolbar .ms-input,
.ms-toolbar .ms-select {
    flex: 1 1 150px;
    min-width: 0;
}

.ms-empty {
    text-align: center;
    padding: 34px 18px;
    border: 1px dashed var(--line);
    border-radius: var(--r);
    background: #fff;
    color: var(--ink-2);
}

.ms-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

/* status / filter chips used in the dashboards */
.ms-chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ms-chip:hover {
    background: var(--line-2);
}

.ms-chip.is-on {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
    box-shadow: 0 6px 14px rgba(var(--acc-rgb), .2);
}

/* small square image preview next to an upload field */
.ms-preview {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    background: #fbf9fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    line-height: 1.2;
    text-align: center;
    color: var(--ink-3);
    overflow: hidden;
}

.ms-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-empty-text {
    font-size: 13px;
    color: var(--ink-3);
    margin-top: 5px;
    max-width: 46ch;
    margin-inline: auto;
}

.ms-skel {
    height: 62px;
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, #f1ecf6 25%, #f8f5fb 37%, #f1ecf6 63%);
    background-size: 400% 100%;
    animation: ms-shimmer 1.4s ease infinite;
}

@keyframes ms-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ============================== tabs =================================== */

.ms-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--sh-sm);
    scrollbar-width: none;
}

.ms-tabs::-webkit-scrollbar {
    display: none;
}

.ms-tab {
    flex: 0 0 auto;
    padding: 9px 15px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ms-tab.is-on {
    background: var(--acc);
    color: #fff;
    box-shadow: 0 6px 16px rgba(var(--acc-rgb), .22);
}

/* ============================== auth screen ============================ */

.ms-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(var(--acc-rgb), .16), transparent 70%),
        var(--bg);
}

.ms-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--sh-lg);
    padding: 26px 22px 22px;
}

.ms-auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.ms-auth-title {
    font-size: 21px;
    font-weight: 600;
}

.ms-auth-sub {
    font-size: 13.5px;
    color: var(--ink-2);
    margin-top: 6px;
    line-height: 1.6;
}

.ms-auth-foot {
    margin-top: 18px;
    font-size: 12px;
    color: var(--ink-3);
    text-align: center;
}

.ms-boot {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    font-size: 14px;
}

/* ======================= storefront: shell + header ===================== */

.sf {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 96px;
}

.sf-head {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(29, 21, 32, .05);
}

/* The cover sits above the sticky bar, not inside it, so the sticky bar keeps a
   fixed height on every screen and the tool row can line up right under it. */
.sf-cover {
    height: 104px;
    background: linear-gradient(120deg, var(--acc), #b93fc4);
    background-size: cover;
    background-position: center;
}

.sf-head-in {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px 12px;
    min-height: 68px;
    max-width: 1180px;
    margin: 0 auto;
}

.sf-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: var(--sh-sm);
    object-fit: cover;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--acc);
}

.sf-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-titles {
    min-width: 0;
    flex: 1 1 auto;
}

.sf-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-tagline {
    font-size: 12.5px;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

/* Language toggle: a normal pill. It must never be squeezed by the flex row —
   in Arabic the word is wider, so it keeps its own width and never wraps. */
.sf-lang {
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    word-break: keep-all;
    cursor: pointer;
}

.sf-lang:hover {
    background: var(--line-2);
}

/* The button shows the other language: while the storefront is English it
   reads "العربية", so it needs the Arabic face and its taller line box. */
.sf-lang.is-ar {
    font-family: "Cairo", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0;
}

.sf-iconbtn {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    border: 0;
    background: var(--acc-soft);
    color: var(--acc);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-cart-ico {
    display: block;
    width: 20px;
    height: 20px;
}

.sf-count {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--acc);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-tools {
    position: sticky;
    top: 69px;
    z-index: 25;
    background: rgba(247, 244, 250, .96);
    backdrop-filter: blur(8px);
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--line);
}

.sf-search {
    width: 100%;
    padding: 11px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    box-shadow: var(--sh-sm);
}

.sf-search:focus {
    outline: 0;
    border-color: var(--acc-line);
    box-shadow: 0 0 0 3px var(--acc-soft);
}

.sf-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 9px 2px 2px;
    scrollbar-width: none;
}

.sf-chips::-webkit-scrollbar {
    display: none;
}

.sf-chip {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.sf-chip.is-on {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
    box-shadow: 0 6px 16px rgba(var(--acc-rgb), .2);
}

/* ======================= storefront: product grid ====================== */

.sf-main {
    padding-top: 14px;
}

.sf-cat-title {
    font-size: 15px;
    font-weight: 600;
    margin: 6px 0 10px;
}

.sf-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sf-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}

.sf-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--line-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    font-weight: 700;
    font-size: 20px;
    overflow: hidden;
}

.sf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-off {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--err);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.sf-card-b {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 11px 11px;
    flex: 1 1 auto;
}

.sf-pname {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-pdesc {
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-prow {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
}

.sf-price {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sf-price-v {
    font-size: 14px;
    font-weight: 700;
    color: var(--acc);
}

.sf-price-old {
    font-size: 11.5px;
    color: var(--ink-3);
    text-decoration: line-through;
}

.sf-add {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    border: 0;
    background: var(--acc);
    color: #fff;
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(var(--acc-rgb), .26);
}

.sf-qty {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--acc-line);
    border-radius: 999px;
    background: var(--acc-soft);
    padding: 2px;
}

.sf-qty button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--acc);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.sf-qty span {
    min-width: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--acc);
}

.sf-stock-off {
    font-size: 11px;
    font-weight: 600;
    color: var(--err);
}

/* ======================= storefront: cart + checkout =================== */

.sf-fab {
    position: fixed;
    inset-inline: 14px;
    bottom: 14px;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    border: 0;
    background: var(--acc);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(var(--acc-rgb), .34);
    max-width: 520px;
    margin: 0 auto;
}

.sf-fab-total {
    font-weight: 700;
}

.sf-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sf-sheet-back {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 24, .45);
    backdrop-filter: blur(2px);
}

.sf-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: var(--sh-lg);
    overflow: hidden;
}

.sf-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.sf-panel-title {
    font-size: 16px;
    font-weight: 600;
}

.sf-panel-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.sf-panel-foot {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.sf-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 17px;
    cursor: pointer;
    line-height: 1;
}

.sf-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-2);
}

.sf-line-img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 10px;
    background: var(--line-2);
    object-fit: cover;
    overflow: hidden;
}

.sf-line-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-line-txt {
    flex: 1 1 auto;
    min-width: 0;
}

.sf-line-name {
    font-size: 13.5px;
    font-weight: 600;
}

.sf-line-price {
    font-size: 12px;
    color: var(--ink-3);
}

.sf-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--ink-2);
    padding: 3px 0;
}

.sf-sum-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    border-top: 1px dashed var(--line);
    margin-top: 6px;
    padding-top: 10px;
}

.sf-seg {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--line-2);
    border-radius: 999px;
    margin-bottom: 12px;
}

.sf-seg button {
    flex: 1 1 0;
    padding: 9px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.sf-seg button.is-on {
    background: #fff;
    color: var(--acc);
    box-shadow: var(--sh-sm);
}

.sf-done {
    text-align: center;
    padding: 16px 4px 4px;
}

.sf-done-mark {
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--ok-soft);
    color: var(--ok);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-done-no {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .02em;
    margin: 4px 0;
}

.sf-empty-cart {
    text-align: center;
    color: var(--ink-3);
    font-size: 13.5px;
    padding: 26px 10px;
}

/* ============================== tracking =============================== */

.sf-track {
    max-width: 560px;
    margin: 0 auto;
    padding: 22px 16px 40px;
}

.sf-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
}

.sf-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 14px;
    position: relative;
}

.sf-step-dot {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
    background: var(--line);
    margin-top: 3px;
}

.sf-step.is-done .sf-step-dot {
    background: var(--acc);
    box-shadow: 0 0 0 4px var(--acc-soft);
}

.sf-step.is-now .sf-step-dot {
    background: var(--acc);
    box-shadow: 0 0 0 5px var(--acc-soft);
}

.sf-step-t {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-3);
}

.sf-step.is-done .sf-step-t,
.sf-step.is-now .sf-step-t {
    color: var(--ink);
}

/* ============================== custom domains ========================== */

.ms-dom-state {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: #fbf9fd;
}

.ms-dom-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ms-dom-domain {
    font-size: 15px;
    font-weight: 600;
    word-break: break-all;
}

.ms-dom-how {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.ms-dom-group {
    margin-top: 14px;
}

.ms-dns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.ms-dns-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: #fff;
}

.ms-dns-type {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--acc-soft);
    color: var(--acc);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ms-dns-host {
    flex: 0 0 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--ink-3);
}

.ms-dns-v {
    flex: 1 1 140px;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbf9fd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--ink);
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.ms-dns-copy {
    flex: 0 0 auto;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.ms-dns-copy:hover {
    background: var(--line-2);
}

.ms-dom-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}

.ms-dom-step {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.ms-dom-step-n {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 999px;
    background: var(--acc-soft);
    color: var(--acc);
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================== small print ============================ */

.ms-foot {
    text-align: center;
    font-size: 12px;
    color: var(--ink-3);
    padding: 22px 16px 34px;
}

.ms-foot a {
    color: var(--ink-2);
}

/* ============================== desktop ================================ */

@media (min-width: 720px) {
    .ms-wrap {
        padding: 0 24px;
    }

    .ms-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .ms-kpi {
        padding: 16px 18px;
    }

    .ms-kpi-v {
        font-size: 24px;
    }

    .ms-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-form-grid .ms-span2 {
        grid-column: span 2;
    }

    .ms-h1 {
        font-size: 26px;
    }

    .ms-row {
        grid-template-columns: 2.2fr 1fr 1fr auto;
        align-items: center;
        gap: 14px;
    }

    .ms-row-head {
        display: grid;
        padding: 0 14px;
        font-size: 11px;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--ink-3);
        font-weight: 600;
    }

    .ms-row-head span {
        display: block;
    }

    .sf-cover {
        height: 176px;
    }

    .sf-head-in {
        padding: 14px 24px;
        gap: 14px;
        min-height: 88px;
    }

    .sf-logo {
        width: 58px;
        height: 58px;
        flex: 0 0 58px;
        border-radius: 16px;
    }

    .sf-name {
        font-size: 19px;
    }

    .sf-tools {
        top: 89px;
    }

    .sf-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .sf-fab {
        display: none;
    }

    .sf-sheet {
        align-items: stretch;
        justify-content: flex-end;
    }

    .sf-panel {
        max-width: 420px;
        max-height: 100vh;
        height: 100%;
        border-radius: 22px 0 0 22px;
    }

    .ms-auth-card {
        padding: 30px 28px 26px;
    }
}

@media (min-width: 1040px) {
    .ms-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .ms-kpi-v {
        font-size: 22px;
    }

    .sf-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .sf-cover {
        height: 224px;
    }
}

/* Right-to-left: the framework ships RTL-first utilities, so flip only what
   the layout itself assumes. */
[dir="rtl"] .sf-price,
[dir="rtl"] .sf-line-txt {
    text-align: right;
}

[dir="rtl"] .ms-pill,
[dir="rtl"] .ms-badge {
    direction: rtl;
}
