/* ==========================================================================
   DruidHub components. One stylesheet for every signed-in page, built only on
   tokens.css, light and dark. Class names keep the .sh-* prefix the app pages
   already use. Reference: docs/design-system.md
   ========================================================================== */

/* ---- Base for app pages. Wrapped in :where() so these rules carry no
   specificity and any page's own element styles still win. ---- */
:where(.sh-app) body {
    margin: 0;
    font-family: var(--dh-font);
    font-size: var(--dh-fs-md);
    line-height: var(--dh-lh-normal);
    color: var(--dh-text);
    background: var(--dh-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
:where(.sh-app) *, :where(.sh-app) *::before, :where(.sh-app) *::after { box-sizing: border-box; }
/* Role-shell pages were built on a zero-margin reset; keep it for them. */
:where(.sh-reset) *, :where(.sh-reset) *::before, :where(.sh-reset) *::after { margin: 0; padding: 0; }
:where(.sh-app) :where(img, svg, video) { max-width: 100%; }
:where(.sh-app) a { color: var(--dh-brand-text); text-underline-offset: 2px; }
:where(.sh-app) :where(button, input, select, textarea) { font-family: inherit; }
:where(.sh-app) :where(code, kbd, pre, samp) { font-family: var(--dh-font-mono); }
:where(.sh-app) ::selection { background: var(--dh-brand-soft); color: var(--dh-text); }
:where(.sh-app) { scrollbar-color: var(--dh-border-strong) transparent; }
:where(.sh-app) :focus-visible { outline: 2px solid var(--dh-focus); outline-offset: 2px; }
.sh-app [hidden] { display: none !important; } /* documented: [hidden] must beat component display rules */

.sh-sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Page header ---- */
.sh-page-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--dh-space-4); flex-wrap: wrap; padding: var(--dh-space-1) 0;
}
.sh-page-header__left { min-width: 0; }
.sh-page-header__title {
    font-size: var(--dh-fs-2xl); font-weight: var(--dh-fw-heavy);
    color: var(--dh-text); letter-spacing: -0.03em; line-height: var(--dh-lh-tight);
}
.sh-page-header__sub { margin-top: 2px; font-size: var(--dh-fs-sm); color: var(--dh-text-2); font-weight: var(--dh-fw-medium); }
.sh-page-header__actions { display: flex; gap: var(--dh-space-2); align-items: center; flex-wrap: wrap; }

/* ---- Cards ---- */
.sh-card {
    background: var(--dh-surface); color: var(--dh-text);
    border-radius: var(--dh-radius-lg); padding: 22px; box-shadow: var(--dh-shadow);
}
.sh-card--sm { padding: 14px 16px; }
.sh-card--lg { padding: 28px; }
.sh-card--flat { box-shadow: none; border: 1px solid var(--dh-border); }
.sh-card__title {
    font-size: var(--dh-fs-md); font-weight: var(--dh-fw-heavy); color: var(--dh-text);
    margin-bottom: 14px; letter-spacing: -0.01em;
}
.sh-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--dh-space-3); margin-bottom: 14px; }
.sh-card__head .sh-card__title { margin-bottom: 0; }
a.sh-card { text-decoration: none; transition: transform var(--dh-dur) var(--dh-ease), box-shadow var(--dh-dur) var(--dh-ease); }
a.sh-card:hover { transform: translate(-1px, -1px); box-shadow: var(--dh-shadow-lg); }

