/* ==========================================================================
   Legend Clay — soft 3D Claymorphism theme for the SMM panel
   Light direction: highlight top-left, shadow bottom-right (everywhere).
   Self-contained: no Bootstrap, no Font Awesome, no remote fonts or images.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;
  --bg: #EEF0FF;
  --surface: #FFFFFF;
  --surface-2: #F6F7FF;
  --input: #E4E6F7;
  --ink: #2D2A4A;
  --ink-2: #6B6890;
  --link: #5B3FD0;
  --line: #E1E3F5;
  --hl: #FFFFFF;            /* top-left highlight */
  --sh: #C8C4E8;            /* bottom-right shadow */
  --inset-dark: #CDD0EA;
  --purple: #A78BFA; --pink: #FF8FB1; --mint: #7EE8B5; --peach: #FFB07C; --sky: #7CC6FF;
  --on-accent: #2A2548;     /* dark ink on pastel fills keeps contrast >= 4.5:1 */
  --ok-bg: #DDF8EB; --ok-ink: #14633F;
  --bad-bg: #FFE3EC; --bad-ink: #8E1F45;
  --warn-bg: #FFEBDD; --warn-ink: #8A4A15;
  --info-bg: #DFF1FF; --info-ink: #17527F;
  --r-card: 28px; --r-ctl: 18px; --r-pill: 999px;
  --clay: -8px -8px 18px var(--hl), 10px 10px 22px var(--sh), inset 2px 2px 4px rgba(255,255,255,.85), inset -3px -3px 6px rgba(200,196,232,.22);
  --clay-sm: -4px -4px 10px var(--hl), 5px 5px 12px var(--sh), inset 1px 1px 2px rgba(255,255,255,.8);
  --clay-press: inset 4px 4px 9px var(--inset-dark), inset -4px -4px 9px var(--hl);
  --inset: inset 4px 4px 8px var(--inset-dark), inset -4px -4px 8px var(--hl);
  --font: "Nunito", "Poppins", "Quicksand", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 272px;
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px #6D4FE0;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #232038; --surface: #2A2740; --surface-2: #322F4C; --input: #1F1D33;
  --ink: #ECEAFF; --ink-2: #B3AFD8; --link: #C9BBFF; --line: #3A3655;
  --hl: #3A3655; --sh: #1A1830; --inset-dark: #15132A;
  --on-accent: #1E1A3A;
  --ok-bg: #1E4636; --ok-ink: #A9F2CE;
  --bad-bg: #4D2236; --bad-ink: #FFC2D5;
  --warn-bg: #4D3322; --warn-ink: #FFD6B8;
  --info-bg: #1F3C55; --info-ink: #BFE3FF;
  --clay: -8px -8px 18px rgba(58,54,85,.75), 10px 10px 22px var(--sh), inset 1px 1px 3px rgba(255,255,255,.06), inset -3px -3px 6px rgba(0,0,0,.18);
  --clay-sm: -4px -4px 10px rgba(58,54,85,.7), 5px 5px 12px var(--sh), inset 1px 1px 2px rgba(255,255,255,.05);
  --clay-press: inset 4px 4px 9px var(--sh), inset -3px -3px 8px #3A3655;
  --inset: inset 4px 4px 8px var(--sh), inset -3px -3px 8px #3A3655;
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px #B9A5FF;
}
/* No-JS fallback: follow the system theme when the head script could not set data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #232038; --surface: #2A2740; --surface-2: #322F4C; --input: #1F1D33;
    --ink: #ECEAFF; --ink-2: #B3AFD8; --link: #C9BBFF; --line: #3A3655;
    --hl: #3A3655; --sh: #1A1830; --inset-dark: #15132A; --on-accent: #1E1A3A;
    --ok-bg: #1E4636; --ok-ink: #A9F2CE; --bad-bg: #4D2236; --bad-ink: #FFC2D5;
    --warn-bg: #4D3322; --warn-ink: #FFD6B8; --info-bg: #1F3C55; --info-ink: #BFE3FF;
    --clay: -8px -8px 18px rgba(58,54,85,.75), 10px 10px 22px #1A1830, inset 1px 1px 3px rgba(255,255,255,.06), inset -3px -3px 6px rgba(0,0,0,.18);
    --clay-sm: -4px -4px 10px rgba(58,54,85,.7), 5px 5px 12px #1A1830, inset 1px 1px 2px rgba(255,255,255,.05);
    --clay-press: inset 4px 4px 9px #1A1830, inset -3px -3px 8px #3A3655;
    --inset: inset 4px 4px 8px #1A1830, inset -3px -3px 8px #3A3655;
    --focus: 0 0 0 3px var(--bg), 0 0 0 6px #B9A5FF;
  }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body.clay-body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5em; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 2.4vw + 1rem, 2.4rem); }
h2 { font-size: clamp(1.3rem, 1.2vw + 1rem, 1.7rem); }
h3 { font-size: 1.25rem; } h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code, pre, kbd { font-family: var(--mono); }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus) !important; border-radius: var(--r-ctl); }
.clay-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--surface); padding: 10px 16px; border-radius: var(--r-ctl); box-shadow: var(--clay-sm); }
.clay-skip:focus { top: 12px; }
.clay-sr, .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.icon--fill { fill: currentColor; stroke: none; }
.text-center { text-align: center; } .text-muted, .clay-muted { color: var(--ink-2); } .small { font-size: .875rem; }
.nowrap { white-space: nowrap; } .mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.ml-1{margin-left:.35rem}.mr-1{margin-right:.35rem}

/* ---------- 3. App shell ---------- */
.clay-app { display: block; }
.clay-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 60; padding: 22px 18px;
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
  background: var(--surface); box-shadow: 10px 0 30px -12px var(--sh), inset -1px 0 0 var(--hl);
  border-radius: 0 var(--r-card) var(--r-card) 0; transition: transform .28s ease;
}
.clay-brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.clay-brand img { max-height: 44px; max-width: 190px; object-fit: contain; }
.clay-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.clay-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-ctl);
  color: var(--ink-2); text-decoration: none; font-weight: 700; transition: box-shadow .15s, color .15s, background .15s;
}
.clay-nav a:hover { color: var(--ink); background: var(--surface-2); }
.clay-nav a[aria-current="page"] { color: var(--on-accent); background: var(--purple); box-shadow: var(--clay-sm); }
.clay-side-foot { margin-top: auto; display: grid; gap: 8px; }
.clay-main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.clay-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 36px);
  background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
}
.clay-topbar__spacer { flex: 1; }
.clay-iconbtn.clay-burger { display: none; }
.clay-iconbtn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); box-shadow: var(--clay-sm); cursor: pointer; font: inherit; text-decoration: none;
}
.clay-iconbtn:hover { color: var(--link); } .clay-iconbtn:active { box-shadow: var(--clay-press); }
.clay-theme-toggle .i-moon { display: none; } :root[data-theme="dark"] .clay-theme-toggle .i-sun { display: none; } :root[data-theme="dark"] .clay-theme-toggle .i-moon { display: inline; }
.clay-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border: 0; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--clay-sm); color: var(--ink); font: 800 .95rem var(--font); cursor: pointer; text-decoration: none;
}
.clay-chip small { color: var(--ink-2); font-weight: 700; }
.clay-dd { position: relative; }
.clay-dd__menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; max-width: 86vw; padding: 12px; z-index: 70;
  background: var(--surface); border-radius: var(--r-ctl); box-shadow: var(--clay); display: none;
}
.clay-dd.is-open .clay-dd__menu { display: block; }
.clay-dd__menu ul { list-style: none; margin: 0; padding: 0; } .clay-dd__menu a, .clay-dd__menu button { display: block; width: 100%; padding: 8px 12px; border: 0; background: none; border-radius: 12px; color: var(--ink); text-align: left; font: inherit; text-decoration: none; cursor: pointer; }
.clay-dd__menu a:hover, .clay-dd__menu button:hover { background: var(--surface-2); }
.clay-content { flex: 1; min-width: 0; width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 36px) 40px; }
.clay-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 22px; }
.clay-page-head h1 { margin: 0; }
.clay-crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 6px; font-size: .875rem; color: var(--ink-2); }
.clay-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.clay-crumbs a { color: var(--ink-2); }
.clay-footer { padding: 26px clamp(16px, 3vw, 36px) 34px; text-align: center; color: var(--ink-2); font-size: .9rem; }
.clay-footer a { color: var(--ink-2); font-weight: 700; }
.clay-footer p { margin: 0 0 .35rem; }
.clay-scrim { position: fixed; inset: 0; background: rgba(26,24,48,.45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.nav-open .clay-scrim { opacity: 1; pointer-events: auto; }
/* public (signed-out) shell */
.clay-publicbar { display: flex; align-items: center; gap: 14px; padding: 14px clamp(16px, 3vw, 36px); flex-wrap: wrap; position: sticky; top: 0; z-index: 40; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.clay-publicbar .clay-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.clay-publicbar .clay-nav a { padding: 10px 14px; }
.clay-public-main { width: 100%; min-width: 0; max-width: 1240px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 36px) 40px; }
.clay-public-toggle { display: none; }

@media (max-width: 1024px) {
  .clay-sidebar { transform: translateX(-105%); width: min(86vw, 320px); box-shadow: none; visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s, box-shadow 0s linear .28s; }
  body.nav-open .clay-sidebar { transform: none; visibility: visible; box-shadow: 14px 0 40px rgba(26,24,48,.35); transition-delay: 0s; }
  .clay-main { margin-left: 0; }
  .clay-iconbtn.clay-burger { display: inline-grid; }
}
@media (max-width: 720px) {
  .clay-public-toggle { display: inline-grid; margin-left: auto; }
  .clay-publicbar .clay-nav { display: none; width: 100%; flex-direction: column; margin: 0; }
  .clay-publicbar.is-open .clay-nav { display: flex; }
}

/* ---------- 4. Grid helpers ---------- */
.clay-grid { display: grid; gap: 22px; }
.clay-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clay-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.clay-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.clay-grid--order { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.clay-grid--side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
@media (max-width: 1100px) { .clay-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .clay-grid--order, .clay-grid--side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .clay-grid--2, .clay-grid--3, .clay-grid--4 { grid-template-columns: minmax(0, 1fr); } }
.clay-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.clay-row--between { justify-content: space-between; }
.clay-stack > * + * { margin-top: 1rem; }

/* ---------- 5. Surfaces ---------- */
.clay-card, .card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--clay); padding: clamp(18px, 2.4vw, 30px); border: 0; color: var(--ink); }
.clay-card > h2:first-child, .clay-card > h3:first-child { margin-bottom: 1rem; }
.clay-card--flat { box-shadow: none; border: 1px solid var(--line); }
.clay-card--tight { padding: 14px; }
.clay-card--soft { background: var(--surface-2); box-shadow: var(--clay-sm); }
.clay-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.clay-card__head h2, .clay-card__head h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.clay-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-bottom: 26px; }
@media (max-width: 1100px) { .clay-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {   /* keep the order form near the top on phones: compact 2x2 tiles */
  .clay-stats { gap: 14px; margin-bottom: 18px; }
  .clay-stats .clay-stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .clay-stats .clay-stat__icon { width: 42px; height: 42px; border-radius: 15px; }
  .clay-stats .clay-stat__value { font-size: 1.15rem; }
  .clay-stats .clay-stat__label { font-size: .8rem; }
}
.clay-stat { display: flex; align-items: center; gap: 16px; padding: 22px; }
.clay-stat__icon { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 20px; color: var(--on-accent); box-shadow: var(--clay-sm); }
.clay-stat__icon--purple { background: var(--purple); } .clay-stat__icon--pink { background: var(--pink); } .clay-stat__icon--mint { background: var(--mint); } .clay-stat__icon--sky { background: var(--sky); } .clay-stat__icon--peach { background: var(--peach); }
.clay-stat__value { font-size: 1.45rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.clay-stat__label { color: var(--ink-2); font-size: .9rem; font-weight: 700; }
.clay-announce { margin-bottom: 22px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--warn-bg); color: var(--warn-ink); font-weight: 800; overflow: hidden; white-space: nowrap; box-shadow: var(--clay-sm); }
.clay-announce__track { display: inline-block; padding-left: 100%; animation: clay-marquee 28s linear infinite; }
.clay-announce:hover .clay-announce__track { animation-play-state: paused; }
@keyframes clay-marquee { to { transform: translateX(-100%); } }
.clay-video { position: relative; aspect-ratio: 16 / 9; max-width: 860px; margin: 0 auto 24px; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--clay); background: var(--surface-2); }
.clay-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 6. Forms ---------- */
.clay-field, .form-group { margin-bottom: 18px; }
.clay-label, .control-label, label.control-label { display: block; margin: 0 0 8px 4px; font-weight: 800; font-size: .95rem; color: var(--ink); }
.clay-input, .clay-select, .clay-textarea, .form-control {
  display: block; width: 100%; min-height: 50px; padding: 12px 18px; border: 2px solid transparent; border-radius: var(--r-ctl);
  background: var(--input); color: var(--ink); font: 600 1rem var(--font); box-shadow: var(--inset); transition: border-color .15s;
}
.clay-textarea, textarea.form-control { min-height: 130px; resize: vertical; line-height: 1.5; }
.clay-input::placeholder, .clay-textarea::placeholder, .form-control::placeholder { color: var(--ink-2); opacity: .85; font-weight: 600; }
.clay-input:focus, .clay-select:focus, .clay-textarea:focus, .form-control:focus { border-color: #6D4FE0; }
:root[data-theme="dark"] .clay-input:focus, :root[data-theme="dark"] .clay-select:focus, :root[data-theme="dark"] .clay-textarea:focus, :root[data-theme="dark"] .form-control:focus { border-color: #B9A5FF; }
.clay-input[readonly], .form-control[readonly], .clay-input:disabled, .form-control:disabled { opacity: .8; cursor: default; }
.clay-select, select.form-control { appearance: none; padding-right: 46px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B6890' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.clay-input.is-invalid, .form-control.is-invalid { border-color: #D6336C; }
.clay-help, .help-block { display: block; margin: 6px 4px 0; font-size: .85rem; color: var(--ink-2); }
.clay-error { margin: 6px 4px 0; font-size: .875rem; font-weight: 700; color: var(--bad-ink); }
.clay-check, .form-group__checkbox-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 700; }
.clay-check input, input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: #7C5CF0; cursor: pointer; }
.clay-input-group { display: flex; gap: 10px; align-items: stretch; } .clay-input-group > .clay-input, .clay-input-group > .form-control { flex: 1; min-width: 0; }
.input-group { display: flex; gap: 10px; } .input-group .form-control { flex: 1; min-width: 0; } .input-group-btn { display: flex; }
.clay-fields .row { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; } .clay-fields .row > [class*="col"] { flex: 1 1 200px; min-width: 0; padding: 0; }
.clay-fields .panel-body, .panel-body.border-solid { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); box-shadow: var(--clay-press); max-height: 220px; overflow-y: auto; overflow-wrap: anywhere; line-height: 1.55; }
.clay-fields .scroll-container, .service-dashboard { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); box-shadow: var(--clay-press); max-height: 200px; overflow-y: auto; }
.service-dashboard h4 { font-size: 1rem; margin-bottom: 8px; } .service-dashboard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.service-dashboard li { padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--clay-sm); font-weight: 700; font-size: .85rem; }
.service-dashboard li, .scroll-container p, .scroll-container, .panel-body, .panel-body * { color: var(--ink) !important; } /* server HTML ships inline color:black */
.clay-fields .badge, .badge.badge-secondary { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--info-bg); color: var(--info-ink); font-weight: 800; font-size: .8rem; }
.fa-exclamation-circle::before { content: "\24D8"; } .fa-trash-o::before { content: "\2715"; } .fas, .fa, .far, .fad, .fab { font-style: normal; }

