:root {
    --navy: #1e3a8a;
    --ink: #1f2937;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --bg: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}
a { color: var(--navy); }
main { padding: 10px 12px 24px; max-width: 720px; }
h2 { font-size: 17px; margin: 6px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }

.bar {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px 12px; background: var(--navy); color: #fff; font-size: 13px;
    position: sticky; top: 0; z-index: 1;
}
.bar a { color: #fff; text-decoration: none; }
.brand { font-weight: 600; }
.me { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear { margin-left: 6px; font-size: 15px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin: -10px -12px 10px; }
.tabs a { flex: 1; text-align: center; padding: 9px; color: var(--muted); text-decoration: none; font-size: 13px; }
.tabs a.on { color: var(--navy); font-weight: 600; border-bottom: 2px solid var(--navy); }

input, select, textarea, button { font: inherit; font-size: 13px; }
input, select, textarea {
    width: 100%; min-width: 0; padding: 7px 8px;
    border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
button {
    padding: 7px 12px; border: 0; border-radius: 6px; background: var(--navy); color: #fff;
    cursor: pointer; white-space: nowrap;
}
button.secondary { background: #e2e8f0; color: var(--ink); }
button.danger { background: #fee2e2; color: #991b1b; }
label { display: block; font-size: 12px; color: var(--muted); }
label input { margin-top: 3px; }

.stack { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.row { display: flex; gap: 6px; align-items: flex-start; }
.row > select, .row > input, .row > textarea { flex: 1; }
.add { margin: 0 0 10px; }

.card { border: 1px solid var(--line); border-radius: 8px; padding: 9px; margin-bottom: 8px; }
.card-head { display: flex; gap: 8px; align-items: flex-start; }
.title, .comment { overflow-wrap: anywhere; word-break: break-word; }
.title { font-weight: 500; color: var(--ink); text-decoration: none; flex: 1; min-width: 0; }
.title.big { font-size: 15px; }
.done .title { text-decoration: line-through; color: #94a3b8; }

.check-form { margin: 0; }
.check {
    display: inline-block; width: 16px; height: 16px; flex: none; margin-top: 2px; padding: 0;
    border: 1.5px solid #94a3b8; border-radius: 4px; background: #fff;
}
button.check:hover { border-color: var(--navy); background: #eef2ff; }
.check.disabled { border-color: #cbd5e1; background: var(--soft); }
.check.checked { border-color: #16a34a; background: #16a34a; position: relative; }
.check.checked::after { content: "✓"; color: #fff; font-size: 12px; position: absolute; left: 2px; top: -2px; }

.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 5px 0 0 24px; font-size: 11px; }
.badge { padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.who { background: #e0e7ff; color: #3730a3; }
.st-todo { background: #f1f5f9; color: #475569; }
.st-doing { background: #fef3c7; color: #92400e; }
.st-done { background: #dcfce7; color: #166534; }
.locked-badge { background: #fee2e2; color: #991b1b; white-space: normal; }
.code-badge { background: #fef3c7; color: #92400e; font-family: ui-monospace, monospace; }
.count { color: var(--muted); }
.comment { margin: 6px 0 0 24px; font-size: 12px; color: #475569; background: var(--soft); border-radius: 6px; padding: 6px 8px; }
.comment b { color: var(--ink); }
main > .comment { margin-left: 0; margin-bottom: 6px; }
.reply { margin: 6px 0 0 24px; }
.reply textarea { min-height: 32px; }
.dt { font-size: 11px; color: #94a3b8; margin: 4px 0 0 24px; }
.card > .dt:first-child, .card > .title.big + .meta + .dt { margin-left: 0; }
.card > .title.big + .meta { margin-left: 0; }

.notice { background: #eff6ff; color: #1e40af; padding: 8px 10px; border-radius: 6px; }
.error { background: #fee2e2; color: #991b1b; padding: 8px 10px; border-radius: 6px; }
.hint { color: var(--muted); font-size: 13px; }

.filters { margin-bottom: 10px; }
.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; margin-bottom: 10px; }
.summary a {
    background: var(--soft); border-radius: 6px; padding: 6px 4px; text-align: center;
    font-size: 11px; color: #475569; text-decoration: none; overflow-wrap: anywhere;
}
.summary a.on { outline: 2px solid var(--navy); }
.summary b { display: block; font-size: 17px; color: var(--navy); }

.names { list-style: none; padding: 0; margin: 0; }
.names a { display: block; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.names a:hover { border-color: var(--navy); }
.code { font-size: 22px; letter-spacing: 8px; text-align: center; font-family: ui-monospace, monospace; }

.emp-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.emp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.emp-actions form { margin: 0; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--navy); font-size: 13px; }