.sh-grid { display: grid; gap: var(--dh-space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.sh-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ---- Stats ---- */
.sh-stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.sh-stat { background: var(--dh-surface); border-radius: var(--dh-radius-lg); padding: 18px; box-shadow: var(--dh-shadow); }
.sh-stat__icon {
    width: 38px; height: 38px; border-radius: 11px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center; background: var(--dh-brand-soft);
}
.sh-stat__icon .material-symbols-outlined { font-size: 18px; color: var(--dh-brand-text); font-variation-settings: 'FILL' 1; }
.sh-stat__label {
    font-size: var(--dh-fs-xs); font-weight: var(--dh-fw-heavy); color: var(--dh-text-2);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.sh-stat__value { font-size: 1.75rem; font-weight: var(--dh-fw-heavy); color: var(--dh-text); letter-spacing: -0.03em; line-height: 1; }
.sh-stat__delta { font-size: var(--dh-fs-xs); font-weight: var(--dh-fw-bold); margin-top: 6px; color: var(--dh-text-2); }
.sh-stat__delta--up { color: var(--dh-success); }
.sh-stat__delta--down { color: var(--dh-danger); }

/* ---- Buttons ---- */
.sh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 8px 16px;
    font-family: var(--dh-font); font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-bold); line-height: 1.2;
    border: 1.5px solid transparent; border-radius: var(--dh-radius-pill);
    background: var(--dh-surface-3); color: var(--dh-text);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background var(--dh-dur) var(--dh-ease), color var(--dh-dur) var(--dh-ease),
                border-color var(--dh-dur) var(--dh-ease), transform var(--dh-dur-fast) var(--dh-ease);
}
.sh-btn:hover { background: var(--dh-border); }
.sh-btn:active { transform: translateY(1px); }
.sh-btn--primary { background: var(--dh-brand); color: var(--dh-on-brand); }
.sh-btn--primary:hover { background: var(--dh-brand-hover); color: var(--dh-on-brand); }
.sh-btn--secondary { background: var(--dh-brand-soft); color: var(--dh-brand-text); }
.sh-btn--secondary:hover { background: var(--dh-brand-soft); border-color: var(--dh-brand-text); }
.sh-btn--ghost { background: var(--dh-surface); color: var(--dh-text); box-shadow: var(--dh-shadow-sm); border-color: var(--dh-border); }
.sh-btn--ghost:hover { background: var(--dh-surface-2); }
.sh-btn--outline { background: transparent; color: var(--dh-text); border-color: var(--dh-border-strong); }
.sh-btn--outline:hover { background: var(--dh-surface-2); }
.sh-btn--danger { background: var(--dh-danger); color: var(--dh-on-danger); }
.sh-btn--danger:hover { background: var(--dh-danger); filter: brightness(0.94); }
.sh-btn--link { background: none; border: 0; padding: 0; min-height: 0; color: var(--dh-brand-text); text-decoration: underline; }
.sh-btn--link:hover { background: none; }
.sh-btn--sm { min-height: 30px; padding: 5px 12px; font-size: var(--dh-fs-xs); }
.sh-btn--lg { min-height: 44px; padding: 11px 22px; font-size: var(--dh-fs-md); }
.sh-btn--block { display: flex; width: 100%; }
.sh-btn--icon { padding: 0; width: 36px; min-width: 36px; height: 36px; border-radius: 10px; }
.sh-btn .material-symbols-outlined { font-size: 16px; }
.sh-btn--sm .material-symbols-outlined { font-size: 14px; }
.sh-btn--lg .material-symbols-outlined { font-size: 18px; }
.sh-btn[disabled], .sh-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- Forms ---- */
.sh-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.sh-label, .sh-form__label { display: block; font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-bold); color: var(--dh-text); margin-bottom: 6px; }
.sh-field .sh-label { margin-bottom: 0; }
.sh-label .req, .sh-form__label .req { color: var(--dh-danger); margin-left: 2px; }
.sh-input, .sh-select, .sh-textarea,
.sh-form__input, .sh-form__select, .sh-form__textarea,
/* Fields in a card's form get the shared look, at low specificity (:where) so a page's
   own class on a field still wins (wave 2: H's raised-panel fields were overridden). */