/* ---------- 7. Buttons ---------- */
.clay-btn, .btn, .btn-big-primary, .btn-big-secondary, .btn-actions {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 24px; border: 0;
  border-radius: var(--r-ctl); font: 800 1rem var(--font); text-decoration: none; cursor: pointer; color: var(--on-accent);
  background: var(--purple); box-shadow: var(--clay-sm); transition: transform .12s, box-shadow .15s, filter .15s;
}
.clay-btn:hover, .btn:hover { filter: brightness(1.04); transform: translateY(-1px); text-decoration: none; }
.clay-btn:active, .btn:active { transform: none; box-shadow: var(--clay-press); }
.clay-btn--secondary, .btn-big-secondary { background: var(--pink); }
.clay-btn--success { background: var(--mint); } .clay-btn--warning { background: var(--peach); } .clay-btn--info { background: var(--sky); }
.clay-btn--danger { background: var(--bad-bg); color: var(--bad-ink); }
.clay-btn--ghost, .btn-actions { background: var(--surface); color: var(--ink); }
.clay-btn--block, .btn-block { display: flex; width: 100%; }
.clay-btn--sm, .clay-table .clay-btn, .clay-table .clay-badge { white-space: nowrap; }
.clay-btn--sm, .btn-actions { min-height: 38px; padding: 6px 16px; font-size: .9rem; }
.clay-btn:disabled, .clay-btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; filter: none; transform: none; }
.clay-btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.clay-btn[aria-busy="true"]::before { content: ""; width: 1.1em; height: 1.1em; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: clay-spin .7s linear infinite; }
.btn-default { background: var(--surface); color: var(--ink); } .bg-danger { background: var(--bad-bg) !important; color: var(--bad-ink) !important; }
@keyframes clay-spin { to { transform: rotate(360deg); } }

