/* Pulse dashboard — components */

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(160, 170, 255, .06);
  color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none !important;
  transition: background var(--dur-1), border-color var(--dur-1), transform var(--dur-1), box-shadow var(--dur-2);
}
.btn:hover { background: rgba(160, 170, 255, .12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--violet); border-color: transparent; box-shadow: 0 8px 24px -10px rgba(124, 92, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover { background: #8a6dff; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255, 93, 115, .14); border-color: rgba(255, 93, 115, .45); color: #ffb3bf; }
.btn-danger:hover { background: rgba(255, 93, 115, .24); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-discord { background: var(--blurple); border-color: transparent; color: #fff; box-shadow: 0 14px 40px -14px rgba(88, 101, 242, .9); }
.btn-discord:hover { background: #6772f5; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.loading .save-label { color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); flex: none; }
.icon-btn:hover { background: rgba(160, 170, 255, .08); color: var(--text); }
.icon-btn.danger:hover { color: var(--ember); background: rgba(255, 93, 115, .1); }
.link-btn { background: none; border: 0; padding: 0; color: var(--sky); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- page heading ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 64ch; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.head-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; color: var(--c, var(--violet-2)); background: color-mix(in srgb, var(--c, #7c5cff) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, #7c5cff) 30%, transparent); }
.head-text { min-width: 0; flex: 1 1 280px; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; min-width: 0; position: relative; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.005em; }
.panel-head p { color: var(--text-2); font-size: 13px; flex-basis: 100%; margin-top: -6px; order: 5; }
.panel-head .panel-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2 > .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.panel.off-dim { opacity: .62; }

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.fields > .wide, .fields > .field-toggle.wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.field { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.field-head { display: flex; align-items: center; gap: 8px; }
.field-label { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.field-hint { color: var(--text-3); font-size: 13px; margin-top: -4px; }
.field-meta { margin-left: auto; color: var(--text-3); font-size: 11px; }
.mod-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); opacity: 0; transform: scale(.4); transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring); }
.field.modified .mod-dot { opacity: 1; transform: none; }
.field-error { color: var(--ember); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
.field.has-error .text-input, .field.has-error .picker-trigger, .field.has-error .tag-input, .field.has-error .stepper { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255, 93, 115, .16); }
.field.has-error { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.field-warn { display: flex; gap: 6px; align-items: center; margin-top: 8px; color: var(--amber); font-size: 13px; font-weight: 600; }

.field-toggle { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--field-bg); border: 1px solid var(--line); flex-wrap: wrap; }
.field-toggle-text { flex: 1; min-width: 0; }
.field-toggle .field-hint { margin-top: 4px; }
.field-toggle .field-error { flex-basis: 100%; }

.text-input {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--field-bg); color: var(--text); transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.text-input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .22); }
textarea.text-input { resize: vertical; line-height: 1.5; min-height: 80px; }
select.text-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.text-input::placeholder { color: var(--text-3); }

/* switch */
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { width: 44px; height: 26px; border-radius: 999px; background: var(--ink-600); border: 1px solid var(--line-strong); position: relative; transition: background var(--dur-2), border-color var(--dur-2); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2); }
.switch-input:checked + .switch-track { background: linear-gradient(120deg, #7c5cff, #4cc9ff); border-color: transparent; }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: #fff; }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--mint); outline-offset: 2px; }
.switch.lg .switch-track { width: 54px; height: 30px; }
.switch.lg .switch-thumb { width: 22px; height: 22px; }
.switch.lg .switch-input:checked + .switch-track .switch-thumb { transform: translateX(24px); }

/* number */
.num-ctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field-bg); overflow: hidden; flex: none; }
.step-btn { width: 36px; height: 40px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; }
.step-btn:hover { background: rgba(160, 170, 255, .08); color: var(--text); }
.num-input { width: 64px; height: 40px; border: 0; background: transparent; text-align: center; color: var(--text); -moz-appearance: textfield; }
.num-input::-webkit-inner-spin-button, .num-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-input:focus { outline: none; background: rgba(124, 92, 255, .12); }
.range-wrap { flex: 1 1 140px; min-width: 120px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--violet) 0 var(--p, 50%), var(--ink-600) var(--p, 50%)); outline: none; margin: 8px 0 4px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); cursor: grab; box-shadow: 0 2px 10px rgba(124, 92, 255, .6); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); cursor: grab; }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.num-readout { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--violet-2); min-width: 64px; }