:where(.sh-card, .sh-form) form :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"], input[type="file"], select, textarea) {
    width: 100%; min-height: 40px; padding: 9px 13px;
    font-family: var(--dh-font); font-size: var(--dh-fs-md); color: var(--dh-text);
    background: var(--dh-surface); border: 1.5px solid var(--dh-border-strong); border-radius: 10px;
    transition: border-color var(--dh-dur) var(--dh-ease), box-shadow var(--dh-dur) var(--dh-ease);
}
.sh-input::placeholder, .sh-textarea::placeholder, .sh-form__input::placeholder, .sh-form__textarea::placeholder,
.sh-card form :is(input, textarea)::placeholder, .sh-form form :is(input, textarea)::placeholder { color: var(--dh-text-3); opacity: 1; }
.sh-input:focus, .sh-select:focus, .sh-textarea:focus,
.sh-form__input:focus, .sh-form__select:focus, .sh-form__textarea:focus,
.sh-card form :is(input, select, textarea):focus, .sh-form form :is(input, select, textarea):focus {
    outline: none; border-color: var(--dh-brand); box-shadow: 0 0 0 3px var(--dh-brand-soft);
}
.sh-input:disabled, .sh-select:disabled, .sh-textarea:disabled,
.sh-card form :is(input, select, textarea):disabled { background: var(--dh-surface-3); color: var(--dh-text-2); cursor: not-allowed; }
.sh-select, .sh-form__select, :where(.sh-card, .sh-form) form select {
    appearance: none; -webkit-appearance: none; padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--dh-text-2) 50%), linear-gradient(135deg, var(--dh-text-2) 50%, transparent 50%);
    background-position: calc(100% - 19px) 55%, calc(100% - 14px) 55%;
    background-size: 5px 5px; background-repeat: no-repeat;
}
.sh-select[multiple], :where(.sh-card) form select[multiple] { background-image: none; padding-right: 13px; }
.sh-textarea, .sh-form__textarea, :where(.sh-card, .sh-form) form textarea { min-height: 96px; resize: vertical; line-height: var(--dh-lh-normal); }
.sh-input[aria-invalid="true"], .sh-select[aria-invalid="true"], .sh-textarea[aria-invalid="true"],
.sh-field--error :is(input, select, textarea) { border-color: var(--dh-danger); }
.sh-help, .sh-form__hint, .sh-card form .helptext { font-size: var(--dh-fs-xs); color: var(--dh-text-2); }
.sh-error, .sh-card form .errorlist { margin: 0; padding: 0; list-style: none; font-size: var(--dh-fs-xs); font-weight: var(--dh-fw-semibold); color: var(--dh-danger); }
.sh-check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--dh-fs-md); color: var(--dh-text); cursor: pointer; }
.sh-check input[type="checkbox"], .sh-check input[type="radio"],
:where(.sh-app) input[type="checkbox"], :where(.sh-app) input[type="radio"] { accent-color: var(--dh-brand); width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.sh-card form p, .sh-form form p { margin-bottom: 16px; }
.sh-card form label, .sh-form form label { display: block; font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-bold); color: var(--dh-text); margin-bottom: 6px; }

.sh-form { max-width: 560px; margin: 0 auto; background: var(--dh-surface); border-radius: var(--dh-radius-lg); padding: 28px; box-shadow: var(--dh-shadow); }
.sh-form--wide { max-width: 820px; }
.sh-form__header { text-align: center; margin-bottom: 22px; }
.sh-form__title { font-size: 1.375rem; font-weight: var(--dh-fw-heavy); color: var(--dh-text); letter-spacing: -0.02em; margin-bottom: 4px; }
.sh-form__sub { font-size: var(--dh-fs-sm); color: var(--dh-text-2); }
.sh-form__field { margin-bottom: 16px; }
.sh-form__field:last-child { margin-bottom: 0; }
.sh-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .sh-form__row { grid-template-columns: 1fr; } .sh-form { padding: 20px; } }
.sh-form__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--dh-border); }
.sh-form__actions--split { justify-content: space-between; }

