:root {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --bg: #ffffff;
  --panel: #fff;
  --sidebar: #fbfbfa;
  --sidebar-hover: #efefed;
  --sidebar-active: #e9e9e7;
  --line: #e6e4df;
  --text: #2f2f2d;
  --muted: #787774;
  --soft: #f7f6f3;
  --accent: #2f5f9f;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(15, 15, 15, .05);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, select { cursor: pointer; }
h1, h2, p { margin: 0; }
h1 { color: #252525; font-size: 30px; font-weight: 700; line-height: 1.18; letter-spacing: 0; }
h2 { color: #37352f; font-size: 15px; font-weight: 650; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.55; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #f3f5f7; }
.login-shell { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(320px, 430px); width: min(940px, 100%); overflow: hidden; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(28, 36, 48, .12); }
.login-intro { position: relative; display: grid; align-content: space-between; min-height: 520px; padding: 34px; background: #243447; color: #fff; }
.login-intro::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: 34px 34px; }
.login-intro > * { position: relative; }
.login-logo-row { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.78); font-size: 13px; font-weight: 700; }
.login-logo { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; }
.login-intro h1 { max-width: 360px; margin-bottom: 12px; color: #fff; font-size: 34px; line-height: 1.12; }
.login-intro p { max-width: 340px; color: rgba(255,255,255,.72); font-size: 15px; }
.login-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.login-meta span { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.82); font-size: 12px; font-weight: 700; }
.login-panel { display: grid; align-content: center; gap: 16px; min-height: 520px; padding: 42px; background: #fff; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.login-brand h2 { color: #1f2733; font-size: 22px; line-height: 1.2; }
.login-brand p { margin-top: 3px; color: #697386; font-size: 13px; }
.login-panel label { display: grid; gap: 7px; }
.login-panel label span { color: #596579; font-size: 12px; font-weight: 750; }
.login-panel input { width: 100%; min-height: 42px; border: 1px solid #d9e0e8; border-radius: 7px; padding: 9px 11px; background: #fbfcfd; color: #1f2733; outline: none; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease; }
.login-panel input::placeholder { color: #a1aab8; }
.login-panel input:hover { border-color: #c8d2df; background: #fff; }
.login-panel input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(47, 95, 159, .13); }
.login-error { border: 1px solid #efb4b4; border-radius: 7px; padding: 11px 12px; background: #fff3f3; color: #8a1f1f; font-size: 13px; font-weight: 700; line-height: 1.4; }
.login-panel .primary { width: 100%; min-height: 42px; margin-top: 4px; border-radius: 7px; font-weight: 750; box-shadow: 0 10px 20px rgba(47, 95, 159, .18); }
.login-panel .primary:hover { background: #254f86; }
.login-domain-form { display: grid; gap: 11px; border-top: 1px solid #e6eaef; margin-top: 4px; padding-top: 16px; }
.login-domain-form .ghost { width: 100%; min-height: 40px; }

.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; overflow: auto; padding: 10px; border-right: 1px solid var(--line); background: var(--sidebar); color: #37352f; }
.brand { display: flex; gap: 9px; align-items: center; min-height: 44px; padding: 7px 8px; border-radius: 6px; }
.brand:hover { background: var(--sidebar-hover); }
.brand strong { display: block; overflow: hidden; color: #37352f; font-size: 14px; font-weight: 650; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 5px; background: #37352f; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.brand span, .account small, .nav-section span, .density span { display: block; color: var(--muted); font-size: 11px; line-height: 1.25; }
.account summary { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 5px 8px; border-radius: 6px; background: transparent; list-style: none; }
.account summary:hover { background: var(--sidebar-hover); }
.account summary strong { color: #37352f; font-size: 13px; font-weight: 600; }
.account-menu { display: grid; gap: 2px; margin-top: 3px; padding: 3px 0 3px 30px; border: 0; border-radius: 0; background: transparent; }
.account-menu a { display: grid; grid-template-columns: 24px 1fr; gap: 1px 8px; align-items: center; min-height: 30px; padding: 4px 7px; border-radius: 5px; color: #37352f; }
.account-menu small { grid-column: 2; }
.search-trigger { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; min-height: 32px; padding: 5px 8px; border-radius: 6px; background: transparent; color: var(--muted); }
.search-trigger:hover, .search-trigger:focus-within { background: var(--sidebar-hover); color: #37352f; }
.search-trigger input { min-width: 0; border: 0; outline: 0; background: transparent; color: #37352f; font-size: 13px; }
.search-trigger input::placeholder { color: var(--muted); }
kbd { border: 1px solid #dad8d3; border-bottom-color: #c7c4bd; border-radius: 4px; padding: 1px 5px; background: #fff; color: #787774; font-size: 11px; line-height: 1.3; }
.nav { display: grid; gap: 1px; }
.nav a, .nav summary, .nav button { display: flex; min-height: 30px; align-items: center; gap: 8px; border: 0; border-radius: 5px; padding: 5px 8px; background: transparent; color: #37352f; font-size: 13px; line-height: 1.2; text-align: left; }
.nav summary { list-style: none; font-weight: 500; }
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover, .nav button:hover, .account-menu a:hover { background: var(--sidebar-hover); }
.nav a.active, .nav summary.active { background: var(--sidebar-active); font-weight: 600; }
.nav-section { margin: 7px 0 4px; }
.nav-section > span { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; }
.tree-chevron::before { content: ">"; display: inline-block; width: 10px; color: #9b9a97; font-size: 12px; line-height: 1; transition: transform .14s ease; }
.tree-node[open] .tree-chevron::before { transform: rotate(90deg); }
.tree-children { display: grid; margin-left: 26px; padding-left: 7px; border-left: 1px solid #e5e3de; }
.tree-children a { min-height: 28px; color: #5f5e5b; }
.add-workspace { width: 100%; margin-top: 3px; color: var(--muted); }
.add-workspace::before { content: "+"; display: grid; width: 18px; height: 18px; place-items: center; border: 0; border-radius: 4px; color: #9b9a97; font-size: 18px; font-weight: 400; line-height: 1; }
.density { display: grid; gap: 6px; margin-top: auto; padding: 8px; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.density select, .task-toolbar select, .report-form select, .report-form input, .report-form textarea { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--text); }
.density select { min-height: 30px; background: var(--soft); color: #37352f; font-size: 13px; }
.avatar { display: inline-grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(55,53,47,.08); border-radius: 50%; background: #e9e5df; color: #37352f; font-size: 10px; font-weight: 650; }
.project-dot { display: inline-grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border-radius: 5px; color: #fff; font-size: 9px; font-weight: 650; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 6; display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 0 22px; background: rgba(255,255,255,.86); backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; gap: 7px; color: var(--muted); font-size: 13px; }
.breadcrumbs span + span::before { content: "/"; margin-right: 7px; color: #b1b0ad; }
.breadcrumbs span:last-child { color: #37352f; font-weight: 600; }
.top-actions, .avatar-stack, .view-tabs, .task-toolbar, .card-foot, .calendar-title, .shortcuts, .doc-meta, .top-user { display: flex; align-items: center; }
.top-actions { gap: 8px; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.ghost, .icon-button, .primary, .view-tabs a, .view-tabs button, .embedded-db a, .shortcuts a, .logout-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; padding: 7px 10px; }
.ghost, .view-tabs a, .view-tabs button { border: 1px solid var(--line); background: #fff; color: var(--text); }
.ghost:hover, .icon-button:hover, .view-tabs a:hover, .view-tabs button:hover { background: var(--soft); }
.icon-button { width: 32px; border: 1px solid var(--line); background: #fff; }
.top-user { max-width: min(320px, 36vw); gap: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px 4px 4px; background: #fff; }
.top-user > span:last-child { display: grid; min-width: 0; gap: 1px; }
.top-user strong, .top-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user strong { color: #37352f; font-size: 13px; font-weight: 700; line-height: 1.1; }
.top-user small { color: var(--muted); font-size: 11px; line-height: 1.1; }
.logout-button { border: 1px solid #d8dce3; background: #fff; color: #3f4654; font-weight: 700; }
.logout-button:hover { border-color: #c9d1dc; background: #f6f8fa; color: #1f2733; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.primary:disabled { cursor: not-allowed; border-color: #cbd5e1; background: #cbd5e1; }
.workspace { padding: 24px 32px 48px; }
.flash { max-width: 1440px; margin: 0 auto 12px; border: 1px solid #b9d5f4; border-radius: 7px; padding: 10px 12px; background: #edf6ff; color: #174a7c; font-weight: 700; }
.flash-settings_error, .flash-document_error { border-color: #f3b4b4; background: #fff1f1; color: #8a1f1f; }
.flash-document_success, .flash-settings_success { border-color: #b8dec8; background: #effaf3; color: #17613a; }
.page, .document { display: grid; gap: 18px; max-width: 1440px; margin: 0 auto; }
.page-head, .task-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.badge { align-self: start; border: 1px solid #b9d5f4; border-radius: 999px; padding: 6px 10px; background: #edf6ff; color: #174a7c; font-weight: 700; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.metric, .panel, .task-card, .document, .drawer, .search-modal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.metric { display: grid; gap: 6px; padding: 16px; }
.metric span { color: var(--muted); }
.metric strong { font-size: 25px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 14px; }
.panel { padding: 16px; }
.panel h2 { margin-bottom: 12px; }
.project-list, .activity, .reports-list, .wiki-list { display: grid; gap: 8px; }
.project-row { display: grid; grid-template-columns: 28px minmax(120px, 1fr) 78px minmax(140px, 1fr) 48px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e7ebf1; }
.progress i { display: block; height: 100%; border-radius: inherit; }
.activity div { border-bottom: 1px solid var(--line); padding: 10px 0; }
.activity span { display: block; color: var(--muted); font-size: 12px; }
.project-empty { color: var(--muted); font-size: 12px; }
.activity .activity-empty { border: 1px dashed #cfd8e3; border-radius: 7px; padding: 14px; background: #fbfcfd; }

.view-tabs { flex-wrap: wrap; gap: 8px; }
.view-tabs a.active, .view-tabs button.active { border-color: #8fbde8; background: #eef7ff; color: #174a7c; }
.view-tabs span { flex: 1; }
.task-options { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar-menu { position: relative; }
.toolbar-menu summary { display: inline-flex; min-height: 32px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; list-style: none; }
.toolbar-menu summary::-webkit-details-marker { display: none; }
.toolbar-menu[open] summary { border-color: #8fbde8; background: #eef7ff; color: #174a7c; }
.toolbar-menu > div { position: absolute; right: 0; z-index: 12; display: grid; width: 260px; gap: 9px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: #fff; box-shadow: var(--shadow); }
.toolbar-menu label { display: grid; gap: 4px; }
.toolbar-menu label span, .timeline-tools label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.toolbar-menu select, .timeline-tools input, .quick-field input, .quick-field select, .column-title-form input, .column-create-form input { width: 100%; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--text); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.kanban-col { display: grid; align-content: start; gap: var(--density-gap, 10px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--soft); transition: background .16s ease, border-color .16s ease; }
.kanban-col.is-drop-target { border-color: #9cbad7; background: #f1f7ff; }
.kanban-col.is-column-dragging { opacity: .52; }
.kanban-col.is-column-drop-target { outline: 2px solid #9cbad7; outline-offset: 2px; }
.kanban-col header { display: grid; grid-template-columns: 24px 10px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 34px; font-weight: 800; }
.kanban-col header span { width: 10px; height: 10px; border-radius: 50%; }
.kanban-col header button, .kanban-col header a { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.column-drag-handle { color: #9b9a97; cursor: grab; font-weight: 900; letter-spacing: -1px; }
.column-drag-handle:active { cursor: grabbing; }
.column-title-form { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 5px; align-items: center; }
.column-title-form input[name="name"] { border-color: transparent; background: transparent; font-weight: 800; }
.column-title-form input[name="name"]:hover, .column-title-form input[name="name"]:focus { border-color: var(--line); background: #fff; }
.column-title-form input[type="color"] { height: 28px; padding: 2px; }
.kanban-col-new { min-height: 180px; border-style: dashed; background: #fff; }
.column-create-form { display: grid; gap: 9px; }
.column-create-form h2 { margin-bottom: 2px; }
.task-card { display: grid; gap: var(--density-inner, 10px); padding: var(--density-pad, 12px); }
.task-card.is-dragging { opacity: .48; }
.task-card:hover, .project-row:hover, .table-view tr:hover, .reports-list button:hover, .wiki-list a:hover { border-color: #d4d1c9; background: var(--soft); }
.task-card div, .task-card footer { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.task-card footer { justify-content: space-between; color: var(--muted); font-size: 12px; }
.task-card strong, .task-title-cell, .timeline-row > span, .timeline-row > a, .timeline-bar-label, .calendar div a, .undated a { min-width: 0; align-items: center; gap: 6px; }
.task-card strong, .task-title-cell, .timeline-bar-label { display: flex; }
.task-icon { display: inline-grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(55,53,47,.08); border-radius: 6px; background: #f3f2ef; color: #37352f; font-size: 14px; font-weight: 700; line-height: 1; }
.task-icon-large { width: 36px; height: 36px; margin-right: 8px; border-radius: 8px; font-size: 23px; vertical-align: middle; }
.priority, .task-card em, .detail-grid em, .chips span { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 7px; background: #eef2f7; color: #4b5565; font-size: 12px; font-style: normal; font-weight: 700; }
.task-tree { display: grid; gap: 7px; margin-left: 10px; padding-left: 10px; border-left: 2px solid #dedbd4; }
.task-tree summary { display: flex; min-height: 28px; align-items: center; gap: 7px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.task-tree summary::-webkit-details-marker, .timeline-tree summary::-webkit-details-marker, .calendar-task-tree summary::-webkit-details-marker { display: none; }
.task-tree summary::before, .timeline-tree summary::before, .calendar-task-tree summary::before { content: ">"; display: inline-block; color: #8c8a86; transition: transform .14s ease; }
.task-tree[open] summary::before, .timeline-tree[open] summary::before, .calendar-task-tree[open] summary::before { transform: rotate(90deg); }
.task-tree > div { display: grid; gap: 7px; }
.task-tree .task-card { box-shadow: none; }
.task-create-dialog { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0; background: #fff; box-shadow: -24px 0 70px rgba(15, 23, 42, .18); overflow: auto; }
.workspace-create-dialog { width: min(460px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .22); }
.task-create-dialog::backdrop, .workspace-create-dialog::backdrop { background: rgba(15, 23, 42, .42); }
.task-create-dialog[open] { animation: drawerIn .18s ease-out; transform: none; }
@keyframes drawerIn { from { opacity: .65; } to { opacity: 1; } }
.dialog-close-form { position: absolute; top: 10px; right: 10px; margin: 0; }
.dialog-close-form button, .dialog-close { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.dialog-close { position: absolute; top: 10px; right: 10px; }
.task-create-form, .workspace-create-form { position: relative; display: grid; gap: 8px; padding: 18px; background: #fff; }
.task-create-form { min-height: 100%; align-content: start; gap: 12px; padding: 20px; }
.task-create-form h2, .workspace-create-form h2 { margin-right: 36px; margin-bottom: 2px; }
.task-create-form h2 { color: #1f2733; font-size: 22px; line-height: 1.2; }
.task-create-form p, .workspace-create-form p { margin-bottom: 8px; }
.task-create-form p { color: #8a94a3; font-size: 13px; font-weight: 700; }
.task-create-form label, .workspace-create-form label { display: grid; gap: 4px; }
.task-create-form label span, .workspace-create-form label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.task-create-form input, .task-create-form select, .task-create-form textarea, .workspace-create-form input, .workspace-create-form textarea { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--text); }
.task-create-form input:focus, .task-create-form select:focus, .task-create-form textarea:focus { border-color: #2f6df0; outline: 0; box-shadow: 0 0 0 3px #e8f0fe; }
.workspace-create-form input[type="color"] { height: 38px; padding: 3px; }
.task-create-form textarea, .workspace-create-form textarea { min-height: 96px; resize: vertical; }
.task-create-form .primary, .workspace-create-form .primary { width: 100%; }
.task-icon-picker { display: grid; gap: 7px; }
.task-icon-picker > label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.task-icon-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.task-icon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.task-icon-grid button { display: grid; width: 100%; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 17px; line-height: 1; }
.task-icon-grid button:hover { background: var(--soft); }
.task-icon-grid button.active { border-color: #8fbde8; background: #eef7ff; box-shadow: inset 0 0 0 1px #8fbde8; }
.task-description-editor { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); padding: 6px; background: #fbfaf8; }
.rich-toolbar button { display: inline-flex; min-width: 28px; min-height: 28px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; padding: 4px 7px; background: transparent; color: #55534e; font-size: 12px; font-weight: 800; line-height: 1; }
.rich-toolbar button:hover { border-color: var(--line); background: #fff; }
.rich-surface { min-height: 180px; max-height: 520px; overflow: auto; padding: 12px; color: var(--text); line-height: 1.55; outline: 0; }
.rich-surface:focus { box-shadow: inset 0 0 0 3px #e8f0fe; }
.rich-surface.is-empty::before { content: attr(data-placeholder); color: #a5a29b; pointer-events: none; }
.rich-description { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 7px; margin-top: 10px; padding: 12px; background: #fbfaf8; color: var(--text); line-height: 1.55; }
.rich-surface h2, .rich-description h2, .rich-surface h3, .rich-description h3 { margin: 8px 0 4px; color: #252525; line-height: 1.25; }
.rich-surface h2, .rich-description h2 { font-size: 20px; }
.rich-surface h3, .rich-description h3 { font-size: 16px; }
.rich-surface p, .rich-description p { color: var(--text); }
.rich-surface ul, .rich-description ul, .rich-surface ol, .rich-description ol { margin: 4px 0 4px 22px; padding: 0; }
.rich-surface blockquote, .rich-description blockquote { margin: 8px 0; border-left: 3px solid #b9c5d6; padding: 6px 10px; background: #f7f9fc; color: #4b5565; }
.rich-surface pre, .rich-description pre { margin: 8px 0; white-space: pre-wrap; }
.rich-surface code, .rich-description code { border-radius: 4px; padding: 2px 4px; background: #eef2f7; color: #243447; }
.rich-surface a, .rich-description a { color: #2f5f9f; text-decoration: underline; }
.rich-surface img, .rich-description img { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 7px; margin: 8px 0; }
.rich-surface iframe, .rich-description iframe { display: block; width: 100%; min-height: 220px; border: 1px solid var(--line); border-radius: 7px; margin: 8px 0; }
.rich-surface table, .rich-description table { width: 100%; border-collapse: collapse; margin: 8px 0; background: #fff; }
.rich-surface th, .rich-description th, .rich-surface td, .rich-description td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.rich-surface th, .rich-description th { background: #f7f6f3; color: #55534e; font-size: 12px; }
.rich-surface table[data-chart], .rich-description table[data-chart] { border-top: 4px solid #2f5f9f; }
.rich-surface [data-type="todo"], .rich-description [data-type="todo"] { min-height: 28px; border-radius: 5px; padding: 3px 6px; }
.rich-surface [data-type="todo"] { cursor: pointer; }
.rich-surface [data-checked="true"], .rich-description [data-checked="true"] { color: var(--muted); text-decoration: line-through; }
.rich-surface [data-mention], .rich-description [data-mention] { border-radius: 5px; padding: 1px 5px; background: #eef7ff; color: #174a7c; font-weight: 800; }

.table-view { display: grid; gap: 14px; }
.table-view section { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.table-view h2 { display: flex; align-items: center; gap: 8px; margin: 0; border-bottom: 1px solid var(--line); padding: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: var(--density-row, 11px) 12px; text-align: left; }
th { background: #f8fafc; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.status-pill { display: inline-flex; border: 1px solid; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 800; }
.task-tree-row > td { padding: 0 12px 12px 38px; background: #fbfaf8; }
.subtask-table { border-left: 2px solid #dedbd4; background: #fff; }
.subtask-table td:first-child { padding-left: 18px; }

.timeline-tools form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.timeline-tools label { display: grid; gap: 4px; }
.timeline { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.timeline-head, .timeline-row { display: grid; grid-template-columns: 260px repeat(var(--timeline-days, 14), 46px); min-width: calc(260px + var(--timeline-days, 14) * 46px); }
.timeline-head { background: #f8fafc; }
.timeline-head span, .timeline-head b, .timeline-row > span, .timeline-row > a { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; }
.timeline-row > span, .timeline-row > a { display: flex; }
.timeline-head b { text-align: center; }
.timeline-head .today { background: #e8f4ff; color: var(--accent); }
.timeline-row { position: relative; min-height: 52px; }
.timeline-row i { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 30px; align-self: center; overflow: hidden; border-radius: 6px; padding: 4px 18px; color: #fff; cursor: grab; font-size: 12px; font-style: normal; font-weight: 800; user-select: none; white-space: nowrap; touch-action: none; }
.timeline-row i.is-moving, .timeline-row i.is-resizing { opacity: .86; cursor: grabbing; outline: 3px solid rgba(47,95,159,.18); z-index: 2; }
.timeline-row em { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.25); font-style: normal; }
.timeline-bar-label { overflow: hidden; min-width: 0; text-overflow: ellipsis; }
.timeline-handle { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; background: rgba(255,255,255,.12); }
.timeline-handle::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 6px; width: 2px; border-radius: 999px; background: rgba(255,255,255,.78); }
.timeline-handle-start { left: 0; }
.timeline-handle-end { right: 0; }
.timeline-row i:hover .timeline-handle { background: rgba(255,255,255,.22); }
.timeline-date-form { position: absolute; right: 8px; top: 8px; display: none; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; background: #fff; box-shadow: var(--shadow); }
.timeline-row:hover .timeline-date-form { display: flex; }
.timeline-date-form input { width: 128px; min-height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; }
.timeline-date-form button { border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.timeline-tree { display: grid; border-bottom: 1px solid var(--line); background: #fbfaf8; }
.timeline-tree summary { display: flex; min-height: 32px; align-items: center; gap: 7px; padding: 6px 10px 6px 278px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.timeline-child-row > a, .timeline-child-row > span { padding-left: 28px; color: #55534e; }
.timeline-child-row { background: #fff; }

.calendar-wrap { display: grid; gap: 12px; }
.calendar-title { justify-content: space-between; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.calendar > strong, .calendar > div { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; }
.calendar > strong { min-height: auto; background: #f8fafc; color: var(--muted); text-align: center; }
.calendar .current-day { background: #eef7ff; }
.calendar .outside-month { background: #fafafa; color: #aaa; }
.calendar div > span { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; }
.calendar div a, .undated a { display: block; width: 100%; border-radius: 5px; margin: 4px 0; padding: 5px; background: #eaf3ff; color: #174a7c; font-size: 12px; font-weight: 700; }
.calendar-task-tree { display: grid; gap: 2px; margin: 4px 0; }
.calendar-task-tree summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px; cursor: pointer; list-style: none; }
.calendar-task-tree summary a { margin: 0; }
.calendar-task-tree:not([open]) summary::before { margin-top: 5px; }
.subtask-calendar-link { margin-left: 14px !important; background: #f1f5f9 !important; color: #475569 !important; }

.drawer { position: fixed; top: 0; right: 0; z-index: 15; display: grid; width: min(560px, 100vw); height: 100vh; align-content: start; gap: 18px; overflow: auto; padding: 18px; border-radius: 0; }
.drawer header { display: flex; gap: 8px; align-items: center; }
.drawer header span { flex: 1; color: var(--muted); font-size: 13px; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.detail-grid > span { color: var(--muted); }
.quick-field { display: grid; gap: 6px; }
.quick-dates { grid-template-columns: 1fr 1fr auto; }
.quick-field button { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.comment { display: flex; gap: 10px; border-top: 1px solid var(--line); padding: 12px 0; }
.comment span:not(.avatar) { display: block; color: var(--muted); font-size: 12px; }
.comment-box { border: 1px dashed #b9c5d6; border-radius: 7px; padding: 12px; color: var(--muted); }
.checkbox-button { width: 18px; height: 18px; flex: 0 0 auto; border: 1px solid #b9c5d6; border-radius: 5px; background: #fff; }
.checkbox-button.checked { border-color: #0d8a55; background: #0d8a55; }
.checkbox-button.checked::after { content: ""; display: block; width: 8px; height: 4px; margin: 4px auto; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.inline-add-form, .comment-form { display: grid; gap: 8px; margin-top: 10px; }
.inline-add-form { grid-template-columns: minmax(0, 1fr) auto; }
.inline-add-form input, .comment-form textarea, .integration-row input { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--text); }
.comment-form textarea { min-height: 86px; resize: vertical; }
.dependency-add-form { align-items: start; }
.dependency-search-field { position: relative; min-width: 0; }
.dependency-suggestions { position: absolute; top: calc(100% + 5px); left: 0; z-index: 18; display: grid; width: min(420px, 100%); max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; padding: 5px; background: #fff; box-shadow: var(--shadow); }
.dependency-suggestions[hidden] { display: none; }
.dependency-suggestion { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; width: 100%; border: 0; border-radius: 5px; padding: 8px; background: transparent; color: var(--text); text-align: left; }
.dependency-suggestion:hover, .dependency-suggestion.is-active { background: var(--soft); }
.dependency-suggestion b { color: #37352f; font-size: 12px; line-height: 1.25; }
.dependency-suggestion span { overflow: hidden; color: #37352f; font-size: 13px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.dependency-suggestion em { grid-column: 2; overflow: hidden; color: var(--muted); font-size: 11px; font-style: normal; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.dependency-suggestion-empty { padding: 8px; color: var(--muted); font-size: 12px; }
.dependency-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dependency-list form { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; background: var(--soft); }
.dependency-list button { border: 0; background: transparent; color: var(--muted); font-weight: 800; }
.subtask-link { display: grid; grid-template-columns: 14px auto minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 7px; margin: 6px 0; padding: 8px; background: #fff; }
.subtask-link:hover { background: var(--soft); }
.subtask-link b { color: #37352f; }
.subtask-link em { border-radius: 999px; padding: 3px 7px; background: #eef2f7; color: #4b5565; font-size: 11px; font-style: normal; font-weight: 800; }

.document { max-width: 980px; padding: 28px; }
.doc-meta { gap: 14px; color: var(--muted); font-size: 13px; }
.lead { color: #34445c; font-size: 17px; }
.doc-block { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.document-form { display: grid; gap: 18px; }
.document-form label { display: grid; gap: 6px; }
.document-form label span, .document-actions span { color: var(--muted); font-size: 12px; font-weight: 700; }
.document-form input, .document-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; background: #fff; color: var(--text); }
.document-form textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.document-form input:focus, .document-form textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(47, 95, 159, .13); }
.document-title-field input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 4px 0 10px; color: #252525; font-size: 30px; font-weight: 700; line-height: 1.18; }
.document-title-field input:focus { box-shadow: none; }
.document-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.readonly-note { border: 1px solid #d9e4ef; border-radius: 7px; padding: 10px 12px; background: #f7fbff; color: #526171; font-size: 13px; font-weight: 700; }
pre { overflow: auto; border-radius: 7px; padding: 14px; background: #121826; color: #e6edf7; }
.embedded-db { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: #f8fafc; }
.embedded-db span { color: var(--muted); font-size: 13px; }
.slash-editor { position: relative; }
.slash-editor > button { border: 1px dashed #aebccc; border-radius: 7px; padding: 10px 12px; background: #fff; }
.slash-menu { position: absolute; z-index: 3; display: grid; width: 240px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #fff; box-shadow: var(--shadow); }
.slash-menu[hidden] { display: none; }
.slash-menu button { border: 0; border-radius: 6px; padding: 9px; background: transparent; text-align: left; }

.wiki-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 14px; }
.wiki-list a, .reports-list button { display: grid; gap: 4px; width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; text-align: left; }
.wiki-list small, .toc a, .toc span { color: var(--muted); }
.wiki-page { display: grid; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.toc { position: sticky; top: 82px; align-self: start; }
.toc a, .toc span { display: block; margin-bottom: 8px; }
.help-grid, .role-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 12px; }
.shortcuts { flex-wrap: wrap; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.reports { max-width: 1080px; }
.reports-head { align-items: flex-start; }
.eyebrow { display: block; margin-bottom: 6px; color: #a5aebb; font-size: 13px; font-weight: 500; }
.reports-head p { max-width: 660px; margin-top: 6px; color: #5b6776; font-size: 14px; }
.report-metrics { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.report-metrics .metric { border-color: #e6eaef; border-radius: 11px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(20,30,50,.04); }
.report-metrics .metric span { color: #8a94a3; font-size: 12px; font-weight: 500; }
.report-metrics .metric strong { margin-top: 4px; font-size: 24px; line-height: 1.1; }
.reports-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; align-items: start; }
.report-create { border-color: #e6eaef; border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(20,30,50,.04); }
.report-form { display: grid; gap: 15px; align-content: start; }
.report-form-head { display: flex; align-items: center; gap: 11px; margin-bottom: 1px; }
.report-form-head h2 { margin: 0; color: #1f2733; font-size: 15px; font-weight: 650; }
.report-form-head p { margin-top: 2px; color: #8a94a3; font-size: 12.5px; }
.report-mark { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: #e8f0fe; color: #2f6df0; font-size: 18px; font-weight: 650; line-height: 1; }
.choice-field { display: grid; gap: 7px; margin: 0; border: 0; padding: 0; }
.choice-field legend, .report-input > span { margin-bottom: 0; color: #8a94a3; font-size: 12px; font-weight: 650; }
.segmented-options, .wrapped-options { display: flex; gap: 6px; }
.wrapped-options { flex-wrap: wrap; }
.choice-chip { display: inline-flex; min-width: 0; }
.segmented-options .choice-chip { flex: 1; }
.choice-chip input { position: absolute; width: 1px !important; height: 1px !important; margin: 0; opacity: 0; pointer-events: none; }
.choice-chip span { display: inline-flex; min-height: 32px; width: 100%; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dde3eb; border-radius: 7px; padding: 6px 10px; background: #fff; color: #5b6776; font-size: 12px; font-weight: 600; text-align: center; transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease; }
.choice-chip b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 5px; font-size: 11px; font-style: normal; line-height: 1; }
.choice-chip:hover span { border-color: #cfd8e3; background: #f8fafc; }
.choice-chip input:checked + span { border-color: #2f6df0; background: var(--chip-bg, #e8f0fe); color: var(--chip-color, #2f6df0); box-shadow: 0 0 0 3px rgba(47,109,240,.10); }
.choice-chip input:checked + span b { background: #fff !important; }
.report-input { display: grid; gap: 7px; }
.report-form input, .report-form textarea { width: 100%; border: 1px solid #dde3eb; border-radius: 8px; padding: 9px 11px; background: #fff; color: #1f2733; outline: none; font-size: 13.5px; }
.report-form input:focus, .report-form textarea:focus { border-color: #2f6df0; box-shadow: 0 0 0 3px #e8f0fe; }
.report-form textarea { min-height: 118px; resize: vertical; }
.report-submit { width: 100%; min-height: 38px; border-radius: 9px; font-size: 13.5px; font-weight: 650; }
.reports-stream { display: grid; gap: 11px; }
.reports-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1px; }
.reports-list-head h2 { margin: 0; color: #1f2733; font-size: 15px; font-weight: 650; }
.reports-list-head span { color: #8a94a3; font-size: 12.5px; }
.reports-stream form { margin: 0; }
.report-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; width: 100%; border: 1px solid #e6eaef; border-radius: 11px; padding: 15px 17px; background: #fff; box-shadow: 0 1px 2px rgba(20,30,50,.04); color: inherit; text-align: left; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease; }
.report-card:hover { border-color: #c5d4ea; background: #fbfcfd; box-shadow: 0 3px 9px rgba(20,30,50,.08); }
.report-type-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; font-size: 15px; font-weight: 750; line-height: 1; }
.report-content { display: grid; min-width: 0; gap: 3px; }
.report-content strong { overflow: hidden; color: #1f2733; font-size: 14px; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; }
.report-description { color: #5b6776; font-size: 13px; line-height: 1.55; }
.report-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
.report-tags em { display: inline-flex; min-height: 21px; align-items: center; border-radius: 6px; padding: 3px 9px; background: #eef1f5; color: #5b6776; font-size: 11.5px; font-style: normal; font-weight: 600; line-height: 1; }
.report-side { display: flex; min-width: 142px; flex-direction: column; align-items: flex-end; gap: 12px; }
.report-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 12px; font-weight: 700; }
.report-status i { display: block; width: 6px; height: 6px; border-radius: 50%; }
.report-author { display: inline-flex; align-items: center; gap: 7px; color: #8a94a3; font-size: 12px; }
.empty-state { border: 1px dashed #cfd8e3; border-radius: 11px; padding: 22px; background: #fbfcfd; text-align: center; }
.empty-state h2 { margin-bottom: 4px; }
.member-create-form { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)) auto; gap: 10px; align-items: end; }
.member-create-form label, .member-row label { display: grid; gap: 5px; }
.member-create-form label span, .member-row label span, .project-checks legend { color: var(--muted); font-size: 12px; font-weight: 700; }
.member-create-form input, .member-create-form select, .member-row select { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--text); }
.member-create-form > .project-checks { grid-column: 1 / -1; }
.member-create-form .primary { min-width: 132px; justify-self: start; }
.member-list { display: grid; gap: 8px; }
.member-row { display: grid; grid-template-columns: minmax(210px, 1.2fr) minmax(150px, .7fr) minmax(130px, .6fr) minmax(260px, 1.3fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fff; }
.member-person { display: flex; min-width: 0; gap: 9px; align-items: center; }
.member-person div { display: grid; min-width: 0; gap: 2px; }
.member-person strong, .member-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-person small, .member-meta span { color: var(--muted); font-size: 12px; }
.project-checks { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; border: 0; padding: 0; }
.project-checks legend { width: 100%; padding: 0; }
.project-checks label { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; background: var(--soft); font-size: 12px; font-weight: 650; }
.project-checks input { width: 14px; height: 14px; margin: 0; }
.member-meta { display: grid; justify-items: end; gap: 6px; }
.role-permissions { display: grid; gap: 14px; }
.permission-grid { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(5, minmax(120px, 1fr)); gap: 8px; align-items: center; overflow-x: auto; }
.permission-grid > strong, .permission-grid > b { min-height: 34px; display: flex; align-items: center; }
.permission-grid label { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; font-size: 12px; font-weight: 700; }
.integration-list { display: grid; gap: 10px; }
.integration-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(260px, .9fr) auto; gap: 12px; align-items: end; }
.integration-row h2 { margin-bottom: 4px; }
.integration-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.integration-row label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.switch-row { align-content: center; justify-items: center; }
.switch-row input { width: 18px; height: 18px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; align-items: start; justify-content: center; padding-top: 8vh; background: rgba(15,23,42,.42); }
.search-modal { display: grid; gap: 12px; width: min(680px, calc(100vw - 32px)); padding: 12px; }
.search-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 8px; }
.search-box input { min-height: 32px; border: 0; outline: 0; }
.search-modal section { display: grid; gap: 4px; }
.search-modal section a { border-radius: 6px; padding: 9px; background: #f8fafc; }

.share-page { min-height: 100vh; background: #f6f8fb; }
.share-shell { display: grid; gap: 18px; width: min(1280px, calc(100vw - 32px)); margin: 0 auto; padding: 28px 0; }
.share-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.share-head span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.share-head p { margin-top: 5px; }
.share-head form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.share-head label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.share-head input { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
.shared-timeline { box-shadow: var(--shadow); }

[data-list-task].is-dragging { opacity: .45; }

.density-compact { --density-gap: 7px; --density-inner: 7px; --density-pad: 9px; --density-row: 8px; }
.density-comfortable { --density-gap: 10px; --density-inner: 10px; --density-pad: 12px; --density-row: 11px; }
.density-spacious { --density-gap: 14px; --density-inner: 14px; --density-pad: 16px; --density-row: 15px; }

@media (max-width: 1180px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .metric-grid, .help-grid, .role-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .member-create-form, .member-row { grid-template-columns: 1fr 1fr; }
  .integration-row { grid-template-columns: 1fr 1fr; }
  .member-row .project-checks, .member-meta { grid-column: 1 / -1; }
  .two-col, .wiki-grid, .reports-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}

@media (max-width: 780px) {
  .login-screen { align-items: stretch; padding: 14px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 220px; padding: 24px; }
  .login-intro h1 { font-size: 28px; }
  .login-panel { min-height: auto; padding: 24px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-user { max-width: calc(100vw - 128px); }
  .workspace { padding: 16px; }
  .metric-grid, .help-grid, .role-grid { grid-template-columns: 1fr; }
  .page-head, .task-toolbar { align-items: stretch; flex-direction: column; }
  .member-create-form, .member-row { grid-template-columns: 1fr; }
  .integration-row, .inline-add-form { grid-template-columns: 1fr; }
  .member-create-form .primary, .member-meta { width: 100%; justify-items: stretch; }
  .project-row { grid-template-columns: 28px 1fr; }
  .project-row .progress, .project-row b:last-child { grid-column: 1 / -1; }
  .calendar { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .embedded-db { grid-template-columns: 1fr; }
  .report-metrics { grid-template-columns: 1fr; }
  .report-card { grid-template-columns: 30px minmax(0, 1fr); }
  .report-side { grid-column: 2; min-width: 0; align-items: flex-start; }
  .reports-list-head { align-items: flex-start; flex-direction: column; }
}