/* segmented */
.segmented { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; border-radius: 12px; background: var(--field-bg); border: 1px solid var(--line-strong); align-self: flex-start; max-width: 100%; }
.seg { position: relative; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text-2); transition: background var(--dur-1), color var(--dur-1); }
.seg input:checked + span { background: var(--ink-600); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 1px; }
.seg:hover span { color: var(--text); }

/* picker */
.picker { position: relative; min-width: 0; }
.picker-trigger { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field-bg); text-align: left; font-weight: 600; font-size: 14px; }
.picker-trigger:hover { border-color: rgba(160, 170, 255, .34); }
.picker.open .picker-trigger { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
.picker.multi .picker-trigger { justify-content: flex-start; color: var(--text-2); width: auto; min-height: 34px; padding: 6px 12px; border-style: dashed; font-size: 13px; }
.picker-trigger:disabled { opacity: .55; cursor: not-allowed; }
.placeholder { color: var(--text-3); }
.opt-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.opt-label.warn { color: var(--amber); }
.opt-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-label .ic { color: var(--text-3); flex: none; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.picker-pop { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--ink-800); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: 0 30px 60px -20px #000; overflow: hidden; animation: pop var(--dur-2) var(--ease-out); }
.picker.multi .picker-pop { right: auto; width: min(320px, calc(100vw - 48px)); }
.picker-pop.up { top: auto; bottom: calc(100% + 6px); }
.picker-search-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.picker-search { flex: 1; border: 0; background: transparent; padding: 6px 0; min-width: 0; }
.picker-search:focus { outline: none; }
.picker-list { list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow-y: auto; scrollbar-width: thin; }
.picker-group { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 10px 10px 4px; letter-spacing: .02em; }
.picker-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); }
.picker-opt.active { background: rgba(124, 92, 255, .18); color: var(--text); }
.picker-opt.sel { color: var(--text); }
.picker-opt.sel > .ic { color: var(--mint); }
.picker-opt.none { color: var(--text-3); }
.opt-hint { font-size: 11px; color: var(--text-3); margin-left: auto; }
.picker-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--c, #a7adcf) 14%, var(--ink-800)); border: 1px solid color-mix(in srgb, var(--c, #a7adcf) 32%, transparent); animation: chipIn var(--dur-2) var(--ease-spring); }
.chip-x { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); flex: none; }
.chip-x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
@keyframes chipIn { from { transform: scale(.8); opacity: 0; } }