/* ---- Tables ---- */
.sh-table-wrap { overflow: auto; border-radius: var(--dh-radius-lg); background: var(--dh-surface); box-shadow: var(--dh-shadow); max-width: 100%; }
.sh-table-wrap--tall { max-height: 70vh; }
.sh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--dh-fs-sm); color: var(--dh-text); }
.sh-table th {
    position: sticky; top: 0; z-index: 1;
    padding: 12px 16px; text-align: left; white-space: nowrap;
    font-size: var(--dh-fs-xs); font-weight: var(--dh-fw-heavy); text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--dh-text-2); background: var(--dh-surface-2); border-bottom: 1px solid var(--dh-border);
}
.sh-table td { padding: 13px 16px; border-bottom: 1px solid var(--dh-border); vertical-align: middle; }
.sh-table tr:last-child td { border-bottom: none; }
.sh-table tbody tr:hover td { background: var(--dh-surface-2); }
.sh-table--striped tbody tr:nth-child(even) td { background: var(--dh-surface-2); }
.sh-table--striped tbody tr:hover td { background: var(--dh-surface-3); }
.sh-table--compact th, .sh-table--compact td { padding: 8px 12px; }
.sh-table td.num, .sh-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .sh-table th, .sh-table td { padding: 10px 12px; } }

/* ---- Badges and chips ---- */
.sh-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
    border-radius: var(--dh-radius-pill); font-size: 0.6875rem; font-weight: var(--dh-fw-heavy);
    letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.4; white-space: nowrap;
    background: var(--dh-surface-3); color: var(--dh-text-2);
}
.sh-badge--success { background: var(--dh-success-soft); color: var(--dh-success); }
.sh-badge--warning { background: var(--dh-warning-soft); color: var(--dh-warning); }
.sh-badge--danger  { background: var(--dh-danger-soft);  color: var(--dh-danger); }
.sh-badge--info    { background: var(--dh-info-soft);    color: var(--dh-info); }
.sh-badge--neutral { background: var(--dh-surface-3);    color: var(--dh-text-2); }
.sh-badge--accent  { background: var(--dh-brand-soft);   color: var(--dh-brand-text); }
.sh-badge .material-symbols-outlined { font-size: 13px; }
.sh-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 14px;
    border-radius: var(--dh-radius-pill); border: 1.5px solid var(--dh-border); background: var(--dh-surface);
    color: var(--dh-text-2); font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-semibold); text-decoration: none; cursor: pointer;
}
.sh-chip:hover { border-color: var(--dh-border-strong); color: var(--dh-text); }
.sh-chip[aria-pressed="true"], .sh-chip--active { background: var(--dh-brand-soft); border-color: var(--dh-brand-text); color: var(--dh-brand-text); }

/* ---- Avatar ---- */
.sh-avatar {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--dh-role-soft); color: var(--dh-role);
    font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-heavy); letter-spacing: 0.02em;
}
.sh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sh-avatar--sm { width: 28px; height: 28px; border-radius: 8px; font-size: 0.6875rem; }
.sh-avatar--lg { width: 48px; height: 48px; border-radius: 14px; font-size: var(--dh-fs-md); }

/* ---- Tabs ---- */
.sh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--dh-border); overflow-x: auto; scrollbar-width: none; }
.sh-tabs::-webkit-scrollbar { display: none; }
.sh-tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; margin-bottom: -1px;
    border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; white-space: nowrap;
    font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-bold); color: var(--dh-text-2); text-decoration: none;
}
.sh-tab:hover { color: var(--dh-text); }
.sh-tab[aria-selected="true"], .sh-tab[aria-current="page"], .sh-tab--active { color: var(--dh-brand-text); border-bottom-color: var(--dh-brand); }

/* ---- Pagination (also styles includes/pagination.html) ---- */
.sh-pagination, :where(.sh-app) .pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.sh-pagination .sh-btn { min-width: 36px; }
:where(.sh-app) .pagination__btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px;
    border-radius: 10px; border: 1.5px solid var(--dh-border); background: var(--dh-surface);
    color: var(--dh-text); font-weight: var(--dh-fw-bold); font-size: var(--dh-fs-sm); text-decoration: none;
}
:where(.sh-app) a.pagination__btn:hover { border-color: var(--dh-border-strong); background: var(--dh-surface-2); }
:where(.sh-app) .pagination__btn--active { background: var(--dh-brand); border-color: var(--dh-brand); color: var(--dh-on-brand); }
:where(.sh-app) :is(.pagination__prev--disabled, .pagination__next--disabled) { opacity: 0.45; }
:where(.sh-app) .pagination__ellipsis { color: var(--dh-text-2); padding: 0 4px; }

