* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f4f5;
  color: #18181b;
}
[hidden] { display: none !important; }
.app { min-height: 100vh; }
.top {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #18181b;
  color: #fff;
}
.brand { font-weight: 700; font-size: 18px; }
.spacer { flex: 1; }
kbd { padding: 2px 8px; border: 1px solid #52525b; border-radius: 6px; font-size: 12px; color: #d4d4d8; }
.avatar { padding: 4px 12px; border-radius: 999px; background: #3f3f46; font-size: 13px; }
.grid { display: flex; flex-direction: column; gap: 16px; padding: 24px; max-width: 1100px; margin: 0 auto; }
.row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.row > .card { flex: 1 1 320px; min-width: 0; margin: 0; }
h2 { margin: 0 0 12px; font-size: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 13px; color: #71717a; }
.stat-value { font-size: 32px; font-weight: 700; }
.stat-hint { font-size: 12px; color: #a1a1aa; }
.card { background: #fff; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.add-form { display: flex; flex-direction: column; gap: 10px; }
.add-row { display: flex; align-items: center; gap: 8px; }
input[type="text"] { flex: 1; width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid #d4d4d8; border-radius: 8px; }
input[aria-invalid="true"] { border-color: #ef4444; }
button { padding: 8px 12px; border: 1px solid #d4d4d8; background: #fff; border-radius: 8px; cursor: pointer; font: inherit; }
button:hover:not(:disabled) { background: #f4f4f5; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: #18181b; color: #fff; border-color: #18181b; }
button.primary:hover:not(:disabled) { background: #3f3f46; }
button.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
button.danger:hover:not(:disabled) { background: #b91c1c; }
.field-error { margin: 8px 0 0; color: #b91c1c; font-size: 14px; }
.todo-list { list-style: none; padding: 0; margin: 0; min-height: 48px; }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f4f4f5; }
.line.shell { border: none; padding: 0; justify-content: flex-end; }
.shell-acts { display: inline-block; width: 1px; height: 1px; }
.row-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line.is-done .row-title { text-decoration: line-through; color: #a1a1aa; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.done { background: #dcfce7; color: #15803d; }
.row-acts { position: relative; }
.row-menu-btn { border: none; font-size: 18px; line-height: 1; }
.row-menu { position: absolute; right: 0; top: 100%; z-index: 10; display: flex; flex-direction: column; min-width: 120px; background: #fff; border: 1px solid #e4e4e7; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); padding: 4px; }
.row-menu button { border: none; text-align: left; }
.state { padding: 8px 0 12px; color: #71717a; }
.error-state { display: flex; align-items: center; gap: 12px; color: #b91c1c; }
.error-state p { margin: 0; }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.skel-row { height: 36px; border-radius: 8px; background: linear-gradient(90deg, #f4f4f5, #e4e4e7, #f4f4f5); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin { width: 18px; height: 18px; border: 2px solid #d4d4d8; border-top-color: #18181b; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.backdrop { position: fixed; inset: 0; background: rgba(24, 24, 27, 0.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: min(440px, calc(100vw - 32px)); background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.modal h2 { font-size: 18px; }
.modal-body p { margin: 0; }
.modal-body .field-error { margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #18181b; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; }
