/* Buttons never shrink in a crowded topbar. */
.btn-icon, .btn-primary, .btn-ghost { flex: none; }
.popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 40px rgba(11,11,18,.14); overflow: hidden; }

/* Shared component classes. Map to React components later. */
*, *::before, *::after { box-sizing: border-box; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-pastel-plum { background: var(--plum); border-color: transparent; }
.card-pastel-brand { background: var(--brand); border-color: transparent; }
.card-pastel-warn { background: var(--warn); border-color: transparent; }
.card-pastel-info { background: var(--info); border-color: transparent; }
.card-pastel-ok { background: var(--ok); border-color: transparent; }

.btn-primary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 40px; padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .875rem; transition: transform .15s, background .15s, box-shadow .15s; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(11,11,18,.18); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #F3F3F4; }
.btn-icon { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.btn-icon:hover { background: #F3F3F4; }
.btn-round-arrow { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.75); border: 1px solid rgba(11,11,18,.06); }

:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid transparent; }
.chip-filter { cursor: pointer; background: var(--surface); border-color: var(--line); color: var(--muted); padding: .4rem .85rem; font-size: .8rem; min-height: 32px; }
.chip-filter[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tbody tr:hover td { background: #F3F3F4; }
.table tbody tr.is-selected td { background: #ECE6F9; }


.toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 14px; font-size: .85rem; box-shadow: 0 10px 30px rgba(11,11,18,.25); animation: toast-in .2s ease-out; }
.toast-success { background: var(--ok-ink); }
.toast-warn { background: #B45309; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-gradient { background: radial-gradient(1200px 500px at 50% -10%, #ECE6F9 0%, #D9E9FB 40%, rgba(247,247,251,0) 75%), var(--bg); }
.striped-bar { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.35) 0 4px, transparent 4px 8px); }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: #EBEBED; border-radius: 99px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Touch devices: enlarge small hit targets (ui-ux-pro-max touch-target-size). */
@media (pointer: coarse) {
  .chip-filter { min-height: 40px; }
  .btn-icon { width: 44px; height: 44px; }
  .btn-primary, .btn-ghost { min-height: 44px; }
}