/* ---- Alerts and flash messages ---- */
.sh-flash-stack { display: flex; flex-direction: column; gap: 8px; }
.sh-flash, .sh-alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
    border-radius: var(--dh-radius); border: 1px solid transparent;
    font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-semibold); line-height: var(--dh-lh-snug);
    background: var(--dh-info-soft); color: var(--dh-info);
}
.sh-flash .material-symbols-outlined, .sh-alert .material-symbols-outlined { font-size: 18px; flex-shrink: 0; margin-top: -1px; }
.sh-flash__text, .sh-alert__text { flex: 1; min-width: 0; color: var(--dh-text); }
.sh-flash--success, .sh-alert--success { background: var(--dh-success-soft); color: var(--dh-success); }
.sh-flash--error, .sh-alert--danger, .sh-alert--error { background: var(--dh-danger-soft); color: var(--dh-danger); }
.sh-flash--warning, .sh-alert--warning { background: var(--dh-warning-soft); color: var(--dh-warning); }
.sh-flash__close {
    flex-shrink: 0; width: 28px; height: 28px; margin: -4px -6px -4px 0; border: 0; border-radius: 8px;
    background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.sh-flash__close:hover { background: color-mix(in srgb, currentColor 12%, transparent); }

/* ---- Progress ---- */
.sh-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.sh-progress__track { flex: 1; height: 6px; border-radius: var(--dh-radius-pill); background: var(--dh-surface-3); overflow: hidden; }
.sh-progress__fill { height: 100%; border-radius: var(--dh-radius-pill); background: var(--dh-brand); width: var(--p, 0%); transition: width var(--dh-dur-slow) var(--dh-ease); }
.sh-progress__fill--warn { background: var(--dh-warning); }
.sh-progress__label { font-size: var(--dh-fs-xs); font-weight: var(--dh-fw-bold); min-width: 36px; text-align: right; color: var(--dh-text); }

/* ---- Empty state ---- */
.sh-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 48px 24px; color: var(--dh-text-2); max-width: 460px; margin: 0 auto;
}
.sh-empty__icon {
    width: 64px; height: 64px; border-radius: 18px; margin-bottom: 18px;
    background: var(--dh-brand-soft); display: flex; align-items: center; justify-content: center;
}
.sh-empty__icon .material-symbols-outlined { font-size: 30px; color: var(--dh-brand-text); font-variation-settings: 'FILL' 1; }
.sh-empty__title { font-size: var(--dh-fs-xl); font-weight: var(--dh-fw-heavy); color: var(--dh-text); margin-bottom: 6px; letter-spacing: -0.02em; }
.sh-empty__sub { font-size: var(--dh-fs-sm); line-height: 1.55; max-width: 340px; margin-bottom: 20px; }

/* ---- Skeleton (loading) ---- */
.sh-skeleton {
    display: block; border-radius: var(--dh-radius-sm); min-height: 12px;
    background: linear-gradient(90deg, var(--dh-surface-3) 25%, var(--dh-surface-2) 50%, var(--dh-surface-3) 75%);
    background-size: 200% 100%; animation: sh-shimmer 1.2s linear infinite;
}
.sh-skeleton--text { height: 12px; margin: 8px 0; }
.sh-skeleton--title { height: 20px; width: 45%; margin-bottom: 12px; }
.sh-skeleton--block { height: 120px; }
@keyframes sh-shimmer { to { background-position: -200% 0; } }
.sh-spinner {
    display: inline-block; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--dh-surface-3); border-top-color: var(--dh-brand); animation: sh-spin 0.7s linear infinite;
}
@keyframes sh-spin { to { transform: rotate(360deg); } }

