
/* صوت ستوديو — مكونات الواجهة. كل الألوان من tokens.css. RTL أولاً. */

.ss { direction: rtl; font-family: var(--font-body); font-weight: 300; font-size: 16.5px; line-height: 1.85; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.ss *, .ss *::before, .ss *::after { box-sizing: border-box; }
.ss h1, .ss h2, .ss h3, .ss h4 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
.ss p { margin: 0; }
.ss .ltr, .ss .num { direction: ltr; unicode-bidi: isolate; font-family: var(--font-latin); font-variant-numeric: tabular-nums; }
.ss :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ss-container { max-width: var(--page-width); margin-inline: auto; padding-inline: var(--space-4); }
.ss-icon { width: 24px; height: 24px; flex: none; }
.ss-icon-sm { width: 18px; height: 18px; flex: none; }

/* ——— Buttons ——— */
.ss-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 46px; padding: 0 26px; border-radius: var(--r-pill); border: 1.5px solid transparent; font: 500 15.5px/1.4 var(--font-body); text-decoration: none; cursor: pointer; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); white-space: nowrap; }
.ss-btn:hover { transform: translateY(var(--lift-btn)); }
.ss-btn-primary { background: var(--purple); color: var(--on-purple); }
.ss-btn-primary:hover { background: var(--purple-d); box-shadow: var(--shadow-btn); }
.ss-btn-teal { background: var(--teal); color: var(--purple-dd); }
.ss-btn-teal:hover { box-shadow: 0 8px 20px rgba(46,148,129,.30); }
.ss-btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }
.ss-btn-ghost:hover { background: rgba(255,255,255,.10); border-color: var(--white); }
.ss-btn-outline { background: transparent; color: var(--purple); border-color: var(--purple); }
.ss-btn-lg { min-height: 56px; padding: 0 34px; font-size: 17px; }
.ss-btn-sm { min-height: 38px; padding: 0 18px; font-size: 14px; }
.ss-btn[disabled], .ss-btn[aria-disabled="true"] { background: var(--bg-alt); color: var(--muted); border-color: var(--line); cursor: not-allowed; transform: none; box-shadow: none; }
.ss-btn-icon { width: 42px; min-height: 42px; padding: 0; }

/* ——— Eyebrow + section heading ——— */
.ss-eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 14px/1.6 var(--font-display); color: var(--teal-text); }
.ss-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--teal); }
.ss-on-dark .ss-eyebrow { color: var(--teal); }
.ss-section-head { display: grid; gap: var(--space-2); max-width: 640px; }
.ss-section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.35; font-weight: 700; }
.ss-section-head p { color: var(--ink-2); font-size: 1.1rem; }

/* ——— Color stripe ——— */
.ss-stripe { display: flex; height: var(--stripe-height); }
.ss-stripe > i { flex: 1; }
.ss-stripe > i:nth-child(1) { background: var(--purple); }
.ss-stripe > i:nth-child(2) { background: var(--teal); }
.ss-stripe > i:nth-child(3) { background: var(--yellow); }
.ss-stripe > i:nth-child(4) { background: var(--orange); }
.ss-stripe-hero > i:nth-child(1) { background: var(--purple-l); }

