:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif; color:#232744;
  --ink:#232744; --muted:#535d7a; --accent:#5b48c7; --accent-ink:#4635a4;
  --line:#d9d9ef; --surface:rgba(255,255,255,.66); --button:#f8f7ff;
  color-scheme:light;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
.import-name { flex:1; min-width:0; }
.sync-choice { margin-inline-start:auto; flex:none; color:var(--ink); }
.linked-label .chip::after { content:" ↔"; margin-left:.35em; }
body { margin:0; min-height:100dvh; background:
  radial-gradient(ellipse at 9% 98%, #d9d2fc 0%, transparent 54%),
  radial-gradient(ellipse at 91% 8%, #cbe8fc 0%, transparent 54%),
  linear-gradient(135deg,#f2ebff,#f0f4ff 53%,#e4f0fb); }
h1,h2,h3,p { margin:0; }
h1 { font-size:1.22rem; letter-spacing:-.025em; }
h2 { font-size:1.15rem; letter-spacing:-.022em; }
p { color:var(--muted); line-height:1.55; }
button,input,select,summary,.button { font:inherit; }
button,summary,.button,select,input[type=checkbox] { cursor:pointer; }
button,.button,select,input:not([type=checkbox]),summary {
  border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--button);
  min-height:34px; padding:6px 10px; font-size:.83rem; font-weight:600;
}
button:hover,.button:hover,summary:hover { border-color:#a89be9; background:#eeeafe; }
button:disabled { cursor:default; opacity:.53; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input[type=checkbox] { width:16px; height:16px; flex:none; margin:0; accent-color:var(--accent); }
input:not([type=checkbox]) { min-width:0; background:#fff; font-weight:400; }
.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.primary:hover { background:#4935b0; color:#fff; }
.danger-quiet { color:#9d302f; }
.danger { color:#fff; background:#a52d30; border-color:#a52d30; }
.danger:hover { color:#fff; background:#852329; }
.welcome { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.gate { text-align:center; width:min(452px,100%); padding:36px; border:1px solid #fff; border-radius:24px;
  background:var(--surface); backdrop-filter:blur(20px); box-shadow:0 16px 54px #433e8025; }
.gate h1 { font-size:1.55rem; margin:12px 0 8px; }
.gate button,.gate .button { display:inline-flex; align-items:center; margin-top:20px; text-decoration:none; }
#workspace { height:100dvh; padding:16px; display:grid; grid-template-rows:auto minmax(0,1fr); gap:12px; }
.glass { background:var(--surface); border:1px solid #ffffffd9; border-radius:17px;
  box-shadow:0 10px 35px #3f418012; backdrop-filter:blur(18px); min-width:0; }
.topbar { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:12px; padding:11px 14px; }
.brand,.top-actions,nav,.board-header,.board-actions,.board-status,.label-title,.filters,.group-head,#selection-tools,.name-row,.color-row {
  display:flex; align-items:center; gap:8px;
}
.brand { min-width:0; gap:10px; }
.brand div { min-width:0; }
.brand p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.77rem; }
.top-actions { justify-content:end; }
nav { gap:2px; padding:3px; background:#e9e6f8; border-radius:10px; }
.tab { min-width:70px; padding:5px 9px; min-height:30px; background:transparent; border:0; color:var(--muted); }
.tab[aria-pressed=true] { background:#fff; color:var(--accent-ink); box-shadow:0 1px 4px #322d6422; }
#views { display:grid; grid-template-columns:minmax(0,1fr) clamp(278px,28vw,370px); gap:12px; min-height:0; }
#views.manage { grid-template-columns:1fr; }
#board-view,#labels-view { min-height:0; display:flex; flex-direction:column; }
.board-header { justify-content:space-between; align-items:flex-start; padding:16px 16px 10px; }
.board-header p { font-size:.8rem; margin-top:4px; }
.board-actions { flex-wrap:wrap; justify-content:end; }
.board-status { min-height:30px; padding:0 16px 7px; color:var(--muted); font-size:.78rem; }
.board-status strong { color:var(--accent-ink); }
#board-columns { display:flex; align-items:flex-start; gap:10px; padding:4px 15px 15px; overflow:auto; flex:1; min-height:0; }
.column { width:235px; flex:0 0 235px; padding:8px; border-radius:12px; background:#e4e7f5c7; border:1px solid #d8daed;
  min-height:95px; transition:background .15s,border-color .15s; }
.column-title { display:flex; text-align:left; width:100%; justify-content:space-between; background:transparent; border-color:transparent; padding:4px 5px 7px; gap:5px; }
.count { color:var(--muted); background:#fff9; padding:2px 6px; border-radius:8px; font-size:.72rem; white-space:nowrap; }
.card { display:flex; flex-direction:column; align-items:start; width:100%; gap:5px; margin-top:5px; padding:8px;
  background:#fffc; border:1px solid #d9dcf0; box-shadow:0 2px 4px #383a6811; text-align:left;
  font-size:.84rem; overflow-wrap:anywhere; }
.card[aria-pressed=true],.selected-list { border-color:#8d7ce0; background:#eae1ff; }
.dragging .column { border-style:dashed; }
.drop-target,.card.drop-target,.label-group.drop-target { outline:2px solid #785de0; outline-offset:-2px; background:#dcd4ff; }
.card-chips { display:flex; gap:4px; flex-wrap:wrap; max-width:100%; }
.chip { display:inline-block; min-width:0; border:1px solid transparent; color:var(--ink); background:var(--chip);
  font-size:.79rem; font-weight:650; border-radius:6px; padding:5px 8px; overflow-wrap:anywhere; }
button.chip { text-align:left; min-height:30px; }
button.chip:hover { background:var(--chip); border-color:var(--ink); }
.card-chips .chip { font-size:.67rem; padding:2px 5px; }
.stick { animation:stick 480ms cubic-bezier(.17,.88,.33,1.13) both; transform-origin:center; }
@keyframes stick {
  0% { opacity:.1; transform:translateY(-13px) rotate(-13deg) scale(1.45); }
  65% { opacity:1; transform:translateY(1px) rotate(3deg) scale(.91); }
  100% { transform:none; }
}
.empty-column,.empty { color:var(--muted); padding:8px; font-size:.82rem; }
.labels-header { display:grid; gap:10px; padding:14px 13px 10px; }
.label-title { justify-content:space-between; }
.label-title p { font-size:.76rem; margin-top:2px; }
.subtle,.after-group { color:var(--accent-ink); }
.filters input { flex:1; }
#filter-box { display:flex; flex-wrap:wrap; gap:9px; align-items:center; font-size:.79rem; }
#filter-box select { margin-left:6px; }
.inline { display:flex; align-items:center; gap:6px; }
#label-list { min-height:0; overflow:auto; flex:1; padding:2px 13px 12px; }
#group-drop-targets { display:flex; flex-wrap:wrap; gap:6px; padding:0 13px 8px; max-height:25vh; overflow:auto; }
.group-drop-chip { padding:5px 9px; border:1px dashed var(--line); border-radius:8px; font-size:.78rem; font-weight:600; }
.label-group { padding:7px; background:#faf9ff80; border:1px solid #dcdcf1; border-radius:11px; margin-bottom:8px; }
.manage #label-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,288px),1fr)); grid-auto-rows:min-content; gap:10px; align-content:start; }
.manage .label-group { margin:0; }
.group-head { padding:1px 2px 5px; gap:5px; }
.group-title { min-height:27px; background:transparent; border-color:transparent; flex:1; padding:2px 5px; text-align:left; overflow-wrap:anywhere; }
.ungrouped { font-size:.79rem; color:var(--muted); padding:5px 3px; }
.label-row { display:grid; grid-template-columns:16px minmax(0,1fr) 27px 27px; gap:5px; align-items:center; margin:5px 0; padding:0 2px; }
.icon { padding:0 4px; min-height:27px; min-width:27px; border-color:transparent; background:transparent; font-size:1rem; line-height:1; }
.heart[aria-pressed=true] { color:#a52658; }
.add-label,.after-group { width:100%; min-height:29px; margin-top:4px; }
.add-label { border-style:dashed; background:#fffa; color:var(--accent-ink); font-size:1.05rem; line-height:1; }
.after-group { visibility:hidden; background:transparent; }
.label-group:hover .after-group,.label-group:focus-within .after-group { visibility:visible; }
#selection-tools { padding:8px; margin:0 13px 8px; flex-wrap:wrap; border:1px solid var(--line); border-radius:10px; background:#f9f8ff; font-size:.78rem; }
#selection-tools span { margin-right:auto; font-weight:600; }
.context { position:fixed; z-index:4; display:grid; gap:3px; padding:5px; border-radius:10px; border:1px solid var(--line);
  background:#f5f3ff; box-shadow:0 7px 25px #2726503d; }
.context button { text-align:left; background:#fff; }
.context button:hover { background:#e9e3ff; }
dialog { width:min(435px,calc(100% - 24px)); border:1px solid var(--line); color:var(--ink);
  border-radius:16px; background:#f9f8ff; padding:17px; box-shadow:0 12px 35px #20174340; }
dialog::backdrop { background:#26224267; backdrop-filter:blur(3px); }
.dialog-header { display:flex; align-items:center; justify-content:space-between; gap:5px; margin-bottom:10px; }
dialog form,.new-fields { display:grid; gap:12px; }
dialog p { font-size:.85rem; }
dialog footer { display:flex; justify-content:end; gap:7px; margin-top:3px; }
.field { display:grid; gap:5px; font-size:.78rem; font-weight:600; min-width:0; }
.field select { width:100%; }
.name-row { align-items:end; }
.name-row .field { flex:1; }
.color-row { flex-wrap:wrap; }
.picker { position:relative; }
.picker summary { display:list-item; }
.choices { position:absolute; z-index:2; top:calc(100% + 4px); left:0; display:grid; gap:4px;
  background:#fff; padding:7px; border:1px solid var(--line); border-radius:10px; box-shadow:0 5px 15px #27265025; }
.symbols .choices { grid-template-columns:repeat(5,29px); right:0; left:auto; }
.colors .choices { grid-template-columns:repeat(10,22px); }
.choices button { min-height:25px; padding:2px; }
.choices button[aria-pressed=true] { outline:2px solid var(--accent); outline-offset:0; }
.purge-list { max-height:145px; overflow:auto; margin:0; padding-left:22px; font-size:.85rem; }
#toast { position:fixed; z-index:6; bottom:16px; left:50%; transform:translateX(-50%); max-width:calc(100% - 30px);
  background:#2c254e; color:#fff; border-radius:10px; padding:10px 15px; font-size:.86rem; box-shadow:0 5px 18px #27265042;
  pointer-events:none; }
#toast.error { background:#912f35; }
#toast:popover-open { margin:0; top:auto; right:auto; }
.sr-only { position:absolute; clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
@media(max-width:720px) {
  #workspace { padding:7px; gap:7px; }
  .topbar { grid-template-columns:1fr auto; padding:8px; gap:6px; }
  .topbar nav { grid-row:2; grid-column:1/-1; justify-content:center; }
  .top-actions span { display:none; }
  #views { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(145px,1fr) minmax(160px,1.2fr); gap:7px; }
  #views.manage { grid-template-rows:minmax(0,1fr); }
  .board-header { padding:8px 9px 3px; gap:4px; flex-wrap:wrap; }
  .board-header p { display:none; }
  .board-status { padding:0 9px 4px; min-height:20px; }
  #board-columns { padding:3px 8px 8px; }
  .column { width:182px; flex-basis:182px; }
  .labels-header { padding:7px 8px; gap:6px; }
  .after-group { visibility:visible; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important; transition:none!important; }
}
.dialog-status { color:#912f35; font-weight:600; }
.privacy { width:min(590px,100%); text-align:left; } .privacy p + p { margin-top:12px; }
.drag-source { cursor:grab; touch-action:none; user-select:none; } .drag-ghost { position:fixed; left:0; top:0; z-index:8; pointer-events:none; --chip:#f2eaff; box-shadow:0 4px 12px #2b215b4f; }
.card-chips .chip.peel {
  transform-origin: 8% 90%;
  animation: peel-label 360ms cubic-bezier(.35,.1,.55,1) forwards;
}
@keyframes peel-label {
  0% { transform: perspective(160px) rotateY(0deg); }
  38% { transform: perspective(160px) rotateY(-32deg) rotate(-9deg); filter: drop-shadow(2px 3px 2px #24243b55); }
  100% { transform: perspective(160px) translate(10px,-13px) rotateY(-60deg) rotate(-19deg); opacity: 0; }
}
.label-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; }
.import-preview { display:grid; gap:.45rem; max-height:35vh; overflow:auto; }
.import-preview:empty { display:none; }
.import-choice { display:flex; align-items:center; gap:.65rem; }
.import-choice input { flex:none; }
.import-summary:empty { display:none; }
[data-range-entry].range-preview { position:relative; isolation:isolate; }
[data-range-entry].range-preview::after {
  content:"";
  position:absolute;
  inset:-3px -4px;
  z-index:1;
  pointer-events:none;
  background:rgba(207,195,250,.30);
  backdrop-filter:blur(.65px);
  border:1px solid rgba(115,85,196,.5);
  border-radius:7px;
  box-shadow:inset 0 0 6px #ffffffa8;
}
[data-range-entry].range-preview:has(+ .range-preview)::after {
  border-bottom-color:transparent;
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
}
.range-preview + [data-range-entry].range-preview::after {
  border-top-color:transparent;
  border-top-left-radius:0;
  border-top-right-radius:0;
}
#subscription-dialog {
  width:min(620px,calc(100% - 24px));
  max-height:calc(100dvh - 24px);
  padding:26px clamp(16px,5vw,36px) 20px;
  background:radial-gradient(ellipse at 35% 0,#e8e2ff 0,transparent 56%),#f9f9ff;
  box-shadow:0 22px 66px #3024633d;
  color:var(--ink);
}
#subscription-dialog::backdrop { background:#29244772; backdrop-filter:blur(6px); }
#subscription-dialog button,#subscription-dialog .button { margin:0; justify-content:center; }
#subscription-dialog .subscription-close { position:absolute; top:13px; right:13px; font-size:1.3rem; }
.subscription-hero h2 { margin:7px 0 4px; font-size:clamp(1.45rem,4vw,1.82rem); }
.subscription-price strong { font-size:clamp(2rem,5vw,2.7rem); line-height:1.1; color:var(--ink); letter-spacing:-.045em; }
.subscription-price span { font-weight:600; }
.subscription-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:14px 0 9px; }
#subscription-dialog .subscription-actions :is(button,.button) { min-height:38px; padding:0 15px; font-weight:650; }
#subscription-dialog #subscription-status.error { color:#9d302f; }
.subscription-tour { margin-top:16px; }
.tour-stage {
  display:grid; place-items:center; min-height:148px; padding:13px;
  background:linear-gradient(135deg,#ecf4ff,#e9e0fb);
  border:1px solid #e0d9f1; border-radius:16px; overflow:hidden;
}
.tour-scene { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; width:min(390px,100%); text-align:left; }
.tour-column { display:grid; align-content:start; gap:5px; min-width:0; padding:8px; background:#ffffffc9; border:1px solid #ede8fd; border-radius:10px; box-shadow:0 4px 10px #33226912; }
.tour-column-title { font-size:.70rem; color:#45425f; }
.tour-chip { display:block; padding:4px 7px; border-radius:5px; background:#e1d6ff; color:#352657; font-size:.72rem; font-weight:650; line-height:1.2; overflow-wrap:anywhere; }
.tour-chip:nth-of-type(2) { background:#c9ebff; color:#15435c; }
.tour-chip:nth-of-type(3) { background:#c4efdd; color:#205441; }
.tour-stage:not(.tour-paused) .tour-scene { animation:tour-arrive .42s ease-out; }
.tour-stage:not(.tour-paused) .tour-scene .tour-chip { animation:tour-chip-in .48s ease-out both; }
.tour-stage:not(.tour-paused) .tour-chip:nth-of-type(2) { animation-delay:.27s; }
.tour-stage:not(.tour-paused) .tour-chip:nth-of-type(3) { animation-delay:.52s; }
.tour-stage:not(.tour-paused) :is(.tour-apply,.tour-import) .tour-column:nth-child(2) .tour-chip { animation-name:tour-transfer; animation-delay:.58s; }
.tour-stage:not(.tour-paused) .tour-clean .tour-column:first-child .tour-chip:nth-of-type(2) { animation:tour-peel 1.8s .4s both; }
.tour-caption { min-height:61px; padding:10px 0 0; }
.tour-caption h3 { margin:0 0 4px; font-size:1rem; }
.tour-controls,.tour-dots { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:5px; }
.tour-controls { margin-top:8px; }
#subscription-dialog .tour-controls button { min-width:28px; min-height:28px; padding:0; }
#subscription-dialog .tour-controls .tour-dot { min-width:18px; min-height:28px; border:0; background:transparent; }
.tour-dot::before { content:""; width:7px; height:7px; border-radius:50%; background:#aba2c7; }
.tour-dot[aria-pressed=true]::before { width:14px; border-radius:10px; background:var(--accent); }
@keyframes tour-arrive { from { opacity:.35; transform:translateY(7px); } }
@keyframes tour-chip-in { from { opacity:0; transform:translateY(5px) scale(.97); } }
@keyframes tour-transfer { from { opacity:0; transform:translateX(-22px) rotate(-4deg); } }
@keyframes tour-peel { 0%,62% { opacity:1; transform:none; } 100% { opacity:.25; transform:translate(7px,-2px) rotate(-5deg); } }
.pricing { margin-top:18px; padding:12px; border:1px solid #d8d1ef; border-radius:10px; }
.pricing h2 { margin:0 0 5px; font-size:1rem; }
.billing-links { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 14px; margin-top:18px; font-size:.83rem; }
.billing-links a { color:var(--accent-ink); }
