:root {
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --ink: #202a38;
  --muted: #58677e;
  --line: #d6deeb;
  --line-soft: #e8edf4;
  --blue: #2f55c7;
  --blue-hover: #2344ae;
  --blue-soft: #eaf0ff;
  --sidebar: #eef2f9;
  --danger: #b02a3b;
  --danger-soft: #fff2f3;
  --green: #26704e;
  --focus: #718ee3;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, input, textarea, select { color: inherit; }
button { border: 0; background: none; }
button:disabled, select:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
input, select { min-height: 42px; padding: 9px 12px; }
select { padding-right: 30px; }
textarea { padding: 16px; line-height: 1.65; resize: vertical; }
input::placeholder, textarea::placeholder { color: #768296; opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[readonly], textarea[readonly] { color: var(--muted); background: #f9fafc; }
a { color: var(--blue); text-underline-offset: 3px; }
svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
button, a { touch-action: manipulation; }
::selection { background: #dce5ff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--surface); border: 1px solid var(--blue); border-radius: 6px; padding: 10px 16px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
kbd { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1.3; font-family: inherit; min-width: 20px; min-height: 19px; padding: 1px 4px; border: 1px solid currentColor; border-radius: 4px; opacity: .65; white-space: nowrap; }
.button { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: 14px; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.button svg { width: 18px; height: 18px; }
.button-primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 1px 2px #20346614; }
.button-primary:hover:not(:disabled) { background: var(--blue-hover); border-color: var(--blue-hover); }
.button-primary kbd { margin-left: 8px; border-color: #ffffff6b; opacity: .85; font-size: 10px; }
.button-secondary { border-color: var(--line); background: var(--surface); }
.button-secondary:hover:not(:disabled) { background: #f2f5fb; border-color: #b5c2d7; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; gap: 7px; }
.button-danger { background: var(--danger); border-color: var(--danger); color: white; }
.button-danger:hover:not(:disabled) { background: #922030; }
.button-danger-quiet { color: var(--danger); padding-inline: 9px; }
.button-danger-quiet:hover:not(:disabled) { background: var(--danger-soft); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 6px; color: var(--muted); }
.icon-button:hover:not(:disabled) { background: #e4eaf4; color: var(--ink); }
.text-button { padding: 4px 0; color: var(--blue); font-weight: 600; font-size: 13px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 38px; border-radius: 10px; background: var(--blue); color: white; }
.brand-mark svg { width: 30px; height: 30px; }

.access-screen { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; }
.access-card { width: min(440px, 100%); padding: 48px 40px 32px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 12px 42px #20346608; text-align: center; }
.brand-mark-large { width: 52px; height: 56px; border-radius: 14px; margin: 0 auto 27px; }
.brand-mark-large svg { width: 42px; height: 42px; }
.access-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.5px; margin-bottom: 12px; }
.access-card > p { color: var(--muted); max-width: 34ch; margin-inline: auto; line-height: 1.7; }
.access-card .button { margin-top: 24px; }
.access-card .access-error { color: var(--danger); font-size: 13px; margin-top: 18px; overflow-wrap: anywhere; }
.access-private { display: flex; gap: 7px; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 24px; margin-top: 36px; }
.access-private svg { width: 14px; height: 14px; }
.noscript-message { max-width: 40ch; color: var(--danger); }

.workspace { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100dvh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 30px 18px 22px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; gap: 11px; align-items: center; padding-left: 7px; }
.brand-title { display: block; font-size: 18px; letter-spacing: -.3px; font-weight: 700; line-height: 1.4; }
.brand-subtitle { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.project-picker { margin-top: 45px; padding: 0 5px; }
.project-picker label { color: var(--muted); font-size: 12px; font-weight: 600; display: block; margin: 0 0 8px 3px; }
.project-control { display: flex; gap: 4px; align-items: center; }
.project-control select { width: 100%; background-color: var(--surface); font-weight: 600; font-size: 13px; min-height: 39px; padding-left: 10px; }
.project-control .icon-button { width: 29px; height: 36px; }
.project-control .icon-button svg { width: 17px; height: 17px; }
.main-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 28px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; border-radius: 7px; padding: 10px 13px; font-size: 14px; text-align: left; color: var(--muted); font-weight: 500; border: 1px solid transparent; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: #e3e9f4; }
.nav-item.is-current { background: var(--surface); color: var(--blue); border-color: #d9e2f2; box-shadow: 0 1px 2px #273a6210; font-weight: 650; }
.sidebar-bottom { margin-top: auto; padding: 24px 13px 0; }
.sidebar-bottom p { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.sidebar-bottom p svg { width: 13px; height: 13px; }
.sidebar-bottom .text-button { color: var(--muted); font-weight: 500; margin-top: 5px; margin-left: 20px; }
.main-content { min-width: 0; padding: 44px clamp(24px, 4vw, 64px) 20px; max-width: 1670px; width: 100%; }
.main-content:focus { outline: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 35px; }
.page-header h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.65px; font-weight: 650; }
.page-header p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 11px; }
.refresh-button { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 42px; }
.refresh-button.is-loading svg { animation: spin 1s linear infinite; }
.task-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.status-filters { display: flex; align-items: center; gap: 3px; margin-left: -8px; }
.filter { min-height: 38px; padding: 8px 11px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.filter:hover { background: #eaf0f7; }
.filter.is-selected { color: var(--blue); background: var(--blue-soft); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-todo { border: 1.5px solid #7f8da0; }
.dot-progress { border: 1.5px solid #4f68c4; background: linear-gradient(90deg,#4f68c4 50%,transparent 50%); }
.dot-done { border: 1.5px solid var(--green); background: var(--green); }
.search-field { position: relative; display: flex; align-items: center; width: 256px; min-width: 190px; }
.search-field > [data-icon] { position: absolute; left: 12px; color: #758398; pointer-events: none; }
.search-field > [data-icon] svg { width: 17px; height: 17px; }
.search-field input { padding: 8px 38px 8px 38px; min-height: 38px; width: 100%; font-size: 13px; background: var(--surface); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field > kbd { position: absolute; right: 11px; color: #7f8da0; pointer-events: none; min-width: 17px; font-size: 10px; min-height: 18px; }
.search-clear { position: absolute; right: 4px; width: 30px; height: 30px; }
.search-clear svg { width: 15px; height: 15px; }
.draft-notice { display: flex; gap: 10px; align-items: center; color: #6b5a26; background: #fffbeb; border: 1px solid #e9dfa8; border-radius: 7px; margin: 0 0 15px; padding: 10px 13px; font-size: 12px; }
.draft-notice > [data-icon] svg { width: 16px; height: 16px; }
#draft-links { display: flex; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.draft-link { color: #6b5a26; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; padding: 2px 0; max-width: 32ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.draft-notice-hint { margin-left: auto; white-space: nowrap; opacity: .85; }
.notice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); padding: 12px 14px; border-radius: 7px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.notice > [data-icon] { margin-top: 1px; }
.notice svg { width: 18px; height: 18px; }
.notice p { flex: 1; min-width: 0; }
.notice-error { background: var(--danger-soft); border-color: #efcbd1; color: #992437; }
.list-error { margin: 0 0 16px; align-items: center; }
.list-error .text-button { color: var(--danger); margin-left: auto; flex-shrink: 0; }
.notice-muted { background: #f0f3f9; color: var(--muted); }
.task-list { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 350px; overflow: hidden; }
.loading-state { min-height: 350px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d6def0; border-top-color: var(--blue); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 24px; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid #e1e8f6; color: #5b78c9; border-radius: 15px; background: #f1f5fe; margin-bottom: 20px; }
.empty-icon svg { width: 27px; height: 27px; stroke-width: 1.4; }
.empty-state h2 { font-size: 18px; font-weight: 600; letter-spacing: -.15px; }
.empty-state p { margin-top: 8px; max-width: 45ch; color: var(--muted); font-size: 13px; line-height: 1.65; }
.empty-state .button { margin-top: 24px; }
.tasks-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.tasks-table thead { background: #fafbfd; border-bottom: 1px solid var(--line); }
.tasks-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 12px 18px; }
.tasks-table th:first-child { width: auto; padding-left: 23px; }
.tasks-table th:nth-child(2) { width: 153px; }
.tasks-table th:nth-child(3), .tasks-table th:nth-child(4) { width: 106px; }
.tasks-table td { padding: 17px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tasks-table td:first-child { padding-left: 23px; padding-right: 12px; }
.tasks-table tr:last-child td { border-bottom: 0; }
.tasks-table tbody tr { transition: background-color .1s; }
.tasks-table tbody tr:hover, .tasks-table tbody tr:focus-within { background: #f8faff; }
.task-title-button { text-align: left; padding: 0; width: 100%; min-width: 0; display: block; color: var(--ink); }
.task-title-button:hover .row-title { color: var(--blue); }
.row-title { display: block; font-weight: 600; font-size: 14px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-description { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.row-details { display: flex; align-items: center; gap: 9px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.row-attachments { display: inline-flex; align-items: center; gap: 3px; }
.row-attachments svg { width: 13px; height: 13px; }
.row-draft { color: #8b6a0d; background: #fff5cf; border-radius: 3px; padding: 0 5px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; line-height: 1.6; color: #5c687c; white-space: nowrap; padding: 4px 8px; border: 1px solid #e2e7ef; background: #f8fafc; border-radius: 5px; }
.status-badge .status-dot { width: 9px; height: 9px; }
.status-in_progress { color: #3c54a7; border-color: #dbe3fc; background: #f0f4ff; }
.status-done { color: var(--green); border-color: #d7e8df; background: #f0f8f4; }
.row-date { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-date time { display: block; }
.row-date .date-time { display: block; color: #7d899b; font-size: 10px; margin-top: 2px; }
.list-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; min-height: 38px; }
.list-bottom p { color: var(--muted); font-size: 11px; }
.workspace-footer { display: flex; gap: 24px; align-items: center; justify-content: flex-end; padding-top: 25px; color: #7b879a; font-size: 10px; }
.workspace-footer span { display: flex; align-items: center; gap: 5px; }
.workspace-footer kbd { min-width: 16px; min-height: 16px; font-size: 9px; padding-inline: 3px; border-color: #b6c1d1; }

dialog { color: var(--ink); border: 1px solid #cbd5e6; border-radius: 13px; padding: 0; background: var(--surface); box-shadow: 0 24px 100px #1d2c4b35; }
dialog::backdrop { background: #1d2c4b63; backdrop-filter: blur(2px); }
.task-dialog { width: min(1040px, calc(100vw - 64px)); max-width: none; max-height: calc(100dvh - 64px); }
.task-dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 66px); width: 100%; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 28px 18px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.dialog-header h2 { font-size: 18px; letter-spacing: -.25px; font-weight: 650; }
.save-state { font-size: 11px; color: var(--muted); margin-top: 4px; }
.save-state.is-dirty { color: #886817; }
.save-state.is-saved { color: var(--green); }
.editor-notices { flex-shrink: 0; padding: 0 28px; max-height: 30dvh; overflow: auto; }
.editor-notices .notice { margin-top: 15px; }
.notice-conflict { background: #fff9e9; border-color: #eadba7; color: #6c571c; flex-wrap: wrap; gap: 10px 20px; }
.notice-conflict strong { font-weight: 650; }
.notice-conflict p { font-size: 12px; margin-top: 3px; }
.conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice-conflict .button { color: #6c571c; border-color: #e2d19a; background: #fffdf7; }
.editor-body { display: grid; grid-template-columns: minmax(0,1fr) 192px; gap: 30px; padding: 27px 28px 30px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.editor-main { min-width: 0; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field > label, .field-label { font-size: 12px; font-weight: 650; }
#task-title { font-size: 16px; font-weight: 550; padding: 11px 13px; height: 46px; }
.field-error { color: var(--danger); font-size: 12px; line-height: 1.5; margin-top: 5px; }
.description-section { margin-top: 25px; }
.description-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.editor-tabs { display: flex; padding: 3px; border-radius: 6px; background: #edf1f7; }
.editor-tabs button { padding: 5px 10px; font-size: 11px; font-weight: 600; min-height: 28px; color: var(--muted); border-radius: 4px; }
.editor-tabs [aria-selected="true"] { background: white; color: var(--ink); box-shadow: 0 1px 3px #25375717; }
.edit-panel { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.edit-panel:focus-within { border-color: var(--blue); }
.format-tools { display: flex; gap: 2px; align-items: center; background: #fbfcfe; padding: 6px 7px; border-bottom: 1px solid var(--line-soft); }
.format-tools button { width: 30px; height: 28px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.format-tools button:hover:not(:disabled) { color: var(--ink); background: #e9eef7; }
.format-tools button svg { width: 15px; height: 15px; }
.format-tools > span { margin-left: auto; color: #758398; font-size: 10px; padding-right: 6px; }
#task-description { width: 100%; border: none; border-radius: 0; display: block; min-height: 270px; font-size: 13px; }
#task-description:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.description-hint { color: #748196; font-size: 10px; margin-top: 8px; }
.markdown-preview { padding: 18px 20px; border: 1px solid var(--line); border-radius: 7px; min-height: 315px; overflow-wrap: anywhere; background: white; font-size: 13px; line-height: 1.75; }
.markdown-preview > :first-child { margin-top: 0; }
.markdown-preview > :last-child { margin-bottom: 0; }
.markdown-preview p, .markdown-preview ul, .markdown-preview ol, .markdown-preview blockquote, .markdown-preview pre { margin: 0 0 14px; }
.markdown-preview ul, .markdown-preview ol { padding-left: 24px; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { font-weight: 650; line-height: 1.35; margin: 24px 0 12px; letter-spacing: -.2px; }
.markdown-preview h1 { font-size: 24px; }
.markdown-preview h2 { font-size: 20px; }
.markdown-preview h3 { font-size: 17px; }
.markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { font-size: 14px; }
.markdown-preview blockquote { border-left: 3px solid #b5c4ed; padding-left: 15px; color: var(--muted); }
.markdown-preview blockquote p:last-child { margin-bottom: 0; }
.markdown-preview code { background: #eef2f8; padding: 2px 5px; border-radius: 4px; font: .92em/1.5 Consolas, "SFMono-Regular", monospace; }
.markdown-preview pre { padding: 14px; border: 1px solid var(--line-soft); border-radius: 6px; background: #f5f7fb; overflow-x: auto; }
.markdown-preview pre code { padding: 0; background: none; white-space: pre; overflow-wrap: normal; }
.markdown-preview hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.markdown-preview img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin-block: 12px; }
.markdown-preview .task-check { margin-right: 8px; font-size: 14px; }
.markdown-preview .preview-empty { color: #7d899b; font-style: italic; }
.external-image-link { font-size: 12px; }
.editor-details { border-left: 1px solid var(--line-soft); padding-left: 23px; }
.editor-details select { width: 100%; font-size: 12px; padding: 9px 26px 9px 10px; min-height: 40px; }
.task-dates { margin: 29px 0 0; font-size: 11px; }
.task-dates > div { margin-bottom: 21px; }
.task-dates dt { color: #7a8799; margin-bottom: 5px; font-size: 10px; }
.task-dates dd { margin: 0; line-height: 1.8; color: var(--muted); }
.editor-draft-hint { padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 10px; line-height: 1.7; color: #8b6a0d; }
.editor-draft-hint [data-icon] { float: left; margin: 1px 6px 0 0; }
.editor-draft-hint svg { width: 13px; height: 13px; }
.attachments-section { margin-top: 28px; }
.attachments-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.attachments-heading h3 { font-size: 12px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
#attachment-count { font-size: 10px; font-weight: 400; color: #7a8799; }
.attachments-heading p { font-size: 10px; color: #748196; margin-top: 4px; }
.attachment-gallery { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.attachment-item { position: relative; min-width: 0; }
.attachment-preview { display: block; padding: 0; width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #f0f3f8; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-preview:hover { border-color: var(--blue); }
.attachment-item figcaption { padding-top: 5px; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--muted); }
.attachment-item figure { margin: 0; }
.attachment-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; background: #ffffffed; color: var(--muted); border: 1px solid #dbe3ef; border-radius: 5px; box-shadow: 0 1px 2px #20346612; }
.attachment-remove:hover { color: var(--danger); background: var(--danger-soft); }
.attachment-remove svg { width: 13px; height: 13px; }
.image-unavailable { display: flex; gap: 7px; align-items: center; justify-content: center; height: 100%; padding: 8px; color: var(--muted); font-size: 10px; }
.image-unavailable svg { width: 20px; height: 20px; }
.upload-status { display: flex; align-items: center; gap: 8px; padding: 8px 0 15px; color: var(--muted); font-size: 12px; }
.upload-status .spinner { width: 14px; height: 14px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 28px; background: #fbfcfe; border-top: 1px solid var(--line-soft); flex-shrink: 0; }
.dialog-footer-actions { margin-left: auto; display: flex; gap: 10px; }
.dialog-footer .button { min-height: 40px; }
.small-dialog { width: min(440px, calc(100vw - 36px)); max-width: none; max-height: calc(100dvh - 36px); }
.small-dialog .dialog-header { padding: 18px 23px; }
.small-dialog-body { padding: 26px 23px; }
.small-dialog .dialog-footer { padding: 16px 23px; justify-content: flex-end; }
.small-dialog .form-field input { width: 100%; font-size: 14px; }
.decision-dialog { max-width: 440px; }
.decision-dialog h2 { font-size: 19px; line-height: 1.4; letter-spacing: -.2px; margin-bottom: 10px; }
.decision-dialog p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.decision-icon { width: 41px; height: 41px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; margin-bottom: 17px; }
.decision-actions { display: flex; flex-direction: column; gap: 9px; padding: 0 23px 23px; }
.decision-actions .button { width: 100%; white-space: normal; }
.copy-fallback h2 { font-size: 18px; margin-bottom: 10px; }
.copy-fallback p { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.copy-fallback textarea { width: 100%; font-size: 13px; margin-bottom: 16px; }
.image-dialog { width: min(1200px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); background: #f7f9fc; }
.image-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 13px 18px 13px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.image-header h2 { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.image-stage { min-height: 160px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 15px 5px; }
.image-stage > img { display: block; min-width: 0; max-width: calc(100% - 112px); max-height: calc(100dvh - 210px); object-fit: contain; border-radius: 4px; }
.image-arrow { width: 40px; height: 48px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; flex-shrink: 0; }
.image-arrow:hover:not(:disabled) { background: #e5ebf5; color: var(--blue); }
.image-position { text-align: center; color: var(--muted); font-size: 11px; padding: 14px 20px 18px; }
.toast-region { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; justify-content: center; width: min(540px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 12px 17px; border-radius: 8px; color: #fff; background: #26364f; box-shadow: 0 5px 20px #2034662e; font-size: 13px; line-height: 1.5; }
.toast svg { width: 16px; height: 16px; }

@media (min-width: 1500px) { .main-content { padding-top: 52px; } .page-header { margin-bottom: 42px; } .task-list { min-height: 420px; } .loading-state, .empty-state { min-height: 420px; } }
@media (max-width: 1170px) { .workspace { grid-template-columns: 208px minmax(0,1fr); } .main-content { padding-inline: 28px; } .sidebar { padding-inline: 13px; } .brand-subtitle { font-size: 9px; } .tasks-table .created-column, .tasks-table td.created-column { display: none; } .tasks-table th:nth-child(4) { width: 102px; } .task-controls { gap: 13px; } .search-field { width: 100%; } .status-filters { margin-left: -7px; } .editor-body { gap: 23px; grid-template-columns: minmax(0,1fr) 168px; } .editor-details { padding-left: 19px; } }
@media (max-width: 800px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 17px 22px; padding: 18px 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; gap: 9px; }
  .brand-mark { width: 30px; height: 33px; border-radius: 8px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand-title { font-size: 16px; }
  .brand-subtitle { display: none; }
  .project-picker { margin: 0; padding: 0; width: 205px; }
  .project-picker label { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
  .project-control select { min-height: 35px; font-size: 12px; }
  .main-nav { flex-direction: row; grid-column: 1; margin: 0; gap: 14px; }
  .nav-item { width: auto; font-size: 12px; min-height: 39px; border-radius: 0; padding: 7px 0 11px; gap: 7px; border: 0; border-bottom: 2px solid transparent; }
  .nav-item.is-current { border-color: var(--blue); background: none; box-shadow: none; }
  .nav-item:hover { background: none; color: var(--blue); }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-bottom { grid-column: 2; grid-row: 2; margin: 0; padding: 0 3px; display: flex; gap: 14px; align-items: flex-start; justify-content: flex-end; }
  .sidebar-bottom p { padding-top: 8px; font-size: 10px; }
  .sidebar-bottom .text-button { margin: 0; padding-top: 7px; font-size: 11px; }
  .main-content { padding: 30px 24px 22px; }
  .page-header { margin-bottom: 25px; gap: 16px; }
  .page-header h1 { font-size: 27px; }
  .task-dialog { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
  .task-dialog > form { max-height: calc(100dvh - 34px); }
  .editor-body { grid-template-columns: minmax(0,1fr); gap: 24px; padding: 23px; }
  .editor-details { grid-row: 1; border-left: 0; padding-left: 0; display: flex; gap: 22px; align-items: flex-start; }
  .editor-details > .form-field { width: 170px; flex-shrink: 0; }
  .task-dates { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 25px; font-size: 10px; }
  .task-dates > div { margin: 0; padding-top: 1px; }
  .task-dates dt { margin-bottom: 6px; }
  .editor-draft-hint { display: none !important; }
  .dialog-header { padding: 18px 23px 16px; }
  .dialog-footer { padding: 15px 23px; }
  .editor-notices { padding-inline: 23px; }
  .attachment-gallery { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .workspace-footer { justify-content: flex-start; gap: 17px; }
}
@media (max-width: 540px) {
  .sidebar { padding: 15px 17px 0; gap: 14px; }
  .project-picker { width: 178px; }
  .sidebar-bottom p { display: none; }
  .main-content { padding: 26px 17px 20px; }
  .page-header { align-items: flex-start; gap: 10px; margin-bottom: 24px; }
  .page-header h1 { font-size: 25px; }
  .page-header p { font-size: 11px; margin-top: 6px; max-width: 23ch; }
  .header-actions { gap: 7px; padding-top: 2px; }
  .header-actions .button { padding: 9px 11px; font-size: 12px; min-height: 38px; gap: 6px; }
  .header-actions .button svg { width: 16px; height: 16px; }
  .header-actions .button kbd { display: none; }
  .refresh-button { width: 34px; height: 38px; }
  .refresh-button svg { width: 17px; height: 17px; }
  .task-controls { gap: 13px; margin-bottom: 15px; }
  .status-filters { width: calc(100% + 10px); justify-content: space-between; gap: 0; margin: 0 -5px; }
  .filter { padding: 8px 7px; font-size: 10px; min-height: 35px; gap: 5px; }
  .filter .status-dot { width: 8px; height: 8px; }
  .search-field input { min-height: 41px; }
  .task-list { border-radius: 8px; min-height: 335px; }
  .empty-state, .loading-state { min-height: 335px; }
  .empty-state { padding-inline: 20px; }
  .empty-state p { font-size: 12px; }
  .tasks-table { display: block; }
  .tasks-table thead { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
  .tasks-table tbody { display: block; }
  .tasks-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 16px; gap: 11px 8px; border-bottom: 1px solid var(--line-soft); }
  .tasks-table tbody tr:last-child { border-bottom: 0; }
  .tasks-table td, .tasks-table td:first-child { display: block; border: 0; padding: 0; }
  .tasks-table td:first-child { grid-column: 1/-1; }
  .tasks-table td.created-column { display: none; }
  .tasks-table td:last-child { display: flex; align-items: center; justify-content: flex-end; font-size: 10px; }
  .row-title { font-size: 14px; }
  .row-description { font-size: 11px; }
  .row-date .date-time { display: inline; font-size: 10px; margin-left: 5px; }
  .row-date time { display: inline; }
  .status-badge { padding: 2px 7px; font-size: 10px; }
  .row-details { margin-top: 7px; }
  .draft-notice-hint { display: none; }
  .draft-notice { padding: 9px 11px; font-size: 11px; }
  .draft-link { max-width: 30ch; text-align: left; }
  .workspace-footer { display: none; }
  .list-bottom p { font-size: 10px; }
  .list-bottom .button { min-height: 34px; font-size: 11px; padding: 7px 11px; }
  .task-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .task-dialog > form { height: 100dvh; max-height: 100dvh; }
  .dialog-header { padding: 16px 17px 14px; }
  .dialog-header h2 { font-size: 17px; }
  .dialog-header .icon-button { width: 32px; height: 32px; }
  .editor-body { padding: 20px 17px 25px; gap: 20px; }
  .editor-details { gap: 14px; flex-wrap: wrap; }
  .editor-details > .form-field { width: 146px; }
  .task-dates { gap: 10px 15px; flex: 1; font-size: 10px; }
  .task-dates dt { font-size: 9px; margin-bottom: 3px; }
  .task-dates dd { line-height: 1.5; }
  .task-dates > div { padding-top: 3px; }
  .description-section { margin-top: 22px; }
  .description-heading { gap: 12px; }
  #task-description { min-height: 250px; font-size: 14px; }
  .description-hint { font-size: 9px; }
  .attachments-heading { gap: 10px; }
  .attachments-heading .button { font-size: 10px; padding-inline: 9px; }
  .attachments-heading p { font-size: 9px; max-width: 28ch; }
  .attachment-gallery { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .dialog-footer { padding: 13px 17px max(13px, env(safe-area-inset-bottom)); gap: 7px; }
  .dialog-footer .button { min-height: 39px; font-size: 12px; padding: 9px 12px; gap: 6px; }
  .dialog-footer .button-danger-quiet { padding-inline: 0; font-size: 11px; }
  .dialog-footer .button-danger-quiet svg { width: 15px; height: 15px; }
  .dialog-footer-actions { gap: 7px; }
  .dialog-footer kbd { display: none; }
  .editor-notices { padding-inline: 17px; }
  .notice { padding: 10px 11px; font-size: 12px; }
  .notice-conflict p { font-size: 11px; }
  .conflict-actions .button { font-size: 10px; min-height: 31px; padding-inline: 9px; }
  .image-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; border-inline: 0; }
  .image-header { padding: 10px 12px; gap: 8px; }
  .image-actions { gap: 5px; }
  .image-actions .button { font-size: 10px; padding: 6px 8px; min-height: 31px; }
  .image-stage { gap: 3px; padding: 14px 3px 0; }
  .image-stage > img { max-width: calc(100% - 66px); max-height: calc(100dvh - 160px); }
  .image-arrow { width: 30px; }
  .image-arrow svg { width: 20px; height: 20px; }
  .access-card { padding: 38px 24px 26px; }
  .access-card h1 { font-size: 23px; }
  .access-card > p { font-size: 14px; }
  input, select, #task-title { font-size: 16px; }
  #task-description { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
