/* Verse AI: the Dashboards tab (js/verse-dashboards.js, docs/claude/notes/105-dashboards-share-tab-session.md).
   The page's own tokens only (--bg-*, --text-*, --primary-*, --border-*, --danger-color), so every theme of the page applies.
   The icon tile is the one strong thing on a card; everything else stays quiet. */
.vd { color: var(--text-primary); }
.vd-wrap { padding: 24px; max-width: 1180px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.vd-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.vd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.vd-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.vd-sub { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

.vd-btn {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
    padding: 7px 12px; border-radius: 6px; cursor: pointer; background: var(--bg-secondary); border: 1px solid var(--border-primary);
    color: var(--text-primary); transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.vd-btn:hover { background: var(--bg-hover); border-color: var(--primary-color); color: var(--primary-color); }
.vd-btn:disabled, .vd-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.vd-btn--primary { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.vd-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.vd-btn--danger { background: transparent; border-color: var(--danger-color); color: var(--danger-color); }
.vd-btn--danger:hover { background: var(--danger-color); border-color: var(--danger-color); color: #fff; }
.vd-btn--quiet { background: transparent; border-color: transparent; color: var(--text-secondary); }
.vd-btn--quiet:hover { background: var(--bg-hover); border-color: transparent; color: var(--text-primary); }
.vd-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 6px;
    border: 1px solid transparent; background: transparent; color: var(--text-secondary); cursor: pointer; flex-shrink: 0;
}
.vd-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.vd :focus-visible, .vd-backdrop :focus-visible { outline: 2px solid var(--border-focus, var(--primary-color)); outline-offset: 2px; }

/* the rail of categories beside the cards; on narrow screens a row of filters above them */
.vd-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 28px; align-items: start; }
.vd-layout--plain { grid-template-columns: minmax(0, 1fr); }
.vd-rail { position: sticky; top: 0; padding-top: 2px; }
.vd-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vd-cat-row { position: relative; display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.vd-cat {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px;
    border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; text-align: start; cursor: pointer;
}
.vd-cat:hover { background: var(--bg-hover); }
.vd-cat[aria-current="true"] { background: var(--primary-light); color: var(--primary-color); font-weight: 600; }
.vd-cat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-cat-count { color: var(--text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 400; }
.vd-cat[aria-current="true"] .vd-cat-count { color: inherit; }
.vd-cat-more { width: 28px; height: 28px; opacity: .7; }
.vd-cat-row:hover .vd-cat-more, .vd-cat-more:focus-visible, .vd-cat-more[aria-expanded="true"] { opacity: 1; }
.vd-cats-head { margin: 18px 0 6px; padding: 0 10px; }
.vd-cats-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.vd-cats-empty { padding: 4px 10px 8px; font-size: 12px; line-height: 1.45; color: var(--text-tertiary); }
.vd-add-cat { margin: 8px 0 0 2px; }

/* search, the count, messages */
.vd-search { position: relative; display: flex; align-items: center; }
.vd-search > svg { position: absolute; inset-inline-start: 11px; color: var(--text-tertiary); pointer-events: none; }
.vd-search-input, .vd-input {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text-primary); background: var(--bg-primary);
    border: 1px solid var(--border-secondary); border-radius: 8px; padding: 9px 12px; outline: none;
}
.vd-search-input { padding-inline-start: 34px; }
.vd-search-input:focus, .vd-input:focus { border-color: var(--border-focus, var(--primary-color)); box-shadow: 0 0 0 3px var(--primary-light); }
.vd-count { margin: 10px 0 14px; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.vd-message { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; padding: 8px 8px 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; border: 1px solid var(--border-primary); background: var(--bg-secondary); }
.vd-message--error { border-color: var(--danger-color); color: var(--danger-color); background: transparent; }
.vd-message[hidden] { display: none; }

/* groups and cards */
.vd-group + .vd-group { margin-top: 22px; }
.vd-group-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.vd-group-count { font-size: 12px; font-weight: 400; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vd-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border-primary); box-shadow: var(--shadow-sm); color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.vd-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); }
.vd-card:focus-within { border-color: var(--primary-color); }
.vd-card-head { display: flex; align-items: flex-start; gap: 12px; }
.vd-tile {
    width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    background: var(--primary-color); color: var(--text-inverse, #fff);
}
.vd-card-names { flex: 1; min-width: 0; padding-top: 1px; }
.vd-card-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.vd-card-link { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card opens the dashboard */
.vd-card-link:focus-visible { outline: none; }
.vd-card:has(.vd-card-link:focus-visible) { outline: 2px solid var(--border-focus, var(--primary-color)); outline-offset: 2px; }
.vd-card-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-more { position: relative; z-index: 1; margin: -4px -6px 0 0; }
.vd-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-secondary); }
.vd-tag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; }
.vd-tag > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-tag--shared { color: var(--text-primary); }
.vd-card-meta { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-primary); font-size: 12px; color: var(--text-tertiary); }
.vd-card--skeleton { min-height: 104px; box-shadow: none; }
.vd-sk { background: var(--bg-tertiary); border-radius: 6px; }
.vd-sk--tile { width: 40px; height: 40px; border-radius: 9px; }
.vd-sk--line { height: 12px; width: 70%; }
.vd-sk--short { height: 10px; width: 40%; }

/* menus */
.vd-menu {
    position: absolute; z-index: 20; inset-inline-end: 8px; top: 44px; min-width: 200px; padding: 4px; border-radius: 8px;
    background: var(--bg-primary); border: 1px solid var(--border-secondary); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.vd-cat-row .vd-menu { top: 32px; inset-inline-end: 0; min-width: 150px; }
.vd-menu-item { font: inherit; font-size: 13px; text-align: start; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); cursor: pointer; }
.vd-menu-item:hover, .vd-menu-item:focus { background: var(--bg-hover); outline: none; }
.vd-menu-item:focus-visible { outline: 2px solid var(--border-focus, var(--primary-color)); outline-offset: -2px; }
.vd-menu-item--danger { color: var(--danger-color); }
.vd-menu-item[aria-disabled="true"] { color: var(--text-tertiary); cursor: default; background: transparent; }

/* states */
.vd-state { padding: 40px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vd-state p { margin: 0; max-width: 46ch; }
.vd-state-title { color: var(--text-primary); font-size: 15px; font-weight: 600; }
.vd-state-icon { color: var(--text-tertiary); margin-bottom: 4px; }
.vd-state .vd-btn { margin-top: 8px; }
.vd-state--error .vd-state-title { color: var(--danger-color); }

/* dialogs */
.vd-backdrop { position: fixed; inset: 0; z-index: 100000; /* above the page's home pill (99990), below the site's status banner */ background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.vd-dialog {
    width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; border-radius: 12px;
    background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-primary); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
}
.vd-dialog--wide { max-width: 600px; }
.vd-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 20px; }
.vd-dialog-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.vd-dialog-close { margin: -4px -6px 0 0; }
.vd-dialog-body { padding: 8px 20px 4px; font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; gap: 12px; }
.vd-dialog-body p { margin: 0; }
.vd-dialog-foot { display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; padding: 14px 20px 18px; flex-wrap: wrap; }
.vd-dialog-foot:empty { padding: 6px; }
.vd-hint { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.vd-q { font-weight: 600; overflow-wrap: anywhere; }
.vd-field-error { margin: 0; font-size: 12px; color: var(--danger-color); }
.vd-field-error[hidden] { display: none; }
.vd-name-form { display: flex; flex-direction: column; gap: 10px; }
.vd-name-actions { display: flex; gap: 8px; justify-content: flex-end; }
.vd-radios { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.vd-radio { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.vd-radio:hover { background: var(--bg-hover); }
.vd-radio input { accent-color: var(--primary-color); width: 16px; height: 16px; margin: 0; flex-shrink: 0; }

/* the icon picker */
.vd-icon-group-title { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.vd-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.vd-icon-choice {
    height: 44px; border-radius: 8px; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary);
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.vd-icon-choice:hover { border-color: var(--primary-color); color: var(--primary-color); }
.vd-icon-choice[aria-checked="true"] { background: var(--primary-color); border-color: var(--primary-color); color: var(--text-inverse, #fff); }
.vd-icon-name { min-height: 1.45em; }

/* the share dialog (R-18) */
.vd-choices { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.vd-choices legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; padding: 0; }
.vd-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: 8px; cursor: pointer; }
.vd-choice:has(input:checked) { border-color: var(--primary-color); background: var(--primary-light); }
.vd-choice input { grid-row: 1 / span 2; margin: 2px 0 0; accent-color: var(--primary-color); width: 16px; height: 16px; }
.vd-choice-title { font-weight: 600; font-size: 14px; }
.vd-choice-text { grid-column: 2; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.vd-field { display: flex; flex-direction: column; gap: 6px; }
.vd-field label, .vd-field-label { font-size: 13px; font-weight: 600; }
.vd-row { display: flex; gap: 8px; align-items: stretch; }
.vd-row .vd-input { flex: 1; min-width: 0; }
.vd-link-input { font-size: 12px; color: var(--text-secondary); }
.vd-share-link { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--border-primary); }
.vd-share-note { font-size: 12px; color: var(--text-secondary); line-height: 1.5; padding-top: 2px; border-top: 1px solid var(--border-primary); padding-top: 10px; }
.vd-share-off { margin: 2px 0 0; }
.vd-status { font-size: 12px; color: var(--text-secondary); min-height: 1.2em; }

@media (max-width: 899px) {
    .vd-wrap { padding: 16px; }
    .vd-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .vd-rail { position: static; display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
    .vd-cats, .vd-cats--mine { flex-direction: row; flex-shrink: 0; gap: 6px; }
    .vd-cats-head, .vd-cats-empty { display: none; }
    .vd-cat-row { flex-shrink: 0; border: 1px solid var(--border-primary); border-radius: 999px; }
    .vd-cat { padding: 6px 12px; border-radius: 999px; }
    .vd-cat-more { width: 26px; height: 26px; margin-inline-end: 4px; opacity: 1; }
    /* first in the chip row (fix round 1): on the screen without scrolling the row */
    .vd-add-cat { margin: 0; flex-shrink: 0; white-space: nowrap; order: -1; }
    .vd-cat-row .vd-menu { position: fixed; top: auto; inset-inline: 16px; bottom: 16px; min-width: 0; }
    .vd-menu { inset-inline-end: 8px; }
}
@media (max-width: 480px) {
    .vd-grid { grid-template-columns: minmax(0, 1fr); }
    .vd-dialog-foot { justify-content: stretch; }
    .vd-dialog-foot .vd-btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .vd-card, .vd-btn { transition: none; }
}
