*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0e1118;
  --surface: #161922;
  --surface2: #1e2230;
  --surface3: #272c3f;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.11);
  --text: #e4e7f5;
  --text-muted: #6e779a;
  --text-dim: #3d4464;
  --accent: #6a8df5;
  --accent-soft: rgba(106,141,245,0.14);
  --accent-glow: rgba(106,141,245,0.35);
  --green: #3ecf72;
  --red: #f06b6b;
  --red-soft: rgba(240,107,107,0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow: 0 2px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.55);
}
html, body { min-height: 100%; font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.header { position: sticky; top: 0; z-index: 50; background: rgba(14,17,24,0.88); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #6a8df5 0%, #a07cf8 100%); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -0.5px; flex-shrink: 0; }
.header-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.header-badge { font-size: 11px; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border2); padding: 2px 9px; border-radius: 100px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s ease; white-space: nowrap; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 4px 14px var(--accent-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius-xs); background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-dim); transition: all 0.13s ease; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface3); color: var(--text-muted); }
.icon-btn.del:hover { background: var(--red-soft); color: var(--red); }
.lang-wrap { position: relative; }
.lang-btn { gap: 4px; padding: 6px 10px; font-size: 12px; }
.lang-menu { position: absolute; right: 0; top: 38px; z-index: 60; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 130px; padding: 6px; display: none; }
.lang-menu.open { display: block; }
.lang-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: transparent; border: none; color: var(--text); cursor: pointer; font-family: inherit; font-size: 13px; text-align: left; }
.lang-item:hover { background: var(--surface2); }
.lang-item.active { color: var(--accent); }
.main { flex: 1; padding: 24px 18px 24px 24px; overflow-x: auto; }
.grid { display: flex; gap: 18px; align-items: flex-start; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scroll-snap-type: x proximity; width: max-content; min-width: 100%; }
.empty { min-width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; text-align: center; }
.empty-icon { font-size: 40px; margin-bottom: 4px; opacity: 0.5; }
.empty h2 { font-size: 17px; font-weight: 600; }
.empty p { font-size: 13px; color: var(--text-muted); max-width: 280px; line-height: 1.6; }
.card { width: 350px; flex: 0 0 350px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; transition: border-color 0.2s, box-shadow 0.2s; scroll-snap-align: start; }
.card:hover { border-color: var(--border2); box-shadow: var(--shadow); }
.card.dragging { opacity: 0.55; transform: scale(0.98); }
.card.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.card.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
.card-accent { height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, var(--accent), #a07cf8); opacity: 0; transition: opacity 0.2s; }
.card:hover .card-accent { opacity: 1; }
.card-accent.full { opacity: 1; background: linear-gradient(90deg, var(--green), #34d39a); }
.card-head { padding: 18px 18px 14px; display: flex; align-items: flex-start; gap: 10px; }
.card-title-wrap { flex: 1; min-width: 0; }
.card-name { font-size: 14px; font-weight: 600; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius-xs); padding: 2px 5px; margin: -2px -5px; width: 100%; outline: none; font-family: inherit; cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color 0.13s, background 0.13s; }
.card-name:focus { border-color: var(--accent); background: var(--surface2); white-space: normal; overflow: visible; text-overflow: clip; }
.card-name::placeholder { color: var(--text-dim); }
.card-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; padding-left: 5px; }
.card-actions { display: flex; gap: 2px; }
.card-progress { padding: 0 18px 14px; }
.prog-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.prog-counts { font-size: 12px; color: var(--text-muted); }
.prog-pct { font-size: 12px; font-weight: 600; color: var(--accent); }
.prog-pct.done-all { color: var(--green); }
.prog-track { height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #a07cf8); transition: width 0.35s cubic-bezier(0.4,0,0.2,1); }
.prog-fill.done-all { background: linear-gradient(90deg, var(--green), #34d39a); }
.divider { height: 1px; background: var(--border); margin: 0 18px; }
.card-todos { padding: 12px 18px 0; display: flex; flex-direction: column; gap: 5px; }
.todo-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: var(--radius-xs); background: transparent; border: 1px solid transparent; transition: background 0.12s, border-color 0.12s; }
.todo-item:hover { background: var(--surface2); border-color: var(--border); }
.cb { width: 17px; height: 17px; border-radius: 5px; flex-shrink: 0; border: 1.5px solid var(--border2); cursor: pointer; background: transparent; display: flex; align-items: center; justify-content: center; transition: all 0.13s ease; }
.todo-item > .cb, .todo-sub > .cb { margin-top: 3px; }
.cb:hover { border-color: var(--accent); }
.cb.on { background: var(--green); border-color: var(--green); }
.cb.on::after { content: ''; width: 9px; height: 5.5px; border-left: 1.8px solid #0e1118; border-bottom: 1.8px solid #0e1118; transform: rotate(-45deg) translate(0.5px, -0.5px); display: block; }
.todo-text { flex: 1; font-size: 13px; color: var(--text); line-height: 1.45; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 1px 4px; outline: none; font-family: inherit; cursor: text; word-break: break-word; transition: border-color 0.12s, background 0.12s; }
.todo-text:focus { border-color: var(--accent); background: var(--surface2); }
.todo-text.done { text-decoration: line-through; color: var(--text-dim); }
.todo-empty { padding: 16px 10px; text-align: center; font-size: 12px; color: var(--text-dim); border: 1px dashed var(--border2); border-radius: var(--radius-xs); }
.todo-block { display: flex; flex-direction: column; gap: 0; }
.todo-sub-wrap { margin: 2px 0 6px 14px; padding: 0 0 2px 12px; border-left: 2px solid var(--border2); display: flex; flex-direction: column; gap: 3px; }
.todo-sub-wrap.collapsed { display: none; }
.todo-more-wrap, .todo-sub-more-wrap { flex-shrink: 0; align-self: flex-start; }
.todo-more-wrap .more-menu, .todo-sub-more-wrap .more-menu { z-index: 30; top: 28px; min-width: 140px; }
.todo-sub-more-wrap .more-menu { top: 26px; min-width: 120px; }
.todo-sub { display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px; border-radius: var(--radius-xs); background: transparent; border: 1px solid transparent; transition: background 0.12s, border-color 0.12s; }
.todo-sub:hover { background: var(--surface2); border-color: var(--border); }
.todo-sub .cb { width: 15px; height: 15px; border-radius: 4px; }
.todo-sub .cb.on::after { width: 8px; height: 4.5px; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.todo-sub-text { font-size: 12px; line-height: 1.4; }
.todo-sub-add { display: flex; gap: 6px; align-items: center; padding: 2px 0 0; }
.add-input-sub { flex: 1; padding: 6px 10px; font-size: 12px; }
.add-btn-sub { width: 28px; height: 28px; flex-shrink: 0; }
.card-add { padding: 10px 18px 16px; display: flex; gap: 7px; align-items: center; }
.add-input { flex: 1; padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.13s; }
.add-input::placeholder { color: var(--text-dim); }
.add-input:focus { border-color: var(--accent); }
.add-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--accent-soft); border: 1px solid rgba(106,141,245,0.2); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--accent); transition: all 0.13s ease; }
.add-btn:hover { background: var(--accent); color: #fff; }
.add-card { background: transparent; border: 1.5px dashed var(--border2); border-radius: var(--radius); min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; color: var(--text-muted); font-size: 13px; font-weight: 500; transition: all 0.18s ease; width: 350px; flex: 0 0 350px; scroll-snap-align: start; }
.add-card:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.add-card-icon { font-size: 22px; opacity: 0.7; }
.more-wrap { position: relative; }
.more-menu { position: absolute; right: 0; top: 34px; z-index: 20; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 150px; padding: 6px; display: none; }
.more-menu.open { display: block; }
.more-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: transparent; border: none; color: var(--text); cursor: pointer; font-family: inherit; font-size: 13px; text-align: left; }
.more-item:hover { background: var(--surface2); }
.more-item.danger { color: var(--red); }
.more-item.danger:hover { background: var(--red-soft); }
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay.hidden { display: none; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); width: 100%; max-width: 380px; padding: 26px; box-shadow: var(--shadow-lg); animation: popIn 0.18s cubic-bezier(0.34,1.3,0.64,1); }
@keyframes popIn { from { opacity:0; transform:scale(0.94) translateY(8px); } to { opacity:1; transform:none; } }
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; }
.form-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-input { width: 100%; padding: 9px 13px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.13s; }
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 7px; }
.toast { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 15px; font-size: 13px; display: flex; align-items: center; gap: 9px; box-shadow: var(--shadow); animation: slideIn 0.18s ease; }
.toast.ok { border-color: rgba(62,207,114,0.25); }
@keyframes slideIn { from { opacity:0; transform:translateX(10px); } to { opacity:1; transform:none; } }
.footer { border-top: 1px solid var(--border); padding: 16px 28px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 8px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }
@media (max-width: 580px) { .header { padding: 0 16px; } .header-badge { display: none; } .main { padding: 14px; } .card, .add-card { width: 320px; flex-basis: 320px; } .footer { padding: 14px 16px; flex-direction: column; text-align: center; } }
