@font-face { font-family: Inter; src: url('../fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url('../fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url('../fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-secondary: #f4f4f2;
  --border: #e6e6e2;
  --border-strong: #d0d0cb;
  --text: #2c2b28;
  --muted: #7c7a74;
  --danger: #b42318;
  --selected: #ededea;
  --page-gutter: 56px;
  --system-bar-height: 46px;
  --icon: #6f6e69;
  --c-planned: #5b7ea3;
  --c-progress: #b88945;
  --c-done: #5a8f66;
  --c-danger: #c45c52;
  --c-accent: #5f8a7a;
  --c-file: #6d7f94;
  --c-link: #5a7ea8;
  --c-key: #a8894a;
  --c-edit: #76808c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.55 Inter, sans-serif; overflow-x: clip; max-width: 100%; }
button, input, textarea, select { font: inherit; border-radius: 4px; color: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover:not(:disabled), .button:hover { background: var(--surface-secondary); border-color: var(--border-strong); }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--text); color: white; border-color: var(--text); }
button.primary:hover:not(:disabled) { background: #45433f; }
button.primary .icon { background-color: #fff; }
button.primary img { filter: invert(1); }
button.quiet { border-color: transparent; background: transparent; }
button.icon-button { width: 30px; height: 30px; padding: 6px; }
.danger { color: var(--danger); }
.danger .icon { background-color: var(--c-danger); }
input, textarea, select { width: 100%; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border-strong); outline: none; }
textarea { min-height: 82px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #8a8882; }
label { display: block; font-size: 12px; font-weight: 500; margin: 0 0 6px; }
:focus-visible { outline: 2px solid #8a9480; outline-offset: 3px; }
.icon, img.icon, button img, .button img {
  width: 16px; height: 16px; flex-shrink: 0; display: inline-block;
}
span.icon {
  background-color: var(--icon-color, var(--icon));
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}
.icon-calendar-blank { --icon-color: var(--c-planned); }
.icon-clock-counter-clockwise { --icon-color: var(--c-progress); }
.icon-check { --icon-color: var(--c-done); }
.icon-plus { --icon-color: var(--c-accent); }
.icon-folder-simple, .icon-folder-open { --icon-color: var(--c-accent); }
.icon-file, .icon-file-text, .icon-file-pdf, .icon-file-doc, .icon-file-xls, .icon-file-image { --icon-color: var(--c-file); }
.icon-link-simple { --icon-color: var(--c-link); }
.icon-key { --icon-color: var(--c-key); }
.icon-pencil-simple { --icon-color: var(--c-edit); }
.icon-download-simple, .icon-upload-simple { --icon-color: var(--c-file); }
.icon-trash { --icon-color: var(--c-danger); }
.system-bar span.icon,
.system-bar span.icon-trash,
.system-bar span.icon-clock-counter-clockwise,
.system-bar span.icon-chart-bar,
.system-bar span.icon-folders,
.system-bar span.icon-sign-out {
  --icon-color: var(--icon);
}
.icon-chart-bar { --icon-color: var(--c-file); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 23px; letter-spacing: -.7px; font-weight: 500; line-height: 1.3; }
h2 { font-size: 14px; font-weight: 500; }
h3 { font-size: 13px; font-weight: 500; }
a { color: inherit; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 10px; letter-spacing: 1.5px; font-weight: 500; color: var(--muted); }
.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; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 400px; max-width: 100%; }
.login-box h1 { font-size: 29px; margin-bottom: 10px; }
.login-box label { font-size: 14px; margin-bottom: 8px; }
.login-box input { padding: 14px 14px; font-size: 16px; }
.login-box form .primary { margin-top: 18px; width: 100%; height: 48px; font-size: 16px; gap: 9px; }
.login-box form .primary img { width: 20px; height: 20px; }
.form-error { color: var(--danger); margin: 8px 0 0; font-size: 12px; }
.system-bar {
  height: calc(var(--system-bar-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(var(--page-gutter), env(safe-area-inset-right, 0px)) 0 max(var(--page-gutter), env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); gap: 14px;
  max-width: 100%; min-width: 0;
}
.system-brand, .system-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.system-brand { font-weight: 500; letter-spacing: -.2px; flex-shrink: 0; }
.system-brand .icon { width: 19px; height: 19px; }
.system-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 1; min-width: 0; }
.system-tools .tool-count { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.system-actions { flex-shrink: 1; }
.system-actions form { display: contents; }
.desktop {
  height: calc(100dvh - var(--system-bar-height) - env(safe-area-inset-top, 0px));
  padding: 48px max(var(--page-gutter), env(safe-area-inset-right, 0px)) calc(56px + env(safe-area-inset-bottom, 0px)) max(var(--page-gutter), env(safe-area-inset-left, 0px));
  position: relative; overflow-x: hidden; overflow-y: auto; max-width: 100%;
}
.desktop-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 44px; gap: 16px; min-width: 0; }
.desktop-heading h1 { font-size: 42px; letter-spacing: -1.4px; margin: 0; font-weight: 500; line-height: 1.1; min-width: 0; }
.desktop-heading > button { flex-shrink: 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(112px, 100%), 112px)); gap: 14px; align-content: start; }
.projects-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 28px; }
.desktop-icon { border: 1px solid transparent; background: transparent; border-radius: 10px; width: 112px; min-height: 108px; padding: 14px 8px 10px; position: relative; }
.projects-grid .desktop-icon { width: 100%; min-height: 200px; padding: 28px 14px 20px; }
.desktop-icon.selected { background: var(--selected); border-color: var(--border-strong); }
.desktop-icon .open-item { border: 0; background: none; font-weight: 400; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; white-space: normal; line-height: 1.4; overflow-wrap: anywhere; align-items: center; text-align: center; }
.projects-grid .desktop-icon .open-item { gap: 16px; font-size: 16px; font-weight: 500; letter-spacing: -.25px; }
.desktop-icon .open-item:hover { background: none; }
.desktop-icon .open-item img, .desktop-icon .open-item .icon { width: 36px; height: 36px; opacity: .9; }
.projects-grid .desktop-icon .open-item img, .projects-grid .desktop-icon .open-item .icon { width: 72px; height: 72px; }
.folder-glyph {
  display: block; width: 36px; height: 36px; flex-shrink: 0;
}
.folder-glyph svg { display: block; width: 100%; height: 100%; }
.projects-grid .folder-glyph { width: 88px; height: 88px; }
.desktop-icon .item-menu { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; padding: 3px; opacity: .35; }
.desktop-icon:hover .item-menu, .desktop-icon:focus-within .item-menu { opacity: 1; }
.window { position: fixed; left: max(18px, calc((100% - 960px) / 2)); top: 110px; width: min(960px, calc(100% - 36px)); height: min(660px, calc(100dvh - 146px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: 0 10px 35px #0000000d, 0 2px 7px #00000006; display: flex; flex-direction: column; overflow: hidden; }
.window.active { border-color: #adada5; }
.window-titlebar { height: 40px; flex-shrink: 0; padding: 0 7px 0 14px; border-bottom: 1px solid var(--border); background: var(--surface-secondary); display: flex; align-items: center; justify-content: space-between; user-select: none; }
.window-titlebar { cursor: grab; touch-action: none; }
.window-titlebar:active { cursor: grabbing; }
.window-titlebar button { cursor: pointer; }
.modal-shade { position: fixed; inset: 0; background: #ffffff80; }
.window-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.window-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-controls { display: flex; gap: 2px; }
.window-content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.window.maximized { inset: calc(var(--system-bar-height) + env(safe-area-inset-top, 0px) + 12px) 12px 12px !important; width: auto !important; height: auto !important; }
.window.compact { width: min(480px, calc(100% - 32px)); height: auto; max-height: calc(100dvh - 112px); left: max(16px, calc((100% - 480px) / 2)); top: 90px; }
.window.editor { width: min(720px, calc(100% - 36px)); height: min(560px, calc(100dvh - 112px)); left: max(18px, calc((100% - 720px) / 2)); top: 80px; }
.window.editor .dialog-form { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.window.editor .field:has(textarea) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.window.editor textarea.text-editor { flex: 1; min-height: 280px; resize: vertical; font-size: 14px; line-height: 1.55; padding: 12px 14px; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.breadcrumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 120px; overflow: auto; }
.breadcrumbs button { padding: 3px 6px; font-size: 12px; font-weight: 400; }
.breadcrumbs img, .breadcrumbs .icon { width: 12px; height: 12px; opacity: .55; }
.file-area { flex: 1; padding: 16px; min-height: 200px; overflow: auto; }
.empty-state { color: var(--muted); text-align: center; padding: 52px 16px; font-size: 12px; width: 100%; }
.empty-state img, .empty-state .icon { display: block; width: 32px; height: 32px; margin: 0 auto 12px; opacity: .55; }
.status-bar { font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding: 7px 14px; }
.context-menu { position: fixed; z-index: 10000; min-width: 184px; max-width: min(280px, calc(100% - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: 4px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 4px; box-shadow: 0 5px 20px #0000000d; }
.context-menu button { display: flex; width: 100%; border: 0; background: transparent; justify-content: flex-start; font-size: 12px; padding: 7px 9px; font-weight: 400; }
.context-menu button:hover { background: var(--surface-secondary); }
.context-menu hr { margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.dialog-form, .detail-content { padding: 22px; }
.field { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dialog-form p { overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 9px 15px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 4px; box-shadow: 0 2px 10px #00000008; z-index: 11000; max-width: calc(100% - 24px); font-size: 12px; }
.table-scroll { overflow: auto; }
.preview-content { flex: 1; min-height: 0; overflow: auto; }
.preview-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; padding: 20px; }
.preview-pdf { display: block; width: 100%; height: 100%; border: 0; min-height: 400px; }
.text-preview { margin: 0; padding: 24px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 Consolas, monospace; }
.document-preview { max-width: 760px; margin: auto; padding: 36px; }
.document-preview h2 { font-size: 20px; margin: 24px 0 12px; }
.document-preview p { line-height: 1.8; }
.preview-limit { padding: 8px 14px; margin: 0; font-size: 11px; color: var(--muted); background: var(--surface-secondary); border-bottom: 1px solid var(--border); }
.preview-content table { font-size: 12px; }
.preview-content td { white-space: pre-wrap; min-width: 90px; max-width: 400px; }
.sheet-tabs { display: flex; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.sheet-tabs button { font-weight: 400; font-size: 12px; }
.sheet-tabs button[aria-selected=true] { background: var(--selected); border-color: var(--border-strong); }
.folder-picker { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 20px 0; max-height: 300px; overflow: auto; }
.folder-picker button { justify-content: flex-start; }
.detail-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.detail-value { overflow-wrap: anywhere; }
.preserve-lines { white-space: pre-wrap; }
.dragging { opacity: .4; }
.drop-target { background: #eeefe8 !important; outline: 1px dashed #858b78; outline-offset: -2px; }
.secret-actions { display: flex; gap: 8px; margin: 10px 0 20px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.row-actions button { font-size: 11px; padding: 4px 7px; }
.trash-table { min-width: 520px; }
.trash-table th { white-space: nowrap; }
.trash-heading, .trash-name { display: inline-flex; align-items: center; gap: 8px; }
.trash-heading img, .trash-heading .icon, .trash-name img, .trash-name .icon { width: 14px; height: 14px; opacity: .85; flex-shrink: 0; }
.trash-name { font-weight: 500; }
.trash-table td > small.muted { display: block; margin-top: 4px; margin-left: 22px; }
.row-actions button img, .row-actions button .icon { width: 14px; height: 14px; }
.history-list { padding: 0 20px; }
.history-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.history-row time { font-size: 11px; padding-top: 2px; }
.history-row div { overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; font-size: 12px; }
.project-tabs { display: flex; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
.project-tabs button { border: 0; border-radius: 4px 4px 0 0; border-bottom: 2px solid transparent; padding: 11px 12px 9px; color: var(--muted); background: transparent; flex-shrink: 0; }
.project-tabs button[aria-pressed=true] { border-bottom-color: var(--text); color: var(--text); }
.work-plan { padding: 24px 28px 0; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.plan-heading { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; margin-bottom: 20px; flex-shrink: 0; }
.plan-heading h2 { font-size: 18px; letter-spacing: -.4px; margin: 0; }
.plan-today { color: var(--muted); font-size: 11px; white-space: nowrap; }
.work-plan > .primary { align-self: flex-start; flex-shrink: 0; }
.plan-tabs { display: flex; gap: 6px; padding: 20px 0 12px; flex-shrink: 0; overflow-x: auto; }
.plan-tabs button { font-size: 12px; font-weight: 400; border-color: transparent; color: var(--muted); background: transparent; }
.plan-tabs button[aria-selected=true] { color: var(--text); background: var(--surface); border-color: var(--border); }
.plan-tab-planned .icon { --icon-color: var(--c-planned); }
.plan-tab-in_progress .icon { --icon-color: var(--c-progress); }
.plan-tab-done .icon { --icon-color: var(--c-done); }
.plan-count { font-size: 10px; font-variant-numeric: tabular-nums; min-width: 17px; padding: 0 4px; border-radius: 3px; background: #e6e5e1; color: #6f6d67; }
.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-row { display: flex; align-items: flex-start; gap: 12px; border-top: 1px solid #e6e5e1; padding: 14px 0; }
.plan-row:last-child { border-bottom: 1px solid #e6e5e1; }
.plan-row-content { min-width: 0; flex: 1; }
.plan-title { display: block; overflow-wrap: anywhere; font-weight: 500; }
.plan-description { display: block; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--muted); font-size: 12px; margin-top: 4px; }
.plan-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; align-items: center; }
.plan-status { font-size: 11px; font-weight: 500; border-radius: 3px; padding: 1px 7px; border: 1px solid transparent; }
.plan-status-planned { color: var(--c-planned); background: #eef3f8; border-color: #d5e0eb; }
.plan-status-in_progress { color: var(--c-progress); background: #f8f3e9; border-color: #ead9b8; }
.plan-status-done { color: var(--c-done); background: #eef5f0; border-color: #d2e4d7; }
.plan-date { color: var(--muted); font-size: 11px; }
.plan-due.overdue { color: var(--danger); }
.plan-row.done .plan-title { color: var(--muted); }
.plan-empty { padding-top: 48px; }
.plan-empty p { color: var(--text); margin-bottom: 5px; }
.plan-pagination { margin-top: auto; flex-shrink: 0; padding: 18px 0; }
.window.analytics-window { width: min(960px, calc(100% - 36px)); height: min(760px, calc(100dvh - 100px)); left: max(18px, calc((100% - 960px) / 2)); top: 70px; }
.analytics { padding: 20px 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.analytics-loading { padding: 24px; margin: 0; }
.analytics-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.analytics-stat { border: 1px solid var(--border); border-radius: 6px; padding: 14px 12px; background: var(--surface); }
.analytics-stat-value { font-size: 24px; font-weight: 500; letter-spacing: -.6px; line-height: 1.1; }
.analytics-stat-label { margin-top: 4px; color: var(--muted); font-size: 11px; }
.analytics-stat.planned .analytics-stat-value { color: var(--c-planned); }
.analytics-stat.progress .analytics-stat-value { color: var(--c-progress); }
.analytics-stat.done .analytics-stat-value { color: var(--c-done); }
.analytics-stat.danger .analytics-stat-value { color: var(--danger); }
.analytics-card { border: 1px solid var(--border); border-radius: 6px; padding: 14px 14px 10px; background: var(--surface); min-width: 0; }
.analytics-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.analytics-chart { height: 220px; position: relative; }
.analytics-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.analytics-list { border: 1px solid var(--border); border-radius: 6px; padding: 12px; min-width: 0; background: var(--surface); }
.analytics-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.analytics-list-heading h3 { margin: 0; font-size: 13px; font-weight: 500; }
.analytics-list-planned .analytics-list-heading h3 { color: var(--c-planned); }
.analytics-list-in_progress .analytics-list-heading h3 { color: var(--c-progress); }
.analytics-list-done .analytics-list-heading h3 { color: var(--c-done); }
.analytics-list-empty { margin: 0; font-size: 12px; }
.analytics-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.analytics-task { padding: 8px 0; border-top: 1px solid #ecece8; }
.analytics-task:first-child { border-top: 0; padding-top: 0; }
.analytics-task-title { overflow-wrap: anywhere; font-weight: 500; font-size: 12px; }
.analytics-task-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.analytics-task-meta .overdue { color: var(--danger); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: var(--surface-secondary); color: var(--muted); font-size: 11px; font-weight: 500; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
td { overflow-wrap: anywhere; }
@media (pointer: coarse) {
  button.icon-button { width: 40px; height: 40px; padding: 10px; }
  .desktop-icon .item-menu { opacity: 1; width: 32px; height: 32px; padding: 6px; }
  .context-menu button { min-height: 40px; padding: 10px 12px; font-size: 13px; }
  .project-tabs button, .plan-tabs button { min-height: 40px; }
}
@media (max-width: 900px) {
  :root { --page-gutter: 20px; }
  input, textarea, select { font-size: 16px; }
  .system-bar { gap: 8px; }
  .system-tools .tool-label,
  .system-actions .tool-label { display: none; }
  .system-tools button,
  .system-actions > form > button {
    gap: 0;
    padding: 8px;
    min-width: 40px;
    min-height: 40px;
  }
  .system-tools .tool-count { font-size: 12px; margin-left: 4px; }
  .desktop { padding-top: 28px; padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)); }
  .desktop-heading { align-items: flex-start; margin-bottom: 28px; }
  .desktop-heading h1 { font-size: 32px; letter-spacing: -1px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr)); gap: 10px; }
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 16px; }
  .desktop-icon { width: 100%; }
  .projects-grid .desktop-icon { min-height: 148px; padding: 18px 10px 14px; }
  .projects-grid .folder-glyph { width: 64px; height: 64px; }
  .projects-grid .desktop-icon .open-item { font-size: 14px; }
  .projects-grid .desktop-icon .open-item img,
  .projects-grid .desktop-icon .open-item .icon { width: 64px; height: 64px; }
  .window,
  .window.compact,
  .window.maximized,
  .window.editor,
  .window.analytics-window {
    inset: calc(var(--system-bar-height) + env(safe-area-inset-top, 0px) + 6px)
      max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px)) !important;
    width: auto !important;
    height: auto !important;
    max-height: none;
    border-radius: 6px;
  }
  .window-titlebar { cursor: default; touch-action: manipulation; }
  .window-controls button[aria-label="Развернуть окно"],
  .window-controls button[aria-label="Восстановить окно"] { display: none; }
  .toolbar { padding: 8px 10px; gap: 6px; }
  .file-area { padding: 12px; }
  .dialog-form, .detail-content { padding: 18px; }
  .dialog-actions { flex-wrap: wrap; }
  .project-tabs { gap: 4px; padding: 0 12px; }
  .project-tabs button { padding: 12px 10px 10px; }
  .work-plan { padding: 20px 16px 0; }
  .plan-heading { gap: 8px; flex-wrap: wrap; }
  .analytics { padding: 16px; }
  .analytics-lists { grid-template-columns: 1fr; }
  .analytics-chart { height: 200px; }
  .history-list { padding: 0 14px; }
  .history-row { grid-template-columns: 120px 1fr; gap: 12px; }
  .preview-pdf { min-height: 280px; }
  .document-preview { padding: 20px 14px; }
  .toast { bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 540px) {
  :root { --page-gutter: 14px; }
  .system-bar { gap: 8px; }
  .system-actions { gap: 4px; }
  .desktop-heading { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 20px; }
  .desktop-heading h1 { font-size: 26px; letter-spacing: -.7px; }
  .desktop-heading > button { width: 100%; min-height: 44px; }
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(min(108px, 100%), 1fr)); gap: 10px; }
  .projects-grid .desktop-icon { min-height: 120px; padding: 14px 6px 10px; }
  .projects-grid .folder-glyph { width: 48px; height: 48px; }
  .projects-grid .desktop-icon .open-item { font-size: 13px; gap: 10px; }
  .projects-grid .desktop-icon .open-item img,
  .projects-grid .desktop-icon .open-item .icon { width: 48px; height: 48px; }
  .window,
  .window.compact,
  .window.maximized,
  .window.editor,
  .window.analytics-window {
    inset: calc(var(--system-bar-height) + env(safe-area-inset-top, 0px)) 0 0 0 !important;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
  }
  .toolbar { padding: 8px; gap: 4px; }
  .breadcrumbs { min-width: 0; flex-basis: 100%; order: 3; }
  .file-area { padding: 10px; }
  .dialog-form, .detail-content { padding: 16px; }
  .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .dialog-actions button { width: 100%; min-height: 44px; }
  .secret-actions { flex-wrap: wrap; }
  .secret-actions button { flex: 1 1 auto; min-height: 40px; }
  .work-plan { padding: 16px 12px 0; }
  .plan-heading { flex-direction: column; align-items: flex-start; }
  .plan-tabs { gap: 3px; }
  .plan-tabs button { padding: 8px 6px; gap: 4px; font-size: 12px; }
  .plan-tabs button > .icon { display: none; }
  .plan-row { gap: 9px; }
  .work-plan > .primary { width: 100%; min-height: 44px; }
  .history-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; }
  .analytics { padding: 12px; gap: 12px; }
  .analytics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-chart { height: 180px; }
  .trash-table { min-width: 0; }
  .trash-table thead { display: none; }
  .trash-table, .trash-table tbody, .trash-table tr, .trash-table td { display: block; width: 100%; }
  .trash-table tr {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 0 10px 10px;
    padding: 12px;
    background: var(--surface);
  }
  .trash-table td { border: 0; padding: 4px 0; }
  .trash-table td > small.muted { margin-left: 22px; }
  .row-actions { margin-top: 8px; }
  .row-actions button { min-height: 36px; font-size: 12px; padding: 6px 10px; }
  .pagination { gap: 10px; padding: 12px; flex-wrap: wrap; }
  .pagination button { min-height: 40px; }
}
