/* Tabyaran SMM V3 — shared UI component system. Visual-only; preserves existing handlers and markup behavior. */
:root{
 --tby-c3-accent:#6f52ff;--tby-c3-accent-2:#16b9f2;--tby-c3-success:#1fa971;--tby-c3-danger:#d94b63;--tby-c3-warning:#d89a25;
 --tby-c3-surface:rgba(13,20,36,.96);--tby-c3-surface-soft:rgba(255,255,255,.045);--tby-c3-line:rgba(180,197,236,.15);
 --tby-c3-text:#f6f8ff;--tby-c3-muted:#9daac2;--tby-c3-focus:#57c7ff;--tby-c3-radius:14px;--tby-c3-radius-lg:20px;
 --tby-c3-control-h:46px;--tby-c3-shadow:0 14px 38px rgba(2,7,20,.18)
}
html[data-tby-theme="light"]{--tby-c3-surface:#fff;--tby-c3-surface-soft:#f6f8fd;--tby-c3-line:rgba(38,52,83,.15);--tby-c3-text:#18243b;--tby-c3-muted:#66718a;--tby-c3-shadow:0 14px 34px rgba(37,51,85,.09)}

/* Buttons */
body.tby-v1-system :where(.btn,.button,button.tby-button,.tby-btn),body.tby-v1-app :where(.btn,.button,button.tby-button,.tby-btn),body.tby-v1-public :where(.btn,.button,button.tby-button,.tby-btn){
 display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--tby-c3-control-h);padding:10px 17px;border:1px solid transparent;border-radius:var(--tby-c3-radius);font:inherit;font-weight:800;line-height:1.35;text-decoration:none;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease,opacity .16s ease;max-width:100%
}
body :where(.btn,.button,.tby-btn):not(.ghost):not(.secondary):not(.danger){background:linear-gradient(135deg,var(--tby-c3-accent),var(--tby-c3-accent-2));color:#fff;box-shadow:0 9px 26px rgba(85,80,235,.22)}
body :where(.btn,.button,.tby-btn).secondary,body :where(.btn,.button,.tby-btn).ghost{background:var(--tby-c3-surface-soft);color:var(--tby-c3-text);border-color:var(--tby-c3-line);box-shadow:none}
body :where(.btn,.button,.tby-btn).danger{background:color-mix(in srgb,var(--tby-c3-danger) 14%,var(--tby-c3-surface));color:#ffb4c0;border-color:color-mix(in srgb,var(--tby-c3-danger) 38%,transparent);box-shadow:none}
html[data-tby-theme="light"] body :where(.btn,.button,.tby-btn).danger{color:#a62d43}
body :where(.btn,.button,.tby-btn):hover:not(:disabled):not([aria-disabled="true"]){transform:translateY(-1px);box-shadow:0 12px 28px rgba(77,83,220,.23)}
body :where(.btn,.button,.tby-btn):active:not(:disabled){transform:translateY(0)}
body :where(.btn,.button,.tby-btn):disabled,body :where(.btn,.button,.tby-btn)[aria-disabled="true"]{opacity:.48;cursor:not-allowed;box-shadow:none;transform:none;pointer-events:none}
body :where(.btn,.button,.tby-btn)[aria-busy="true"],body :where(.btn,.button,.tby-btn).is-loading{position:relative;cursor:wait;opacity:.78;padding-inline-start:42px}
body :where(.btn,.button,.tby-btn)[aria-busy="true"]::before,body :where(.btn,.button,.tby-btn).is-loading::before{content:"";position:absolute;inset-inline-start:16px;width:15px;height:15px;border:2px solid currentColor;border-inline-start-color:transparent;border-radius:50%;animation:tby-c3-spin .7s linear infinite}
@keyframes tby-c3-spin{to{transform:rotate(360deg)}}

/* Forms */
body.tby-v1-system :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea),body.tby-v1-app :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea),body.tby-v1-public :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
 width:100%;max-width:100%;min-height:var(--tby-c3-control-h);padding:10px 13px;border:1px solid var(--tby-c3-line);border-radius:var(--tby-c3-radius);background:var(--tby-c3-surface);color:var(--tby-c3-text);font:inherit;line-height:1.45;outline:0;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease
}
body :where(textarea){min-height:112px;resize:vertical}
body :where(input,select,textarea)::placeholder{color:color-mix(in srgb,var(--tby-c3-muted) 78%,transparent);opacity:1}
body :where(input,select,textarea):focus-visible{border-color:color-mix(in srgb,var(--tby-c3-focus) 70%,var(--tby-c3-line));box-shadow:0 0 0 3px color-mix(in srgb,var(--tby-c3-focus) 18%,transparent)}
body :where(input,select,textarea)[aria-invalid="true"],body :where(.is-error input,.is-error select,.is-error textarea){border-color:color-mix(in srgb,var(--tby-c3-danger) 72%,var(--tby-c3-line));box-shadow:0 0 0 3px color-mix(in srgb,var(--tby-c3-danger) 12%,transparent)}
body :where(.is-success input,.is-success select,.is-success textarea){border-color:color-mix(in srgb,var(--tby-c3-success) 65%,var(--tby-c3-line))}
body :where(label){color:var(--tby-c3-text)}
body :where(.field-error,.form-error,.error-message){color:#ff9daf;font-size:.86rem;line-height:1.65}
body :where(.field-success,.form-success,.success-message){color:#6be0ac;font-size:.86rem;line-height:1.65}
body :where(input[type="checkbox"],input[type="radio"]){accent-color:var(--tby-c3-accent);width:18px;height:18px;vertical-align:middle}
body :where(input[type="search"],.search-input){padding-inline-start:14px}

/* Shared cards / surfaces */
body :where(.panel,.card,.tby-card,.tby-operation-card,.tby-history-card){border-color:var(--tby-c3-line);border-radius:var(--tby-c3-radius-lg);background-color:var(--tby-c3-surface);box-shadow:var(--tby-c3-shadow)}
body :where(.badge,.status,.status-chip,.tby-badge,.tby-chip){display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:28px;padding:4px 10px;border:1px solid var(--tby-c3-line);border-radius:999px;background:var(--tby-c3-surface-soft);color:var(--tby-c3-text);font-size:.78rem;font-weight:800;line-height:1.35;overflow-wrap:anywhere}
body :where(.badge,.status,.status-chip,.tby-badge,.tby-chip).success{color:#71e5b5;border-color:color-mix(in srgb,var(--tby-c3-success) 38%,transparent);background:color-mix(in srgb,var(--tby-c3-success) 10%,transparent)}
body :where(.badge,.status,.status-chip,.tby-badge,.tby-chip).error,body :where(.badge,.status,.status-chip,.tby-badge,.tby-chip).danger{color:#ff9daf;border-color:color-mix(in srgb,var(--tby-c3-danger) 38%,transparent);background:color-mix(in srgb,var(--tby-c3-danger) 10%,transparent)}

/* Tabs / accordion */
body :where([role="tablist"],.tabs,.tby-tabs){display:flex;gap:8px;align-items:center;max-width:100%;flex-wrap:wrap;padding:5px;border:1px solid var(--tby-c3-line);border-radius:var(--tby-c3-radius-lg);background:var(--tby-c3-surface-soft)}
body :where([role="tab"],.tab,.tby-tab){min-height:40px;padding:8px 13px;border:0;border-radius:11px;background:transparent;color:var(--tby-c3-muted);font-weight:800;cursor:pointer}
body :where([role="tab"][aria-selected="true"],.tab.active,.tby-tab.active){background:var(--tby-c3-surface);color:var(--tby-c3-text);box-shadow:0 5px 16px rgba(3,8,25,.12)}
body :where(details,.accordion,.tby-accordion){border:1px solid var(--tby-c3-line);border-radius:var(--tby-c3-radius);background:var(--tby-c3-surface);overflow:hidden}
body details>summary{padding:14px 16px;cursor:pointer;font-weight:800;list-style-position:inside}
body details[open]>summary{border-bottom:1px solid var(--tby-c3-line)}
body details>:not(summary){margin-inline:16px}

/* Dialog / drawer */
body :where(dialog,.modal,.tby-modal,.drawer,.tby-drawer){border:1px solid var(--tby-c3-line);border-radius:var(--tby-c3-radius-lg);background:var(--tby-c3-surface);color:var(--tby-c3-text);box-shadow:0 28px 90px rgba(0,0,0,.35);max-width:min(92vw,720px);max-height:min(88vh,820px);overflow:auto}
body dialog::backdrop{background:rgba(3,7,16,.68);backdrop-filter:blur(5px)}

/* Notice / toast and semantic states */
body :where(.notice,.alert,.tby-notice,.tby-toast,.toast){padding:13px 15px;border:1px solid var(--tby-c3-line);border-radius:var(--tby-c3-radius);background:var(--tby-c3-surface-soft);color:var(--tby-c3-text);line-height:1.7;overflow-wrap:anywhere}
body :where(.notice,.alert,.tby-notice,.tby-toast,.toast).success{border-color:color-mix(in srgb,var(--tby-c3-success) 38%,transparent);background:color-mix(in srgb,var(--tby-c3-success) 9%,var(--tby-c3-surface))}
body :where(.notice,.alert,.tby-notice,.tby-toast,.toast).error{border-color:color-mix(in srgb,var(--tby-c3-danger) 38%,transparent);background:color-mix(in srgb,var(--tby-c3-danger) 9%,var(--tby-c3-surface))}
body :where(.tby-empty-state,.empty-state,.tby-v11-empty,.tby-v11-inline-empty,.tby-error-state,.error-state,.tby-success-state,.success-state,.tby-loading-state,.loading-state){display:grid;place-items:center;gap:9px;min-height:120px;padding:24px 18px;border:1px dashed var(--tby-c3-line);border-radius:var(--tby-c3-radius-lg);background:var(--tby-c3-surface-soft);color:var(--tby-c3-muted);text-align:center;line-height:1.75}
body :where(.tby-error-state,.error-state,.tby-v11-inline-error){border-color:color-mix(in srgb,var(--tby-c3-danger) 35%,transparent)}
body :where(.tby-success-state,.success-state){border-color:color-mix(in srgb,var(--tby-c3-success) 35%,transparent)}
body :where(.skeleton,.tby-skeleton,.tby-v11-skeleton){position:relative;overflow:hidden;color:transparent!important;background:color-mix(in srgb,var(--tby-c3-muted) 10%,var(--tby-c3-surface))!important;border-radius:10px;min-height:16px}
body :where(.skeleton,.tby-skeleton,.tby-v11-skeleton)::after{content:"";position:absolute;inset:0;transform:translateX(100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);animation:tby-c3-shimmer 1.35s infinite}
@keyframes tby-c3-shimmer{to{transform:translateX(-100%)}}

/* Focus, overflow and responsive guards */
body :where(a,button,input,select,textarea,summary,[role="tab"],[tabindex]):focus-visible{outline:3px solid color-mix(in srgb,var(--tby-c3-focus) 78%,transparent);outline-offset:3px}
body :where(.panel,.card,.tby-card,.modal,.tby-modal,.drawer,.tby-drawer,form,fieldset){min-width:0;max-width:100%}
body :where(table,pre,code){max-width:100%}
body :where(pre){overflow:auto}
@media(max-width:768px){body :where(.btn,.button,.tby-btn){min-height:46px}body :where([role="tablist"],.tabs,.tby-tabs){display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}body :where(dialog,.modal,.tby-modal){max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px)}body :where(.panel,.card,.tby-card){border-radius:16px}}
@media(max-width:430px){body :where(.btn,.button,.tby-btn){width:100%}body :where([role="tablist"],.tabs,.tby-tabs){grid-template-columns:1fr 1fr}body :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px}}
@media(prefers-reduced-motion:reduce){body :where(.btn,.button,.tby-btn,input,select,textarea){transition:none!important}body :where(.skeleton,.tby-skeleton,.tby-v11-skeleton)::after,body :where(.btn,.button,.tby-btn)[aria-busy="true"]::before,body :where(.btn,.button,.tby-btn).is-loading::before{animation:none!important}}
