:root { --ink: #172033; --muted: #5b6474; --line: #d9d6ce; --accent: #2f6f5e; --bg: #fbfaf7; --run: #e6f2ee; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { font-weight: 600; color: var(--ink); text-decoration: none; }
nav { display: flex; gap: 16px; }
nav a, td a, .crumbs a { color: var(--accent); }
.logout { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 16px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.running td { background: var(--run); }
button { font: inherit; padding: 6px 14px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; cursor: pointer; }
.logout button { background: #fff; color: var(--accent); }
input, select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
label { display: inline-flex; gap: 6px; align-items: center; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.narrow { max-width: 380px; margin: 40px auto; }
.narrow form { display: grid; gap: 12px; }
.narrow label { display: grid; gap: 4px; }
.error { color: #9b2c2c; }
.note { color: var(--muted); }
.total { font-weight: 600; }
h1:focus { outline: none; }
@media (max-width: 640px) {
  table.timers th:nth-child(2), table.timers td:nth-child(2) { display: none; }
  .logout span { display: none; }
  .top { gap: 8px 16px; }
}
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; }
.chips legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.chips label { font-size: 14px; }
.button-link { display: inline-block; padding: 6px 14px; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); text-decoration: none; background: #fff; }
th a { color: var(--ink); }
.muted { color: var(--muted); }
.hl-nfc { background: #fff6bf; font-weight: 600; }
.hl-intest { background: #ddf7d6; font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pager a { padding: 3px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--accent); text-decoration: none; }
.pager a.current { background: var(--accent); color: #fff; }
.crumbs { margin: 0; color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.descr { margin-bottom: 20px; overflow-x: auto; }
.post { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; overflow-x: auto; }
.post header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.post.seq-0, .post.seq-1 { border-left: 4px solid #c9a227; }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: #eef1f4; color: var(--muted); }
.tag.internal { background: #fff3cd; color: #7a5b00; }
.body img { max-width: 100%; height: auto; }
td small { color: var(--muted); }
@media (max-width: 640px) {
  table.topics th:nth-child(1), table.topics td:nth-child(1), table.topics th:nth-child(3), table.topics td:nth-child(3),
  table.topics th:nth-child(5), table.topics td:nth-child(5), table.topics th:nth-child(6), table.topics td:nth-child(6) { display: none; }
}

/* write forms */
form.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px 6px 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.form label, .reply label, .descr label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.form input:not([type=checkbox]), .form select, .form textarea, .reply textarea, .reply select, .descr textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.form textarea, .reply textarea, .descr textarea { width: 100%; box-sizing: border-box; }
.row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.reply summary, .descr summary { cursor: pointer; color: var(--accent); margin: 6px 0; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button.link { background: none; border: none; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; font-size: 13px; }
.post-tools { float: right; display: inline-flex; gap: 8px; }
.post-tools select { font-size: 12px; padding: 2px 4px; }
@media (max-width: 640px) { .post-tools { float: none; display: flex; margin-top: 6px; } }
.attachments { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.attachments a { color: var(--accent); }
.files { margin-top: 8px; }
.jodit-container { margin-bottom: 10px; }

/* planner */
table.planner { width: 100%; border-collapse: collapse; }
table.planner tr.day-head th { text-align: left; font-weight: 600; padding: 10px 6px 4px; color: var(--muted); border-bottom: 1px solid var(--line); }
table.planner tbody.drop tr.day-head th { color: var(--accent); }
table.planner tr.task td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.planner tr.task.dragging { opacity: .4; }
td.grip { cursor: grab; color: var(--muted); width: 18px; }
tr.ytoday td, tr.ytoday2 td { background: #fdecea; }
tr.today td { background: #eef7ee; }
tr.bred td:nth-child(2) { border-left: 3px solid #c0392b; }
tr.byellow td:nth-child(2) { border-left: 3px solid #e1b12c; }
table.list { width: 100%; border-collapse: collapse; }
table.list td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
tr.mine td:first-child { font-weight: 600; }
tr.sub td:first-child { font-style: italic; }
tr.onhold td { background: #f6e3cf; }
tr.client-last td { background: #fdecea; color: #a12b2b; }
tr.overdue td { color: #a12b2b; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
button.timer { min-width: 56px; }
button.timer.running { background: #c0392b; border-color: #c0392b; color: #fff; }
dialog#plan-dialog { max-width: 720px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
dialog#plan-dialog .last-posts .post { border-top: 1px solid var(--line); padding: 6px 0; font-size: 14px; }
label.check { flex-direction: row !important; align-items: center; gap: 6px; }

/* status board */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.board-col { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.board-col h2 { font-size: 15px; margin: 0 0 8px; }
.board-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; font-size: 14px; background: #fcfcfa; }
.board-card.has-sub > a:first-of-type { font-weight: 600; }
.board-card.overdue { border-left: 3px solid #c0392b; }
.board-card .sub-link { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--accent); }
.col-ready .board-card { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; }
.col-ready .board-card .note, .col-ready .board-card .sub-link { grid-column: 2; }

/* epics */
.epics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .epics { grid-template-columns: 1fr; } }
.epic-tree, .epic-tree ul { list-style: none; padding-left: 18px; margin: 4px 0; }
.epic-drop { display: inline-block; padding: 3px 8px; border-radius: 5px; cursor: grab; }
.epic-drop.drop { background: #e7f2ec; outline: 1px dashed var(--accent); }
.epic-root { color: var(--muted); border: 1px dashed var(--line); margin-bottom: 6px; }

/* my work */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
table.grid th a { color: inherit; }
form.inline { display: inline; margin: 0; }
nav.pager { margin-top: 8px; display: flex; gap: 8px; }
tr.statusCompleted, tr.statusOP { color: var(--muted); }
tr.statusNFC { background: #fdf3e1; }

/* overview */
ul.overview, ul.overview ul { list-style: none; padding-left: 18px; margin: 2px 0; }
ul.overview { padding-left: 0; }
ul.overview summary { cursor: pointer; padding: 3px 0; }
ul.overview .leaf { display: inline-block; padding: 3px 0 3px 14px; }
ul.overview .count { font-weight: 700; margin-left: 6px; }
tr.task-open { background: #ffe9e9; }
main a { color: var(--accent); }
section.card { overflow-x: auto; }
section.card + section.card { margin-top: 16px; }
table.grid select { max-width: 140px; }