/* ——— Header ——— */
.ss-header { position: sticky; top: 0; z-index: 20; height: var(--header-height); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(var(--blur-header)); -webkit-backdrop-filter: blur(var(--blur-header)); border-bottom: 1px solid var(--line); }
.ss-header .ss-container { height: 100%; display: flex; align-items: center; gap: var(--space-6); }
.ss-logo { display: inline-flex; align-items: center; height: 40px; }
.ss-logo img { height: 100%; width: auto; display: block; }
.ss-logo .on-dark { display: none; }
.ss-nav { display: flex; gap: var(--space-5); margin-inline-start: auto; }
.ss-nav a { color: var(--ink-2); text-decoration: none; font-weight: 400; font-size: 15px; transition: color var(--dur-fast); }
.ss-nav a:hover, .ss-nav a[aria-current="page"] { color: var(--purple); }
.ss-header-actions { display: flex; gap: var(--space-3); align-items: center; }
.ss-menu-btn { display: none; background: transparent; border: 1.5px solid var(--line-strong); color: var(--ink); border-radius: var(--r-sm); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.ss-mobile-nav { display: grid; gap: var(--space-1); padding: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.ss-mobile-nav a { padding: 12px 14px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 400; }
.ss-mobile-nav a:hover { background: var(--bg-alt); }
.ss-mobile-nav a.ss-btn { color: var(--on-purple); }
.ss-mobile-nav a.ss-btn:hover { background: var(--purple-d); }
@media (max-width: 860px) { .ss-nav, .ss-header-actions .ss-btn-outline { display: none; } .ss-header .ss-container { gap: var(--space-3); } .ss-header-actions { margin-inline-start: auto; } }
@media (max-width: 860px) { .ss-menu-btn { display: inline-flex; } }
@media (max-width: 520px) { .ss-header-actions { display: none; } .ss-menu-btn { margin-inline-start: auto; } .ss-logo { height: 34px; } }

/* ——— Hero ——— */
.ss-hero { position: relative; overflow: hidden; color: var(--white); background: linear-gradient(155deg, var(--hero-1) 0%, var(--hero-2) 45%, var(--purple) 100%); }
.ss-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1.3px, transparent 1.4px); background-size: 22px 22px; pointer-events: none; }
.ss-hero::after { content: ""; position: absolute; width: 520px; height: 520px; inset-inline-end: -120px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(111,199,179,.30), rgba(111,199,179,0) 65%); pointer-events: none; }
.ss-hero-inner { position: relative; z-index: 1; padding-block: var(--space-9); display: grid; gap: var(--space-5); max-width: 720px; }
.ss-hero h1 { color: var(--white); font-size: clamp(2rem, 5.2vw, 3.8rem); line-height: 1.25; font-weight: 700; }
.ss-hero h1 em { font-style: normal; color: var(--teal); }
.ss-hero p { color: rgba(255,255,255,.82); font-size: 1.15rem; max-width: 560px; }
.ss-hero .ss-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ss-triad { display: flex; gap: var(--space-3); align-items: center; font: 500 15px/1 var(--font-body); color: rgba(255,255,255,.85); }
.ss-triad i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ——— Cards ——— */
.ss-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--space-6); transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.ss-card:hover { transform: translateY(var(--lift-card)); box-shadow: var(--shadow-lg); }
.ss-card h3 { font-size: 1.3rem; line-height: 1.5; font-weight: 600; margin-bottom: var(--space-2); }
.ss-card p { color: var(--ink-2); }
.ss-card-static:hover { transform: none; box-shadow: var(--shadow); }
.ss-feature-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: var(--white); margin-bottom: var(--space-4); }
.ss-g-purple { background: linear-gradient(135deg, var(--purple-d), var(--purple-l)); }
.ss-g-teal { background: linear-gradient(135deg, var(--teal-d), var(--teal)); }
.ss-g-blue { background: linear-gradient(135deg, var(--blue), var(--purple-l)); }
.ss-g-orange { background: linear-gradient(135deg, var(--orange-text), var(--orange)); }
.ss-g-green { background: linear-gradient(135deg, var(--green-text), var(--green)); }
.ss-g-yellow { background: linear-gradient(135deg, var(--orange), var(--yellow)); color: var(--purple-dd); }

/* ——— Badges / status ——— */
.ss-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--r-pill); font: 500 13px/1.6 var(--font-body); white-space: nowrap; }
.ss-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.ss-badge-verified { background: var(--teal); color: var(--purple-dd); }
.ss-badge-pending { background: var(--yellow); color: var(--purple-dd); }
.ss-badge-soon { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }
.ss-badge-error { background: var(--orange-text); color: var(--white); }
.ss-badge-info { background: var(--bg-alt); color: var(--blue); border: 1px solid var(--line); }
.ss-badge-plain::before { display: none; }
.ss-badge-hot { background: var(--orange-text); color: var(--white); font-weight: 500; }

/* ——— Tags (style / emotion) ——— */
.ss-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ss-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 11px; border-radius: var(--r-pill); font: 400 13px/1.7 var(--font-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color var(--dur-fast), color var(--dur-fast); }
.ss-tag:hover { border-color: var(--purple); color: var(--purple); }
.ss-tag[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: var(--on-purple); }
.ss-tag-emotion[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--purple-dd); }

/* ——— Dialect chips (on dark) ——— */
.ss-on-dark { background: linear-gradient(150deg, var(--section-dark-1), var(--section-dark-2)); color: var(--white); }
.ss-on-dark h2, .ss-on-dark h3 { color: var(--white); }
.ss-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ss-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: var(--r-pill); font: 400 15px/1.4 var(--font-body); color: var(--white); background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.18); }
.ss-chip small { font-size: 12px; color: rgba(255,255,255,.70); }
.ss-chip-featured { border-color: var(--teal); background: rgba(111,199,179,.12); }
.ss-chip-featured::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* ——— Steps ——— */
.ss-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-5); counter-reset: step; }
.ss-step { display: grid; gap: var(--space-2); align-content: start; }
.ss-step-num { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--purple); color: var(--on-purple); font: 700 1.25rem/1 var(--font-display); }
.ss-step h3 { font-size: 1.2rem; font-weight: 600; }
.ss-step p { color: var(--ink-2); font-size: 15.5px; }

