/* Meeting Agenda — styles. Dark, dense, mobile-friendly. */
:root {
    --bg: #0f1117;
    --panel: #171a21;
    --panel-2: #1f232c;
    --text: #e7ebf0;
    --muted: #8b93a1;
    --accent: #4a9eff;
    --red: #ff5858;
    --orange: #ff9844;
    --yellow: #ffd460;
    --green: #4ade80;
    --purple: #a78bfa;
    --border: #2a2f3a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
pre { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 12px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 4px; border-bottom: 2px solid transparent; }
.topbar nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.topbar nav a:hover { text-decoration: none; color: var(--text); }
.topbar .topsearch { margin-left: auto; }
.topbar .topsearch input { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 4px; padding: 6px 10px; font: inherit; font-size: 13px; min-width: 160px; }
.topbar .user { display: flex; gap: 12px; align-items: center; color: var(--muted); flex-wrap: wrap; }
.tz-badge { font-size: 11px; color: var(--muted); background: var(--panel-2); padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); cursor: help; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-weight: 600; margin: 0 0 12px; font-size: 22px; line-height: 1.3; }
h2 { font-weight: 600; margin: 22px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
h2 .count { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 4px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.flash { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.flash-ok    { background: #2d4e35; }
.flash-error { background: #4e2d2d; }
.flash-info  { background: var(--panel-2); }
.error { color: var(--red); margin-bottom: 12px; padding: 10px 12px; background: rgba(255,88,88,.08); border-left: 3px solid var(--red); border-radius: 4px; }

/* Keyboard focus visibility on the dark theme. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }

/* Skip-to-content link — invisible until focused. */
.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus { left: 12px; top: 12px; z-index: 1000; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 4px; }

/* Screen-reader-only utility. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---- buttons ---- */
.btn { display: inline-block; padding: 9px 15px; min-height: 38px; background: var(--accent); color: #fff; border: 0; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1.4; text-decoration: none; }
.btn:hover { text-decoration: none; opacity: .92; }
.btn-sm { padding: 5px 9px; min-height: 30px; font-size: 12px; line-height: 1.4; }
.btn-muted { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #5a2d2d; color: #ffd9d9; border: 1px solid #743a3a; }
.lbtn { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 4px; cursor: pointer; padding: 3px 7px; font-size: 12px; }
.lbtn:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.lbtn:disabled { opacity: .35; cursor: default; }
.lbtn-x:hover { color: var(--red); border-color: var(--red); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; align-items: center; }
.form-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
form.inline { display: inline; }
.filter-tabs { display: inline-flex; gap: 4px; margin-left: 6px; }
.filter-tabs a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; color: var(--muted); }
.filter-tabs a.on { background: var(--panel-2); color: var(--text); border-color: var(--accent); }

/* ---- pills ---- */
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--panel-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--border); }
.pill-sm { padding: 0 6px; font-size: 10px; }
.st-new            { background: #2d3a4e; color: #cfe0ff; border-color: #3a4e74; }
.st-carried_forward{ background: #3a3a52; color: #d8ccff; border-color: #4e4e74; }
.st-in_progress    { background: #2e4d44; color: #c7f5e0; border-color: #3a6d5c; }
.st-blocked        { background: #5a3a3a; color: #ffd9d9; border-color: #743a3a; }
.st-complete,
.st-completed,
.st-resolved       { background: #2e6d3f; color: #fff; border-color: #2e6d3f; }
.st-dropped,
.st-abandoned,
.st-deferred       { background: #3a3f48; color: var(--muted); }
.st-open           { background: #2d3a4e; color: #cfe0ff; border-color: #3a4e74; }
.st-draft          { background: #3a3f48; color: #cfd6e0; }
.st-scheduled      { background: #2d3a4e; color: #cfe0ff; border-color: #3a4e74; }
.st-active,
.st-monitoring     { background: #2e4d44; color: #c7f5e0; border-color: #3a6d5c; }
.prio-low    { background: #3a3f48; color: var(--muted); }
.prio-normal { background: #2d3a4e; color: #cfe0ff; border-color: #3a4e74; }
.prio-high   { background: #5a4a2d; color: #ffe6b0; border-color: #74602f; }
.prio-urgent { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); margin-bottom: 18px; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--panel-2); font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
table.data .sub { font-size: 12px; margin-top: 2px; }
.row-actions { white-space: nowrap; }
.row-dim td { opacity: .6; }
tr.tk-complete td, tr.tk-deferred td { opacity: .55; }

/* ---- cards / dashboard grid ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.card h2 { margin-top: 0; }
.card table.data { margin-bottom: 0; background: transparent; }

/* Dashboard: two stat tiles (Open tasks, Active ongoing issues). */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.stat-grid > * { min-width: 0; }
.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; color: var(--text); text-decoration: none; transition: border-color .12s, transform .12s; min-width: 0; }
.stat-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.stat-card .stat-num { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); flex-shrink: 0; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.stat-card::after { content: "›"; color: var(--muted); font-size: 22px; line-height: 1; margin-left: 6px; }

/* Dashboard: side-by-side row for "Waiting" + "Recently completed". */
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 8px; }
.split-grid > * { min-width: 0; }
.split-grid .card ul.list { word-break: break-word; overflow-wrap: anywhere; }
@media (max-width: 700px) {
    .stat-grid, .split-grid { grid-template-columns: 1fr; }
}

/* ---- generic lists ---- */
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list > li { padding: 8px 0; border-bottom: 1px solid var(--border); }
ul.list > li:last-child { border-bottom: 0; }
.sub { font-size: 13px; margin-top: 2px; }

/* ---- meta dl ---- */
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 18px; }
dl.meta dt { color: var(--muted); font-size: 13px; }
dl.meta dd { margin: 0; }
dl.meta dd p { margin: 0 0 6px; }
dl.meta dd p:last-child { margin-bottom: 0; }

/* ---- panels (meeting view sections) ---- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin: 14px 0; }
.panel > h2 { margin-top: 0; }

/* ---- meeting head ---- */
.m-head h1 { margin-bottom: 4px; }
.m-sub { color: var(--muted); font-size: 14px; }
.m-nav { margin-top: 6px; font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.m-nav .sep { color: var(--border); }
.mtime { font-variant-numeric: tabular-nums; }

/* ---- agenda list ---- */
ol.agenda-list { list-style: none; margin: 0; padding: 0; counter-reset: agenda; }
li.agenda-item { counter-increment: agenda; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px 10px 36px; margin: 8px 0; position: relative; background: var(--panel-2); }
li.agenda-item::before { content: counter(agenda); position: absolute; left: 10px; top: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
li.agenda-item.st-complete, li.agenda-item.st-dropped { opacity: .6; }
.ai-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ai-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-owner { color: var(--orange); font-size: 12px; }
.ai-issue { font-size: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; }
.ai-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-controls select, .ai-controls .lbtn { font-size: 12px; }
.ai-owner-form { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; }
.ai-owner-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ai-owner-form input { background: var(--panel-2); border: 1px solid var(--border); color: var(--orange); border-radius: 3px; padding: 3px 6px; font: inherit; font-size: 12px; width: 9em; }
.ai-owner-form input:focus { outline: 1px solid var(--accent); color: var(--text); }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; }
.ai-desc { margin: 6px 0; font-size: 14px; color: #cdd3db; }
.ai-desc p { margin: 0 0 6px; }
.ai-notes { margin-top: 8px; }
.ai-edit { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.ai-edit > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ---- notes ---- */
ul.notes { list-style: none; margin: 6px 0; padding: 0; }
ul.notes > li { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin: 6px 0; }
ul.notes > li.note-summary { border-left: 3px solid var(--green); }
.note-body { font-size: 14px; }
.note-body p { margin: 0 0 6px; }
.note-body p:last-child { margin-bottom: 0; }
.note-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note-meta form.inline { margin-left: auto; }
.note-add { margin-top: 6px; }
.note-add textarea { width: 100%; }
.note-add-row { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
.history { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; white-space: pre-wrap; overflow-x: auto; margin: 6px 0; }
.logview { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; overflow-x: auto; margin: 12px 0; font-size: 12px; white-space: pre; }

/* ---- add boxes ---- */
.add-box { margin-top: 12px; border: 1px dashed var(--border); border-radius: 6px; padding: 8px 12px; }
.add-box > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.add-box[open] > summary { margin-bottom: 8px; }

/* ---- forms ---- */
.stack-form { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.stack-form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.stack-form input[type=text], .stack-form input[type=email], .stack-form input[type=password], .stack-form input[type=date], .stack-form input[type=datetime-local],
.stack-form input[type=search], .stack-form textarea, .stack-form select,
.note-add textarea {
    width: 100%; padding: 9px 10px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 15px;
}
.stack-form textarea, .note-add textarea { resize: vertical; }
.stack-form input[type=checkbox], .stack-form input[type=radio] { width: 18px; height: 18px; }
.row2 label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.row2 label.check { flex-direction: row; align-items: center; color: var(--text); font-size: 14px; }
.danger-form { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); max-width: 720px; }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; padding: 9px 10px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font: inherit; }

/* ---- review tables (complete meeting) ---- */
.review-table td { vertical-align: middle; }
.review-table .ri { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; font-size: 13px; color: var(--text); white-space: nowrap; }
.review-table .ri input { width: 16px; height: 16px; }

/* ---- login ---- */
.login-card { max-width: 380px; margin: 48px auto; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.login-card label { display: block; margin-bottom: 14px; color: var(--muted); }
.login-card input { width: 100%; margin-top: 4px; padding: 11px; font-size: 16px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.login-card button { width: 100%; padding: 12px; font-size: 16px; }

/* ---- misc ---- */
time.ts { font-variant-numeric: tabular-nums; }
.ts-empty { color: var(--muted); }
.due-overdue { color: var(--red); font-weight: 600; }
.due-today { color: var(--orange); font-weight: 600; }
.issue-mini { list-style: none; margin: 0; padding: 0; }
.issue-mini > li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.issue-mini > li:last-child { border-bottom: 0; }
.issue-mini form.inline { margin-left: auto; }
.tasks-table td { vertical-align: top; }
.tk-edit > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.tk-edit[open] { display: block; }
.tk-edit .stack-form { margin-top: 8px; }

/* ---- mobile ---- */
@media (max-width: 700px) {
    body { font-size: 15px; }
    main { padding: 14px 12px 50px; }
    h1 { font-size: 19px; }
    .topbar { padding: 8px 12px; gap: 8px; }
    .topbar .topsearch { margin-left: 0; order: 4; width: 100%; }
    .topbar .topsearch input { width: 100%; }
    .topbar .user { width: 100%; justify-content: space-between; order: 3; }
    .dash-grid { grid-template-columns: 1fr; }
    table.data { font-size: 13px; }
    table.data th, table.data td { padding: 7px 6px; }
    li.agenda-item { padding-left: 12px; }
    li.agenda-item::before { position: static; display: inline-block; margin-right: 6px; }
    .ai-top { gap: 6px; }
}