/* tag input */
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field-bg); min-height: 44px; cursor: text; position: relative; }
.tag-input:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
.tag-input input { flex: 1 1 120px; min-width: 100px; border: 0; background: transparent; padding: 4px 2px; }
.tag-input input:focus { outline: none; }
.chip-tag { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.tag-count { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* color */
.color-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-swatch { width: 42px; height: 42px; padding: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: none; cursor: pointer; }
.color-swatch::-webkit-color-swatch-wrapper { padding: 4px; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-text { width: 110px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 24px; height: 24px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .12); }
.sw:hover { transform: scale(1.1); }

/* template editor */
.tpl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tpl { grid-template-columns: minmax(0, 1fr); } }
.tpl-edit { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip { border: 1px solid rgba(124, 92, 255, .35); background: rgba(124, 92, 255, .1); color: var(--violet-2); border-radius: 8px; padding: 3px 8px; font-size: 12px; }
.ph-chip:hover { background: rgba(124, 92, 255, .22); color: var(--text); }
.tpl-preview { min-width: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-md); background: var(--ink-800); border: 1px solid var(--line-strong); box-shadow: 0 20px 50px -20px #000; animation: toastIn var(--dur-3) var(--ease-spring); }
.toast.out { animation: toastOut var(--dur-2) var(--ease-out) forwards; }
.toast-body { flex: 1; display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.toast-body span { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.toast-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(76, 201, 255, .12); color: var(--sky); }
.toast-success .toast-ic { background: rgba(61, 245, 176, .12); color: var(--mint); }
.toast-error .toast-ic { background: rgba(255, 93, 115, .14); color: var(--ember); }
.toast-warn .toast-ic { background: rgba(255, 196, 77, .12); color: var(--amber); }
.toast-x { width: 26px; height: 26px; }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(30px); opacity: 0; } }
.shell:has(.savebar.show) ~ .toasts { bottom: 96px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 10, .7); backdrop-filter: blur(4px); animation: fade var(--dur-2); }
.modal { position: relative; width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--ink-850); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 40px 120px -30px #000, 0 0 0 1px rgba(124, 92, 255, .08); animation: modalIn var(--dur-3) var(--ease-spring); }
.modal-sm { max-width: 440px; } .modal-md { max-width: 620px; } .modal-lg { max-width: 920px; }
.modal-wrap.out .modal { animation: modalOut .2s forwards; } .modal-wrap.out .modal-backdrop { animation: fade .2s reverse forwards; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.modal-head p { font-size: 13px; margin-top: 4px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-msg { color: var(--text-2); }
@keyframes modalIn { from { transform: translateY(18px) scale(.97); opacity: 0; } }
@keyframes modalOut { to { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---------- skeletons & states ---------- */
.skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(160, 170, 255, .06) 0%, rgba(160, 170, 255, .14) 50%, rgba(160, 170, 255, .06) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.big { height: 30px; } .skel.thin { height: 8px; }
.skel.circle { width: 36px; height: 36px; border-radius: 50%; flex: none; } .skel.circle.big { width: 64px; height: 64px; border-radius: 30%; }
.skel.block { border-radius: var(--r-lg); width: 100%; margin-top: 18px; }
.w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w90 { width: 90%; }
.skel-lines, .skel-col { display: grid; gap: 10px; flex: 1; }
.skel-rows { display: grid; gap: 16px; }
.skel-row { display: flex; gap: 12px; align-items: center; }
.skel-card { display: grid; gap: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; }
.state h3 { font-size: 16px; font-weight: 800; }
.state p { color: var(--text-2); max-width: 44ch; font-size: 14px; }
.state .btn { margin-top: 10px; }
.state.compact { padding: 24px 12px; }
.state.compact .art { width: 90px; height: 72px; }
.art { margin-bottom: 4px; }
.art-trace { stroke-dasharray: 160; animation: trace 3.2s var(--ease-out) infinite; }
@keyframes trace { 0% { stroke-dashoffset: 160; } 60%, 100% { stroke-dashoffset: 0; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 700; font-size: 12px; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); background: rgba(8, 10, 20, .4); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1); }
.table tbody tr:hover { background: rgba(160, 170, 255, .04); }
.table .num { text-align: right; font-family: var(--font-mono); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 36px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.pager-btns { display: flex; gap: 8px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; }
.fchip:hover { color: var(--text); background: rgba(160, 170, 255, .06); }
.fchip[aria-pressed="true"] { background: rgba(124, 92, 255, .18); border-color: rgba(124, 92, 255, .5); color: var(--text); }
.fchip .ic { color: var(--tc, currentColor); }

/* ---------- save bar ---------- */
.savebar { position: fixed; z-index: 60; left: calc(var(--side-w) + 24px); right: 24px; bottom: 18px; display: flex; justify-content: center; pointer-events: none; transform: translateY(140%); transition: transform var(--dur-3) var(--ease-spring); }
.shell.collapsed .savebar { left: calc(var(--side-w-collapsed) + 24px); }
.savebar.show { transform: none; }
.savebar-inner { pointer-events: auto; width: min(760px, 100%); display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 18px; border-radius: 18px; background: rgba(19, 23, 41, .94); border: 1px solid rgba(124, 92, 255, .4); box-shadow: 0 24px 60px -20px #000, 0 0 40px -12px rgba(124, 92, 255, .5); backdrop-filter: blur(16px); }
.savebar.saved .savebar-inner { animation: savedFlash .7s; }
.savebar-pip { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); flex: none; animation: blink 1.6s ease-in-out infinite; }
.savebar-copy { flex: 1; min-width: 0; display: grid; }
.savebar-text { font-weight: 700; font-size: 14px; }
.savebar-sections { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savebar-actions { display: flex; gap: 8px; flex: none; }
@keyframes savedFlash { 40% { border-color: var(--mint); box-shadow: 0 0 40px -6px rgba(61, 245, 176, .6); } }
@media (max-width: 960px) { .savebar, .shell.collapsed .savebar { left: 12px; right: 12px; bottom: 12px; } }
@media (max-width: 480px) { .savebar-sections { display: none; } .savebar-inner { gap: 10px; padding-left: 14px; } .savebar-text { font-size: 13px; } }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 12px; font-weight: 700; }
.legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.legend-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.chart-plot { position: relative; outline: none; border-radius: 12px; touch-action: pan-y; }
.chart-plot:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid { stroke: rgba(160, 170, 255, .08); stroke-width: 1; }
.chart-svg .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font-mono); }
.chart-svg .series-line { stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .crosshair { stroke: rgba(238, 240, 255, .28); stroke-dasharray: 3 4; }
.chart-svg .hover-dot { stroke: var(--ink-900); stroke-width: 2.5; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 10px 12px; border-radius: 12px; background: rgba(9, 11, 22, .95); border: 1px solid var(--line-strong); box-shadow: 0 14px 40px -12px #000; font-size: 12px; display: grid; gap: 6px; }
.chart-tip strong { font-size: 12px; color: var(--text-2); font-weight: 700; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { margin-left: auto; color: var(--text); padding-left: 12px; }
.spark { width: 100%; height: 34px; display: block; overflow: visible; }
.spark-dot { filter: drop-shadow(0 0 4px currentColor); }

.heat { position: relative; padding-bottom: 22px; }
.heat-row { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.heat-cell { height: 38px; border-radius: 6px; background: color-mix(in srgb, var(--sky) calc(var(--i) * 85% + 6%), var(--ink-800)); outline-offset: 1px; transition: background var(--dur-3); }
.heat-cell:nth-child(n) { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03); }
.heat-cell:last-child { box-shadow: inset 0 0 0 1.5px var(--mint); }
.heat-cell:hover { transform: translateY(-2px); }
.heat-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }
.heat-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.heat-axis span:first-child { transform: none; }
.heat-axis span:last-child { transform: translateX(-100%); }
.heat-tip { top: -64px; }

/* ---------- activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); }
.feed-text { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; padding-top: 5px; }
.feed-text b { color: var(--text); font-weight: 700; }
.feed-text .lvl { color: var(--violet-2); }
.feed-text .reason { color: var(--text-3); }
.feed-text .case-ref { color: var(--text-3); font-size: 12px; }
.feed-text code { font-size: 12px; color: var(--sky); }
.ch-ref { color: var(--sky); font-weight: 600; }
.feed-time { font-size: 11px; color: var(--text-3); white-space: nowrap; padding-top: 7px; }
.tone-violet { --tc: var(--violet-2); } .tone-mint { --tc: var(--mint); } .tone-sky { --tc: var(--sky); } .tone-amber { --tc: var(--amber); } .tone-ember { --tc: var(--ember); } .tone-dim { --tc: var(--text-2); }
.feed-item.fresh { animation: feedIn var(--dur-3) var(--ease-spring); }
.feed-item.fresh .feed-ic { animation: icGlow 1.6s var(--ease-out); }
@keyframes feedIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes icGlow { 0% { box-shadow: 0 0 0 0 var(--tc); } 100% { box-shadow: 0 0 0 10px transparent; } }
.day-sep { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 18px 4px 6px; list-style: none; border-bottom: 1px solid var(--line); }
.day-sep:first-child { padding-top: 0; }

/* progress */
.bar { height: 8px; border-radius: 999px; background: var(--ink-700); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-signal); width: 0; transition: width .9s var(--ease-out); }
.bar.thin { height: 5px; }

.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--text-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: rgba(76, 201, 255, .07); border: 1px solid rgba(76, 201, 255, .2); color: var(--text-2); font-size: 14px; }
.notice .ic { color: var(--sky); flex: none; margin-top: 2px; }
.notice.warn { background: rgba(255, 196, 77, .07); border-color: rgba(255, 196, 77, .25); }
.notice.warn .ic { color: var(--amber); }
.notice b { color: var(--text); }