/* ——— Price card ——— */
.ss-price { position: relative; display: grid; gap: var(--space-4); align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-6); box-shadow: var(--shadow); }
.ss-price-featured { border: 2px solid var(--purple); box-shadow: var(--shadow-lg); }
.ss-price .ss-badge-hot { position: absolute; top: -14px; inset-inline-start: var(--space-6); }
.ss-price h3 { font-size: 1.3rem; font-weight: 600; }
.ss-price-amount { display: flex; align-items: baseline; gap: var(--space-2); }
.ss-price-amount .num { font-size: 2.4rem; font-weight: 700; color: var(--ink); line-height: 1; }
.ss-price-amount span { color: var(--muted); font-size: 14px; }
.ss-price ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ss-price li { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.ss-price li svg { color: var(--teal-text); margin-top: 4px; }

/* ——— Forms ——— */
.ss-field { display: grid; gap: 6px; }
.ss-label { font: 500 14px/1.6 var(--font-body); color: var(--ink); }
.ss-hint { font-size: 13px; color: var(--muted); }
.ss-input, .ss-select, .ss-textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 300 16px/1.6 var(--font-body); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.ss-textarea { min-height: 140px; resize: vertical; line-height: 1.9; }
.ss-input::placeholder, .ss-textarea::placeholder { color: var(--muted); }
.ss-input:focus, .ss-select:focus, .ss-textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.ss-input.ltr { text-align: left; }
.ss-field-error .ss-input { border-color: var(--orange); }
.ss-field-error .ss-hint { color: var(--orange-text); }
.ss-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 18px 21px, 23px 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 40px; }

/* ——— Notes ——— */
.ss-note { display: flex; gap: var(--space-3); padding: 14px 16px; border-radius: var(--r-sm); background: var(--bg-alt); color: var(--ink-2); font-size: 15px; border-inline-start: 4px solid var(--purple); }
.ss-note svg { flex: none; margin-top: 3px; }
.ss-note strong { color: var(--ink); font-weight: 500; }
.ss-note-success { border-inline-start-color: var(--green); } .ss-note-success svg { color: var(--green-text); }
.ss-note-warn { border-inline-start-color: var(--yellow); }
.ss-note-error { border-inline-start-color: var(--orange); } .ss-note-error svg { color: var(--orange-text); }
.ss-note-info { border-inline-start-color: var(--blue); } .ss-note-info svg { color: var(--blue); }
.ss-note-voice { border-inline-start-color: var(--teal); } .ss-note-voice svg { color: var(--teal-text); }

/* ——— Credit meter ——— */
.ss-meter { display: grid; gap: var(--space-2); }
.ss-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.ss-meter-head .num { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.ss-meter-track { height: 10px; border-radius: var(--r-pill); background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; }
.ss-meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(270deg, var(--purple), var(--teal)); }
.ss-meter-low .ss-meter-fill { background: linear-gradient(270deg, var(--orange), var(--yellow)); }

/* ——— Audio player ——— */
.ss-player { display: flex; align-items: center; gap: var(--space-3); padding: 8px 10px 8px 16px; border-radius: var(--r-pill); background: var(--bg-alt); border: 1px solid var(--line); }
.ss-player-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--purple); color: var(--on-purple); cursor: pointer; flex: none; transition: background-color var(--dur-fast); }
.ss-player-btn:hover { background: var(--purple-d); }
.ss-player-bars { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; height: 32px; overflow: hidden; contain: inline-size; }
.ss-player-bars i { flex: 0 0 3px; border-radius: 2px; background: var(--line-strong); }
.ss-player-bars i.on { background: var(--teal-d); }
.ss-player-time { font: 400 13px/1 var(--font-latin); color: var(--muted); direction: ltr; font-variant-numeric: tabular-nums; flex: none; }

/* ——— Voice card ——— */
.ss-voice { display: grid; gap: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--space-5); box-shadow: var(--shadow); transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.ss-voice:hover { transform: translateY(var(--lift-card)); box-shadow: var(--shadow-lg); }
.ss-voice-top { display: flex; gap: var(--space-3); align-items: flex-start; }
.ss-voice-avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--white); }
.ss-voice-name { font: 700 1.25rem/1.4 var(--font-display); color: var(--ink); }
.ss-voice-meta { font-size: 14px; color: var(--muted); }
.ss-voice-top .ss-badge { margin-inline-start: auto; }
.ss-voice-foot { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.ss-vote { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.ss-vote button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink-2); font: 400 13px/1 var(--font-body); cursor: pointer; }
.ss-vote button:hover { border-color: var(--teal-d); color: var(--teal-text); }
.ss-vote button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--purple-dd); }
.ss-voice-soon { opacity: .75; }
.ss-voice-soon:hover { transform: none; box-shadow: var(--shadow); }