/* ---------- 8. Alerts, badges, states ---------- */
.clay-alert, .alert { position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; padding: 14px 48px 14px 18px; border-radius: var(--r-ctl); font-weight: 700; box-shadow: var(--clay-sm); overflow-wrap: anywhere; }
.clay-alert--success, .alert-success { background: var(--ok-bg); color: var(--ok-ink); }
.clay-alert--danger, .alert-danger { background: var(--bad-bg); color: var(--bad-ink); }
.clay-alert--warning, .alert-warning { background: var(--warn-bg); color: var(--warn-ink); }
.clay-alert--info, .alert-info { background: var(--info-bg); color: var(--info-ink); }
.clay-alert__body { flex: 1; min-width: 0; } .clay-alert__body dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; } .clay-alert__body dt { font-weight: 800; } .clay-alert__body dd { margin: 0; font-weight: 600; }
.clay-alert__close, .alert .close { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 12px; background: rgba(255,255,255,.45); color: inherit; font: 800 1rem var(--font); cursor: pointer; }
.clay-badge, .badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--r-pill); font-weight: 800; font-size: .8rem; background: var(--info-bg); color: var(--info-ink); white-space: nowrap; }
.clay-badge--ok { background: var(--ok-bg); color: var(--ok-ink); } .clay-badge--bad { background: var(--bad-bg); color: var(--bad-ink); } .clay-badge--warn { background: var(--warn-bg); color: var(--warn-ink); } .clay-badge--info { background: var(--info-bg); color: var(--info-ink); } .clay-badge--purple { background: #E6DEFF; color: #4B2FB0; } :root[data-theme="dark"] .clay-badge--purple { background: #3C3470; color: #DCD2FF; }
.clay-empty { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.clay-empty svg { width: 120px; height: auto; margin-bottom: 8px; } .clay-empty h3 { color: var(--ink); }
.clay-skeleton { display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--input), var(--surface-2), var(--input)); background-size: 200% 100%; animation: clay-shimmer 1.2s linear infinite; }
@keyframes clay-shimmer { to { background-position: -200% 0; } }