/* ---- Dropdown menu (disclosure: a button with aria-expanded + a panel) ---- */
.sh-dropdown { position: relative; }
.sh-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--dh-z-dropdown);
    min-width: 240px; max-width: min(320px, calc(100vw - 24px)); padding: 6px;
    background: var(--dh-surface); color: var(--dh-text);
    border: 1px solid var(--dh-border); border-radius: 14px; box-shadow: var(--dh-shadow-pop);
}
.sh-menu__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--dh-border); margin-bottom: 6px; }
.sh-menu__label { padding: 8px 12px 4px; font-size: 0.6875rem; font-weight: var(--dh-fw-heavy); text-transform: uppercase; letter-spacing: 0.08em; color: var(--dh-text-2); }
.sh-menu__item, .sh-menu form button.sh-menu__item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px;
    border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; text-decoration: none;
    font-family: var(--dh-font); font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-semibold); color: var(--dh-text);
}
.sh-menu__item:hover, .sh-menu__item:focus-visible { background: var(--dh-surface-2); }
.sh-menu__item .material-symbols-outlined { font-size: 18px; color: var(--dh-text-2); }
.sh-menu__item--danger { color: var(--dh-danger); }
.sh-menu__item--danger .material-symbols-outlined { color: var(--dh-danger); }
.sh-menu__sep { height: 1px; background: var(--dh-border); margin: 6px 4px; }
.sh-menu form { margin: 0; }

/* ---- Modal dialog (static/js/confirm.js uses it; pages can too) ---- */
.sh-modal-backdrop {
    position: fixed; inset: 0; z-index: var(--dh-z-modal); background: var(--dh-overlay);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: sh-fade var(--dh-dur) var(--dh-ease);
}
.sh-modal {
    width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    background: var(--dh-surface); color: var(--dh-text);
    border-radius: var(--dh-radius-lg); box-shadow: var(--dh-shadow-pop); padding: 24px;
    animation: sh-rise var(--dh-dur) var(--dh-ease);
}
.sh-modal__icon {
    width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center; background: var(--dh-brand-soft); color: var(--dh-brand-text);
}
.sh-modal--danger .sh-modal__icon { background: var(--dh-danger-soft); color: var(--dh-danger); }
.sh-modal__title { font-size: var(--dh-fs-lg); font-weight: var(--dh-fw-heavy); letter-spacing: -0.01em; margin-bottom: 6px; }
.sh-modal__body { font-size: var(--dh-fs-md); color: var(--dh-text-2); line-height: var(--dh-lh-normal); white-space: pre-line; }
.sh-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 480px) { .sh-modal__actions { flex-direction: column-reverse; } .sh-modal__actions .sh-btn { width: 100%; } }
@keyframes sh-fade { from { opacity: 0; } }
@keyframes sh-rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---- Toasts (window.shToast) ---- */
.sh-toasts {
    position: fixed; right: 16px; bottom: 16px; z-index: var(--dh-z-toast);
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.sh-toast {
    display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: min(380px, calc(100vw - 32px));
    padding: 12px 16px; border-radius: var(--dh-radius); pointer-events: auto;
    background: var(--dh-text); color: var(--dh-bg); box-shadow: var(--dh-shadow-pop);
    font-size: var(--dh-fs-sm); font-weight: var(--dh-fw-semibold); animation: sh-rise var(--dh-dur) var(--dh-ease);
}
.sh-toast .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.sh-toast--success { background: var(--dh-success); color: var(--dh-on-success); }
.sh-toast--error { background: var(--dh-danger); color: var(--dh-on-danger); }
.sh-toast--warning { background: var(--dh-warning); color: var(--dh-on-warning); }

@media (prefers-reduced-motion: reduce) {
    /* documented: reduced motion must override every component's own timing */
    :where(.sh-app) *, :where(.sh-app) *::before, :where(.sh-app) *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