/* ——— Waveform ——— */
.ss-wave { display: inline-flex; align-items: center; gap: 5px; height: 64px; }
.ss-wave i { width: 6px; height: 100%; border-radius: 3px; background: var(--teal); transform-origin: center; animation: ss-wave var(--dur-wave) ease-in-out infinite; }
.ss-wave i:nth-child(2n) { animation-delay: -.4s; } .ss-wave i:nth-child(3n) { animation-delay: -.8s; } .ss-wave i:nth-child(5n) { animation-delay: -1.2s; } .ss-wave i:nth-child(7n) { animation-delay: -.2s; }
@keyframes ss-wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .ss-wave i { animation: none; transform: scaleY(.6); } .ss-wave i:nth-child(odd) { transform: scaleY(.9); } .ss-card, .ss-voice, .ss-btn { transition: none; } .ss-card:hover, .ss-voice:hover, .ss-btn:hover { transform: none; } }

/* ——— Footer ——— */
.ss-footer { background: linear-gradient(150deg, var(--section-dark-1), var(--section-dark-2)); color: rgba(255,255,255,.80); }
.ss-footer .ss-container { padding-block: var(--space-7); display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-6); }
.ss-footer h4 { color: var(--white); font-size: 1rem; font-weight: 600; margin-bottom: var(--space-3); }
.ss-footer a { color: rgba(255,255,255,.80); text-decoration: none; font-size: 15px; display: block; padding-block: 3px; }
.ss-footer a:hover { color: var(--teal); }
.ss-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.ss-footer-bottom .ss-container { padding-block: var(--space-4); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); grid-template-columns: none; font-size: 13px; color: rgba(255,255,255,.70); }
@media (max-width: 760px) { .ss-footer .ss-container { grid-template-columns: 1fr 1fr; } .ss-footer .ss-footer-brand { grid-column: 1 / -1; } }

/* ——— Section rhythm ——— */
.ss-section { padding-block: var(--space-9); }
.ss-section-alt { background: var(--bg-alt); }
.ss-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: var(--space-5); }
.ss-grid-3 > *, .ss-voice > * { min-width: 0; }
@media (max-width: 760px) { .ss-section { padding-block: var(--space-8); } .ss-hero-inner { padding-block: var(--space-8); } }

/* الشعار حسب الوضع */
[data-theme="dark"] .ss-logo .on-light { display: none; }
[data-theme="dark"] .ss-logo .on-dark { display: block; }
.ss-hero .ss-logo .on-light, .ss-footer .ss-logo .on-light { display: none; }
.ss-hero .ss-logo .on-dark, .ss-footer .ss-logo .on-dark { display: block; }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ss-logo .on-light { display: none; } :root:not([data-theme="light"]) .ss-logo .on-dark { display: block; } }

/* ——— من نظام التصميم 18: دورانُ التحميل وحالتا الزرّ ——— */
/* التحميل: دائرة دوران مكان الأيقونة (أو قبل النصّ) والزرّ معطّل بـdisabled وaria-busy؛ يبقى بلون نوعه ليُعرف أيّ زرّ يعمل */
.ss-spin { width: 18px; height: 18px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: ss-spin .8s linear infinite; }
.ss-btn-sm .ss-spin, .ss-mini .ss-spin { width: 14px; height: 14px; }
.ss-btn-lg .ss-spin { width: 20px; height: 20px; }
.ss-player-btn .ss-spin { width: 16px; height: 16px; }
@keyframes ss-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ss-spin { animation-duration: 2.4s; } }
.ss-btn[aria-busy="true"], .ss-mini[aria-busy="true"], .ss-player-btn[aria-busy="true"] { cursor: progress; transform: none; box-shadow: none; opacity: .85; }
.ss-btn-primary[aria-busy="true"] { background: var(--purple); color: var(--on-purple); border-color: transparent; }
.ss-btn-teal[aria-busy="true"] { background: var(--teal); color: var(--purple-dd); border-color: transparent; }
.ss-btn-outline[aria-busy="true"] { background: transparent; color: var(--purple); border-color: var(--purple); }
.ss-btn-ghost[aria-busy="true"] { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }
/* يعمل: زرّ استماع يشغّل الآن؛ أيقونة إيقاف ونصّ «إيقاف مؤقت» وخلفيّة أعمق */
.ss-btn-outline.is-playing, .ss-mini.is-playing { background: var(--bg-alt); color: var(--purple); border-color: var(--purple); }
.ss-btn-teal.is-playing { box-shadow: inset 0 0 0 2px var(--purple-dd); }
.ss-btn-primary.is-playing, .ss-player-btn.is-playing { background: var(--purple-d); }

/* أشرطةُ التمرير رفيعةٌ بلون الحدود في الوضعين (كما في ds.css) */
html, .ss, .ss * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