/* ---------- 9. Tables (flat on purpose: dense data stays readable) ---------- */
.clay-table-wrap, .table-responsive { position: relative; width: 100%; overflow-x: auto; border-radius: var(--r-ctl); -webkit-overflow-scrolling: touch; }
.clay-table, .table { width: 100%; border-collapse: collapse; font-size: .95rem; background: transparent; }
.clay-table th, .table th { text-align: left; padding: 12px 14px; font-weight: 800; color: var(--ink-2); font-size: .85rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.clay-table td, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.clay-table tbody tr:hover td { background: var(--surface-2); }
.clay-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.clay-cat-row td { background: var(--surface-2); font-weight: 800; border-bottom: 0; }
.clay-id { display: inline-flex; align-items: center; gap: 6px; }
.clay-copy { border: 0; background: var(--surface-2); color: var(--ink-2); width: 28px; height: 28px; border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; } .clay-copy:hover { color: var(--link); } .clay-copy.is-done { color: var(--ok-ink); background: var(--ok-bg); }
@media (max-width: 720px) {
  .clay-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .clay-table--stack, .clay-table--stack tbody, .clay-table--stack tr, .clay-table--stack td { display: block; width: 100%; }
  .clay-table--stack tr { margin-bottom: 14px; padding: 8px 4px; border-radius: var(--r-ctl); background: var(--surface-2); }
  .clay-table--stack td { display: flex; justify-content: space-between; gap: 16px; padding: 8px 14px; border: 0; text-align: right; }
  .clay-table--stack td::before { content: attr(data-label); flex: none; font-weight: 800; color: var(--ink-2); text-align: left; }
  .clay-table--stack td[data-label=""]::before { display: none; } .clay-table--stack .clay-cat-row { background: none; padding: 0; margin: 18px 0 6px; } .clay-table--stack .clay-cat-row td { display: block; text-align: left; padding: 6px 4px; background: none; }
}

/* ---------- 10. Pills, search, pagination ---------- */
.clay-pills { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 18px; padding: 0; }
.clay-pills a { display: inline-flex; padding: 9px 18px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--clay-sm); color: var(--ink); text-decoration: none; font-weight: 800; font-size: .9rem; }
.clay-pills a[aria-current="page"] { background: var(--purple); color: var(--on-accent); box-shadow: var(--clay-press); }
.clay-search { display: flex; gap: 10px; margin-bottom: 18px; } .clay-search .clay-input { flex: 1; }
.clay-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 22px 0 0; padding: 0; }
.clay-pager a, .clay-pager span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--clay-sm); color: var(--ink); text-decoration: none; font-weight: 800; }
.clay-pager [aria-current="page"] { background: var(--purple); color: var(--on-accent); box-shadow: var(--clay-press); }

