.btn { min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: var(--radius-control); border: 1px solid transparent; text-decoration: none; cursor: pointer; font-weight: 700; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { color: var(--purple-900); border-color: var(--purple-500); background: linear-gradient(180deg, #fff, #fbf7ff); }
.btn--primary:hover { background: #f8efff; border-color: var(--purple-700); }
.btn--secondary { color: #4f4457; border-color: var(--border-strong); background: var(--surface); }
.btn--secondary:hover { border-color: var(--purple-300); color: var(--purple-900); }
.btn--danger { color: var(--danger); border-color: #efb5b0; background: #fff; }
.btn--danger:hover { background: #fff5f4; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-control); border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.control { width: 100%; min-height: var(--control-height); border: 1px solid var(--border-strong); border-radius: var(--radius-control); padding: 9px 12px; background: #fff; color: var(--text); }
.control:hover { border-color: var(--purple-300); }
.control:focus { outline: none; border-color: var(--purple-500); box-shadow: var(--focus-ring); }
.field { display: grid; gap: 7px; }
.field__label { font-size: .88rem; font-weight: 700; color: #493f50; }
.eyebrow { display: inline-block; color: var(--purple-700); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.status-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 6px; font-size: .8rem; font-weight: 800; border: 1px solid var(--border); background: #fff; }
.status-chip--success { color: var(--success); border-color: #b8dfcb; background: #f4fbf7; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #ccc; }
.status-dot--ok { background: var(--success); box-shadow: 0 0 0 4px rgba(29,122,80,.08); }
.status-dot--warn { background: #c98900; box-shadow: 0 0 0 4px rgba(201,137,0,.08); }
.modal { position: fixed; inset: 0; display: none; z-index: 1000; padding: 20px; align-items: center; justify-content: center; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(26, 14, 35, .45); }
.modal__dialog { position: relative; width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-modal); box-shadow: var(--shadow-md); }
.modal__header, .modal__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.modal__header { border-bottom: 1px solid var(--border); }
.modal__header h2 { margin: 0; }
.modal__body { padding: 20px; color: var(--text-muted); }
.modal__footer { border-top: 1px solid var(--border); justify-content: flex-end; }
.toast-stack { position: fixed; top: 18px; right: 18px; width: min(360px, calc(100vw - 36px)); display: grid; gap: 10px; z-index: 2000; }
.toast { padding: 13px 14px; border: 1px solid var(--border); border-radius: 7px; background: #fff; box-shadow: var(--shadow-md); display: grid; gap: 2px; }
.toast strong { font-size: .9rem; }
.toast span { color: var(--text-muted); font-size: .84rem; }
.toast--success { border-left: 3px solid var(--success); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
.notice { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 11px 12px; font-size: .9rem; line-height: 1.45; }
.notice--error { background: #fff6f5; border-color: #efb5b0; color: #8c2d26; }
.notice--success { background: #f4fbf7; border-color: #b8dfcb; color: #17643f; }
.notice--info { background: #fbf7ff; border-color: #d9baf2; color: var(--purple-900); }
.btn[disabled] { opacity: .58; cursor: not-allowed; transform: none; }

/* Shared themed confirmation + processing dialogs. */
.modal__dialog--compact { width: min(470px, 100%); }
.app-action-modal__body { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 14px; }
.app-action-modal__body p { margin: 3px 0 0; color: var(--text-muted); line-height: 1.6; }
.app-action-modal__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--purple-300); background: #fbf7ff; color: var(--purple-900); font-size: 1.15rem; font-weight: 900; }
.app-action-modal__icon.is-danger { border-color: #efb5b0; background: #fff5f4; color: var(--danger); }
.app-processing-modal { z-index: 2400; }
.app-processing-modal .modal__backdrop { background: rgba(26,14,35,.34); backdrop-filter: blur(2px); }
.app-processing-modal__dialog { outline: none; }
.app-processing-modal__body { display: flex; align-items: center; gap: 18px; padding: 26px; }
.app-processing-modal__body h2 { margin: 0 0 6px; color: var(--text); font-size: 1.2rem; }
.app-processing-modal__body p { margin: 0; color: var(--text-muted); line-height: 1.5; }
.app-processing-spinner { width: 52px; height: 52px; flex: 0 0 52px; position: relative; display: grid; place-items: center; }
.app-processing-spinner::before { content: ''; position: absolute; inset: 2px; border: 3px solid rgba(157,78,221,.16); border-top-color: var(--purple-700); border-radius: 50%; animation: app-processing-spin .8s linear infinite; }
.app-processing-spinner span { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--purple-500); opacity: .25; }
.app-processing-spinner span:nth-child(1) { transform: translateY(-13px); opacity: .9; }
.app-processing-spinner span:nth-child(2) { transform: translate(11px,7px); opacity: .55; }
.app-processing-spinner span:nth-child(3) { transform: translate(-11px,7px); opacity: .35; }
@keyframes app-processing-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .app-action-modal__body { grid-template-columns: 1fr; } .app-action-modal__icon { width: 40px; height: 40px; } .app-processing-modal__body { align-items: flex-start; } }