/* ---------- 11. Modal & accordion ---------- */
dialog.clay-modal { width: min(560px, 92vw); max-height: 86vh; padding: 26px; border: 0; border-radius: var(--r-card); background: var(--surface); color: var(--ink); box-shadow: var(--clay); overflow-y: auto; }
dialog.clay-modal::backdrop { background: rgba(26,24,48,.55); }
.clay-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; } .clay-modal__head h3 { margin: 0; }
.clay-modal__body { white-space: pre-line; overflow-wrap: anywhere; } .clay-modal__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.clay-accordion details, .clay-prose details { margin-bottom: 14px; border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--clay-sm); }
.clay-accordion summary, .clay-prose summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: var(--r-ctl); }
.clay-accordion summary::-webkit-details-marker, .clay-prose summary::-webkit-details-marker { display: none; }
.clay-accordion summary::after, .clay-prose summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--link); }
.clay-accordion details[open] summary::after, .clay-prose details[open] summary::after { content: "\2212"; }
.clay-accordion details > :not(summary), .clay-prose details > :not(summary) { padding: 0 20px 16px; }
.clay-prose { line-height: 1.75; max-width: 78ch; overflow-wrap: anywhere; } .clay-prose img { height: auto; border-radius: var(--r-ctl); } .clay-prose h1, .clay-prose h2, .clay-prose h3 { margin-top: 1.4em; }
.clay-prose--wide { max-width: none; }

/* ---------- 12. Code, tickets, platform chips ---------- */
.clay-code { position: relative; margin: 0 0 22px; }
.clay-code pre { margin: 0; padding: 18px 20px; border-radius: var(--r-ctl); background: var(--input); box-shadow: var(--inset); overflow-x: auto; font-size: .9rem; line-height: 1.55; color: var(--ink); }
.clay-code .clay-btn { position: absolute; right: 10px; top: 10px; min-height: 34px; padding: 4px 12px; font-size: .8rem; }
.clay-thread { display: grid; gap: 16px; margin-bottom: 24px; }
.clay-bubble { max-width: min(640px, 92%); padding: 14px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--clay-sm); overflow-wrap: anywhere; white-space: pre-line; }
.clay-bubble--me { margin-left: auto; background: var(--purple); color: var(--on-accent); border-bottom-right-radius: 8px; }
.clay-bubble--support { border-bottom-left-radius: 8px; }
.clay-bubble__meta { display: flex; justify-content: space-between; gap: 18px; margin-top: 8px; font-size: .8rem; font-weight: 700; opacity: .8; white-space: normal; }
.clay-platforms { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 18px 0 0; padding: 0; }
.clay-platform { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--clay-sm); font-weight: 800; font-size: .9rem; }
.clay-platform .icon { width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: var(--on-accent); }
.clay-platform--instagram .icon { background: var(--pink); } .clay-platform--youtube .icon { background: var(--peach); } .clay-platform--facebook .icon { background: var(--sky); } .clay-platform--telegram .icon { background: var(--mint); } .clay-platform--x .icon { background: var(--purple); }
.clay-svc-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: var(--surface); box-shadow: var(--clay-sm); color: var(--link); vertical-align: middle; } .clay-svc-ico .icon { width: 16px; height: 16px; }

/* ---------- 13. Auth layout ---------- */
.clay-auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 4vw, 56px); align-items: center; min-height: calc(100vh - 160px); }
.clay-auth__hero h1 { font-size: clamp(2rem, 3.4vw + 1rem, 3.3rem); line-height: 1.1; }
.clay-auth__hero p { font-size: 1.1rem; color: var(--ink-2); max-width: 52ch; }
.clay-auth__art { width: min(420px, 100%); margin-top: 18px; }
.clay-auth-card { max-width: 480px; width: 100%; margin: 0 auto; }
.clay-auth-card h2 { margin-bottom: 1.25rem; }
.clay-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 16px; font-weight: 700; }
.clay-section { margin: 48px 0 0; } .clay-section > h2 { text-align: center; margin-bottom: 6px; } .clay-section > .lead { text-align: center; color: var(--ink-2); margin: 0 auto 24px; max-width: 60ch; }
@media (max-width: 900px) { .clay-auth { grid-template-columns: minmax(0, 1fr); min-height: 0; } .clay-auth__hero { order: 2; } }

/* ---------- 14. New order composer ---------- */
.clay-combo { position: relative; }
.clay-combo__input { padding-left: 48px; } .clay-combo__icon { position: absolute; left: 16px; top: 15px; color: var(--ink-2); pointer-events: none; }
.clay-combo__clear { position: absolute; right: 8px; top: 7px; width: 36px; height: 36px; border: 0; border-radius: 12px; background: none; color: var(--ink-2); cursor: pointer; }
.clay-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; max-height: 340px; overflow-y: auto; margin: 0; padding: 8px; list-style: none; background: var(--surface); border-radius: var(--r-ctl); box-shadow: var(--clay); }
.clay-results li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.clay-results li:hover, .clay-results li[aria-selected="true"] { background: var(--surface-2); box-shadow: var(--clay-press); }
.clay-results li.clay-results__msg { cursor: default; color: var(--ink-2); box-shadow: none; background: none; }
.clay-results .clay-badge { flex: none; } .clay-results b { margin-left: auto; padding-left: 10px; color: var(--link); white-space: nowrap; }
.clay-results mark { background: rgba(167,139,250,.45); background: color-mix(in srgb, var(--purple) 45%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.clay-summary { position: sticky; top: 92px; }
.clay-summary h2 { display: flex; align-items: center; gap: 10px; }
.clay-summary__svc { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); box-shadow: var(--clay-press); }
.clay-summary__svc strong { display: block; overflow-wrap: anywhere; }
.clay-charge { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--clay); margin-bottom: 18px; }
.clay-charge__label { font-weight: 800; color: var(--ink-2); } .clay-charge__value { font-size: 1.6rem; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; text-align: right; }
.clay-charge__value[aria-busy="true"] { opacity: .5; }
.clay-order-status { min-height: 1.4em; margin: 0 0 12px; font-weight: 700; color: var(--ink-2); }
.clay-order-status.is-error { color: var(--bad-ink); }
.clay-fields[aria-busy="true"] { opacity: .45; pointer-events: none; transition: opacity .15s; }
@media (max-width: 1100px) { .clay-summary { position: static; } }

/* ---------- 15. Legacy grid used inside server-rendered / unmigrated markup ---------- */
.container, .container-fluid { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0; }
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; } .row > * { padding: 0 10px; min-width: 0; }
.col-12, .col-sm-12, .col-md-12, .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
@media (min-width: 768px) { .col-md-6 { flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 992px) { .col-lg-3 { flex: 0 0 25%; max-width: 25%; } .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; } .col-lg-5 { flex: 0 0 41.666%; max-width: 41.666%; } .col-lg-6 { flex: 0 0 50%; max-width: 50%; } .col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; } .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; } .offset-lg-2 { margin-left: 16.666%; } }
.wrapper-content, .wrapper-content__body { display: block; }

/* ---------- 16. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .clay-announce__track { animation: none; padding-left: 0; white-space: normal; display: block; } .clay-announce { white-space: normal; }
}
@media print { .clay-sidebar, .clay-topbar, .clay-publicbar, .clay-footer, .clay-scrim { display: none !important; } .clay-main { margin: 0; } body.clay-body { background: #fff; color: #000; } .clay-card { box-shadow: none; border: 1px solid #ccc; } }
