:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #191919;
  background: #f0f0f0;
  color-scheme: light;
  font-size: 14px;
  line-height: 1.45;
  --page: #f0f0f0;
  --surface: #fff;
  --field: #f8f8f8;
  --line: #d4d4d4;
  --hairline: #e9e9e9;
  --muted: #666;
  --accent: #1e7956;
  --accent-hover: #176345;
  --radius: 8px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 340px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #116dc8; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 700; }
h3 { font-size: 15px; line-height: 1.4; }
p { margin-block: .4em; }
small { display: block; color: var(--muted); font-size: 13px; }
input:not([type="checkbox"], [type="radio"], [type="file"]), textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[readonly], input:disabled { opacity: .6; }
.icon { display: inline-block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.82; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
.button { display: inline-flex; min-height: 38px; gap: 7px; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.button:hover:not(:disabled) { background: #f2f2f2; text-decoration: none; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.flat { background: transparent; border-color: transparent; }
.button.danger { color: #b42626; }
.icon-button { padding: 8px; width: 38px; height: 38px; }
.full { width: 100%; }
.muted { color: var(--muted); }
.strong { font-weight: 650; }
.right { text-align: right; }
.prewrap { white-space: pre-wrap; }
.spacer { flex: 1; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.balance-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

#app { --nav-rail: 70px; --nav-panel: 230px; }
.nav-backdrop { position: fixed; z-index: 9; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: rgb(0 0 0 / 50%); }
.navigation { position: fixed; z-index: 10; inset: 0 auto 0 0; width: var(--nav-rail); background: #191919; color: #999; display: flex; flex-direction: column; border-right: 1px solid #363636; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.expanded .navigation { width: var(--nav-panel); }
.nav-head { position: relative; display: flex; flex: 0 0 64px; align-items: center; justify-content: center; gap: 4px; padding: 8px; }
.navigation .nav-toggle, .nav-company, .nav-link, .nav-profile { display: flex; align-items: center; justify-content: center; padding: 0; color: inherit; border: 0; border-radius: 6px; background: transparent; }
.navigation .nav-toggle { width: 100%; height: 44px; flex: 0 0 auto; }
.expanded .nav-toggle { width: 36px; margin-left: auto; }
.navigation .nav-company { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 4px; gap: 9px; justify-content: flex-start; border-radius: 4px; }
.nav-company-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-company-name small { font-size: 10px; line-height: 1.1; color: #b6c5bf; }
.nav-company .wowios-logo { width: 28px; height: 28px; flex: 0 0 auto; }
.navigation .nav-company > .icon { width: 13px; height: 13px; margin-left: auto; margin-right: 2px; }
.nav-profile > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; font-size: 13px; font-weight: 650; }
.nav-search { flex: 0 0 auto; display: grid; gap: 4px; padding: 4px 8px 6px; border-bottom: 1px solid #3b3b3b; }
.navigation nav { display: grid; gap: 4px; padding: 6px 8px; align-content: start; overflow-y: auto; scrollbar-width: none; }
.nav-row { display: flex; position: relative; }
.nav-link { width: 100%; min-height: 44px; min-width: 0; gap: 9px; white-space: nowrap; text-align: left; }
.navigation .icon { width: 18px; height: 18px; }
.navigation :is(a, button):not(:disabled):hover { background: #2e2e2e; text-decoration: none; color: #fafafa; }
.navigation [aria-expanded="true"]:not(.nav-toggle) { background: #3d3d3d; }
.navigation .nav-link[aria-current="page"] { color: #fafafa; background: #303030; font-weight: 650; }
.navigation .nav-link[aria-current="page"] .icon { stroke-width: 2; }
.navigation .nav-link[aria-current="page"]:is([href="#/overview"], [href="#/projects"]) .icon { fill: currentColor; }
.navigation :is(.nav-label, .nav-new, kbd) { display: none; }
.expanded .navigation .nav-link { justify-content: flex-start; padding-inline: 9px; }
.expanded .navigation .nav-link[aria-current="page"]:not(:hover) { background: transparent; }
.expanded .nav-label, .expanded .nav-new { display: inline; }
.expanded .nav-new { margin-left: -2px; padding: 2px 6px; border-radius: 12px; background: #91bcfa; color: #153958; font-size: 11px; }
.navigation kbd { margin-left: auto; padding: 2px 5px; border-radius: 4px; background: #383838; color: #ddd; font: inherit; font-size: 11px; }
.expanded .nav-search .nav-link:is(:hover, :focus-visible) kbd { display: inline; }
.navigation .nav-quick { position: absolute; right: 3px; top: 6px; width: 32px; height: 32px; min-height: 32px; opacity: 0; pointer-events: none; }
.nav-row:is(:hover, :focus-within) .nav-quick { opacity: 1; pointer-events: auto; }
.nav-foot { flex: 0 0 auto; margin-top: auto; padding: 8px 8px 12px; }
.expanded .nav-foot { padding-bottom: 0; }
.navigation .nav-subscribe { width: 100%; height: 44px; border: 1px solid #4d4d4d; background: #333; color: #fafafa; }
.navigation .nav-subscribe:hover { background: #404040; }
.nav-trial { padding: 12px; margin-bottom: 8px; border: 1px solid #3c3c3c; border-radius: 6px; }
.nav-trial > div { display: flex; gap: 9px; align-items: center; line-height: 1.35; }
.nav-trial small { color: #999; font-size: 12px; }
.nav-trial strong, .nav-trial .icon { color: #fafafa; }
.nav-trial .nav-subscribe { height: 38px; margin-top: 8px; }
.nav-utilities { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 57px; margin-inline: -8px; padding: 0 12px; border-top: 1px solid #3b3b3b; background: #1e1e1e; }
.nav-utilities .button { color: #fafafa; }
.nav-utilities .button:disabled { opacity: .8; }
.nav-profile { width: 40px; height: 40px; }
.nav-profile > span { background: #a8dfcd; color: #185f4d; border-radius: 50%; }
.nav-menu { position: absolute; z-index: 1; padding: 6px; width: max-content; min-width: 194px; border: 1px solid #3c3c3c; background: #191919; color: #fafafa; border-radius: 8px; box-shadow: 0 4px 12px rgb(0 0 0 / 25%); }
.company-menu { left: 8px; top: 62px; }
.profile-menu { bottom: 50px; left: min(181px, calc(100vw - 230px)); }
.nav-menu > :is(a, button) { display: flex; width: 100%; align-items: center; justify-content: flex-start; gap: 8px; min-height: 39px; padding: 6px 8px; border-radius: 5px; font-size: 14px; font-weight: 400; }
.navigation .nav-menu .danger { color: #f25f60; }
.nav-account-label { padding: 8px 9px; border-bottom: 1px solid #3b3b3b; }
.nav-account-label small { color: #cecece; max-width: 218px; overflow: hidden; text-overflow: ellipsis; }
.nav-account-label strong { font-size: 12px; }
.workspace { margin-left: var(--nav-rail); min-height: 100vh; }
.wowios-wordmark { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 23px; letter-spacing: -.6px; }
.wowios-logo { width: 37px; height: 37px; display: block; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 408px); padding: 30px; }
.auth-card h1 { margin: 23px 0 18px; }
.auth-card form .full { margin-top: 10px; }
.auth-card > .button:last-child { margin-top: 8px; }
.account-content { display: grid; gap: 22px; max-width: 760px; }
.account-content section > h2 { margin-bottom: 12px; }
.invite-result { margin-top: 17px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.sync-status:not(:empty) { position: fixed; inset: auto 16px 16px auto; z-index: 11; width: min(410px, calc(100% - 32px)); display: grid; gap: 6px; justify-items: start; padding: 12px 14px; color: #572b00; background: #fff2d4; border: 1px solid #e7cfa6; border-radius: 8px; box-shadow: 0 3px 14px #0002; }
.sync-status p { margin: 0; }
.page { padding: 16px; }
.page-head, .work-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 39px; }
.work-head { justify-content: start; margin: 0; padding: 7px 10px; background: var(--page); position: sticky; top: 0; z-index: 5; }
.work-head h1 { font-size: 18px; }
.date-line { color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.dashboard { padding-top: 40px; padding-right: 26px; }
.dashboard h1 { font-size: 26px; margin-bottom: 17px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.77fr) minmax(280px, 1fr); gap: 16px; }
.dashboard-column { display: grid; align-content: start; gap: 16px; }
.card, .panel { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card h2 { margin: 2px 0 15px; }
.compact { margin-bottom: 15px; padding: 12px; }
.welcome { display: grid; grid-template-columns: minmax(200px, .75fr) minmax(0, 1fr); padding: 0; overflow: clip; }
.welcome > div { padding: 25px 23px; }
.welcome-detail { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: #e6f0fc; }
.welcome-detail h2 { margin: 18px 0 4px; }
.welcome-detail p { margin: 4px 0 16px; }
.welcome-icon { color: #277267; }
.welcome-icon .icon { width: 42px; height: 42px; stroke-width: 1.2; }
.step { display: flex; min-height: 48px; width: 100%; border: 0; margin: 5px 0; gap: 10px; align-items: center; border-radius: 8px; padding: 11px; text-align: left; font-weight: 650; background: #fff; }
.step:hover, .step.active { background: #e6f0fc; }
.step-mark { width: 17px; height: 17px; border-radius: 50%; line-height: 16px; text-align: center; font-size: 12px; color: white; background: #0866c4; flex: 0 0 auto; }
.step.active .step-mark { color: #0866c4; background: transparent; font-size: 19px; }
.recent { min-height: 60px; display: grid; grid-template-columns: minmax(0, 1fr) auto 120px; gap: 14px; align-items: center; padding: 6px 14px; }
.recent .status-filter { max-width: 120px; }
.overview-company { display: flex; gap: 12px; align-items: center; padding: 12px 0 20px; }
.avatar { background: #c1ead9; color: #126b4d; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 100%; font-size: 18px; font-weight: 700; flex: 0 0 auto; }
.balance { padding: 22px; text-align: center; background: var(--page); border-radius: 8px; }
.balance strong { font-size: 34px; }
.balance small { display: inline; }
.card > .balance-row { padding: 8px 2px; border-bottom: 1px solid var(--hairline); }
.card > .button:last-child { margin-top: 8px; }
.task { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hairline); }
.task label { display: flex; align-items: center; gap: 6px; }
.task .done { text-decoration: line-through; color: var(--muted); }
.dashboard form[data-form="task"] input { border-color: transparent; background: #fff; font-style: italic; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.filters select { width: auto; padding-right: 12px; background: #fff; }
.filter-select { position: relative; }
.filter-select .icon { position: absolute; left: 10px; top: 12px; width: 14px; height: 14px; pointer-events: none; }
.filter-select select { width: 107px; padding-left: 30px; }
.filter-select[data-kind="Archivstatus"] select { width: 104px; }
.filter-select[data-kind="Mitarbeiter"] select { width: 135px; }
.filter-label { margin-bottom: 6px; color: var(--muted); font-weight: 650; }
.search-field { position: relative; width: min(100%, 400px); }
.search-field .icon { position: absolute; right: 12px; top: 11px; pointer-events: none; }
.search-field input[type=search] { background: #fff; padding-right: 42px; }
.table-wrap { overflow: auto; background: white; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; border-spacing: 0; }
th { font-weight: 650; color: #5d5d5d; font-size: 13px; text-align: left; white-space: nowrap; }
td, th { padding: 11px 16px; border-bottom: 1px solid #d9d9d9; }
.page .table-wrap tbody td { height: 70px; }
.page:has([data-filter="projects:query"]) .table-wrap tbody td { height: 80px; }
.button.sort-button { color: inherit; min-height: 0; padding: 0; border: 0; font-size: inherit; }
.table-footer { padding: 12px 16px; color: var(--muted); display: flex; justify-content: space-between; }
.status-filter, .field select.status-filter { color: #6d6d6d; border: 0; border-radius: 99px; background: #eee; width: auto; min-height: 28px; padding: 4px 9px; font-size: 13px; }
.status-filter[data-status="Erstkontakt"] { background: #fce0ca; color: #8c4e20; }
.status-filter[data-status="Auftrag erhalten"], .pill.blue { background: #cceffb; color: #245d73; }
.status-filter[data-status="Ausführung"] { background: #fff0c8; color: #6e5413; }
.status-filter[data-status="Abgeschlossen"] { background: #ccecdf; color: #0f6244; }
.pill { display: inline-block; padding: 4px 10px; width: max-content; border-radius: 99px; background: #efefef; color: #444; font-size: 13px; }
.tabs { display: flex; min-height: 38px; gap: 10px; align-items: stretch; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 5px 5px 4px; color: var(--muted); white-space: nowrap; }
.tabs button:hover, .tabs button[aria-selected="true"] { color: #171717; }
.tabs button[aria-selected="true"] { border-bottom-color: #222; font-weight: 700; }
.page > .tabs { margin-bottom: 12px; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1.84fr) minmax(280px, 1fr); gap: 10px; padding: 0 10px 10px; min-height: calc(100vh - 53px); }
.project-main { display: grid; grid-template-rows: minmax(268px, 35vh) minmax(350px, 1fr); gap: 10px; min-width: 0; }
.project-grid .panel { padding: 10px; min-width: 0; }
.project-top { overflow: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.metrics section { min-height: 111px; padding: 12px; border: 1px solid #f1f1f1; border-radius: 8px; position: relative; overflow: hidden; }
.metrics section small { color: #6e6e6e; margin-bottom: 14px; }
.metrics section small .icon { width: 14px; height: 14px; }
.metrics section strong { font-weight: 500; }
.ring { position: absolute; right: 14px; top: 40px; display: grid; place-items: center; width: 65px; height: 65px; border: 5px solid #c2ebdb; border-radius: 100%; font-size: 12px; }
.doc-group { padding: 6px 5px 4px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.project-doc { display: flex; justify-content: space-between; align-items: center; padding: 10px 5px; min-height: 82px; }
.project-doc small { font-size: 12px; margin: 2px 0 3px; }
.chat { display: flex; flex-direction: column; }
.chat h2 { padding: 8px 5px 12px; }
.chat .tabs { border-bottom: 1px solid var(--line); }
.chat-body { display: grid; align-content: start; align-items: start; padding: 10px; flex: 1; }
.chat-empty { display: grid; gap: 5px; justify-items: center; align-content: center; min-height: 280px; height: 100%; color: var(--muted); }
.chat-empty .icon { width: 32px; height: 32px; }
.chat-body:has(.chat-empty) { align-content: stretch; }
.chat-form { display: flex; gap: 8px; }
.chat-message { border-bottom: 1px solid var(--hairline); padding: 8px 0; overflow-wrap: anywhere; }
.storage-row { padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.empty { padding: 28px 10px; color: var(--muted); text-align: center; }
.settings-grid { display: grid; grid-template-columns: minmax(180px, 240px) minmax(260px, 720px); gap: 15px; align-items: start; }
.calendar-grid { display: grid; grid-template-columns: minmax(135px, 230px) repeat(14, minmax(45px, 1fr)); min-width: 805px; }
.calendar-grid > div { min-height: 40px; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 7px 5px; }
.calendar-day { text-align: center; }
.calendar-day.current { background: #e7f5ef; color: var(--accent); font-weight: 700; }
.calendar-event { background: #d3efe1; }
.calendar-event button { width: 100%; border: 0; background: transparent; font-size: 11px; padding: 0; }

.editor-head { padding-right: 16px; }
.saved { display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 100%; width: 17px; height: 17px; }
.saved .icon { width: 13px; height: 13px; }
.editor-grid { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; padding: 0 174px 45px 10px; position: relative; }
.editor-navigation { position: sticky; top: 52px; z-index: 3; }
.index-panel { position: absolute; left: 0; top: 44px; z-index: 4; background: white; padding: 10px; border: 1px solid var(--line); border-radius: 8px; width: 245px; box-shadow: 0 3px 10px #0001; }
.index-panel button, .product-result { display: flex; width: 100%; text-align: left; border: 0; background: #fff; padding: 7px; }
.index-panel button:hover, .product-result:hover { background: #f1f1f1; }
.editor-tools { position: fixed; top: 52px; right: 19px; width: 247px; z-index: 4; }
.tool-actions { display: flex; gap: 1px; justify-content: space-between; border: 1px solid var(--hairline); padding: 0 4px; border-radius: 8px; background: white; box-shadow: 0 2px 8px #0001; margin-left: 26px; }
.tool-active { color: var(--accent); }
.block-tool { display: flex; width: 100%; gap: 9px; min-height: 38px; padding: 8px 12px; margin-top: 4px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 4px 10px #0001; text-align: left; cursor: grab; }
.block-tool .icon { margin-left: auto; }
.tool-panel { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: white; margin-top: 5px; box-shadow: 0 3px 12px #0001; }
.tool-panel input { margin-bottom: 5px; }
.product-result { justify-content: space-between; gap: 5px; }
.document-sheet { background: white; border: 1px solid var(--line); border-radius: 10px 10px 0 0; min-width: 0; }
.document-head-fields { padding: 32px 31px 55px; }
.document-head-fields .balance-row { margin: 0 0 16px; }
.document-head-fields h2 { font-size: 16px; }
.document-fields { display: grid; grid-template-columns: minmax(0, 3fr) minmax(120px, 1fr); gap: 16px; }
.document-head-fields input.recipient { min-height: 65px; padding: 13px 15px; font-weight: 600; font-size: 15px; }
.sheet-text { display: block; width: 100%; border: 0; padding: 28px 7%; background: white; min-height: 140px; }
textarea.sheet-text { border: 0; padding: 26px 7%; border-radius: 0; background: #fff; }
.sheet-text.end-text { min-height: 110px; }
.document-table { table-layout: fixed; }
.document-table thead { background: var(--page); }
.document-table th { color: #171717; padding: 8px 10px; }
.document-table td { border-bottom: 1px solid #f0f0f0; padding: 10px 10px; overflow-wrap: anywhere; vertical-align: top; }
.document-table tr.title-row td { min-height: 62px; padding-block: 15px; vertical-align: middle; font-weight: 650; }
.document-table tr.position-row td { height: 78px; padding-top: 15px; }
.title-row input { font-weight: 700; }
.plain-cell { display: inline-block; border: 0; background: transparent; padding: 2px 0; text-align: inherit; font: inherit; overflow-wrap: anywhere; max-width: 100%; }
.plain-cell:hover { text-decoration: underline; }
.document-table tr.marked { background: #fff9dc; }
.grip { color: #646464; margin-right: 4px; cursor: grab; }
.edit-row > td { padding: 5px; border: 2px solid #212121; }
.position-form { padding: 11px 14px; background: var(--page); border-radius: 7px; }
.position-form .field { margin: 0 0 6px; }
.editor-line { display: grid; grid-template-columns: minmax(28px,.45fr) minmax(65px,1fr) minmax(65px,1fr) minmax(165px,4fr) minmax(65px,1fr) minmax(78px,1fr); gap: 8px; align-items: start; }
.editor-line .field > span, .result-label { font-size: 12px; color: var(--muted); }
.edit-section { margin-top: 12px; padding: 10px 0; border-top: 1px solid #c9c9c9; }
.switch { display: inline-flex; gap: 6px; min-height: 29px; align-items: center; cursor: pointer; font-weight: 650; }
.switch input { position: absolute; opacity: 0; width: 36px; height: 20px; }
.switch > span { width: 40px; height: 21px; background: #999; border-radius: 20px; position: relative; flex: 0 0 auto; }
.switch > span::after { content: ""; position: absolute; background: white; border-radius: 100%; width: 16px; height: 16px; left: 3px; top: 2.5px; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid #116dc8; outline-offset: 2px; }
.measure-row, .measure-head { display: grid; grid-template-columns: 20px 1.4fr 1.3fr minmax(66px, .48fr) 34px; align-items: center; gap: 8px; margin-bottom: 6px; }
.cost-row, .cost-head { display: grid; grid-template-columns: 16px 1.05fr .7fr .8fr 1.4fr .8fr .7fr 34px; align-items: center; gap: 6px; margin-bottom: 7px; }
.measure-head, .cost-head { margin-block: 8px 4px; font-size: 12px; color: #444; }
.choice-line { display: flex; gap: 14px; padding: 8px 0; }
.position-form output { display: block; background: #e5e5e5; min-height: 38px; padding: 8px 9px; text-align: right; border-radius: 6px; }
.balance-row > span > output { display: inline-block; }
.position-form details { padding: 8px 0; }
.position-form summary { font-weight: 650; cursor: pointer; }
.sales-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px; align-items: center; margin-top: 5px; }
.sales-row label { display: flex; gap: 5px; align-items: center; }
.position-image { display: block; max-width: min(280px, 100%); max-height: 200px; object-fit: contain; margin: 5px 0; }
.field-error { color: #a32626; }
.field-error:empty { display: none; }
.sum-area { padding: 24px 6%; }
.document-sum { width: min(100%, 500px); margin: 0 0 12px auto; }
.document-sum > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 8px; }
.document-sum .gross { background: #eee; font-size: 16px; border-radius: 5px; }
.preview-status { margin: 5px 10px; }
.paper { max-width: 820px; min-height: 1040px; margin: 0 auto 36px; background: #fff; padding: 56px 55px; border: 1px solid #ddd; box-shadow: 0 4px 16px #0001; }
.paper .sender { text-align: right; margin-bottom: 35px; }
.paper-address { min-height: 90px; }
.paper h3 { margin: 12px 0 5px; }
.paper p { margin: 12px 0; }
.paper td, .paper th { padding: 8px 6px; }
.paper .print-appendix { margin-top: 30px; }
.paper .document-sum { margin-top: 12px; }

dialog { width: min(720px, calc(100% - 30px)); max-height: min(85vh, 770px); padding: 0; color: #171717; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 15px 60px #0003; }
dialog::backdrop { background: #0008; }
dialog.document-dialog { min-height: min(765px, 86vh); }
.dialog-head { position: sticky; inset-block-start: 0; z-index: 1; display: flex; align-items: center; gap: 10px; min-height: 69px; padding: 14px 23px; background: #fff; border-bottom: 1px solid var(--hairline); }
.dialog-head h2 { flex: 1; font-size: 18px; }
.x { font-size: 24px; border: 0; background: transparent; color: #414141; min-width: 26px; padding: 0; }
.dialog-body { padding: 16px 24px 24px; }
.choice { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 57px; padding: 14px 16px; background: var(--field); border: 1px solid var(--line); border-radius: 9px; text-align: left; margin-bottom: 15px; }
.choice:hover:not(:disabled) { background: #eee; }
.choice > span:last-child { font-size: 20px; font-weight: 400; color: #777; }
.choice small { margin-top: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.field > span { color: #373737; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-actions { display: flex; justify-content: end; gap: 8px; margin-top: 15px; }
.search-result { display: block; padding: 8px; border-bottom: 1px solid var(--hairline); }
.price-row { display: block; }
#message { position: fixed; z-index: 20; inset: auto 14px 14px auto; padding: 11px 16px; border-radius: 8px; color: white; background: #212121; opacity: 0; max-width: min(440px, 90vw); pointer-events: none; }
#message.visible { opacity: 1; }

@media (max-width: 1050px) {
  .editor-grid { padding-right: 140px; }
  .editor-tools { width: 195px; right: 12px; }
  .tool-actions { margin-left: 0; }
  .tool-actions .button { width: 35px; }
  .project-grid { grid-template-columns: minmax(0, 1.6fr) minmax(235px, 1fr); }
  .panel-head { flex-wrap: wrap; }
  .cost-row, .cost-head { min-width: 575px; }
  .position-form details { overflow-x: auto; }
}
@media (max-width: 800px) {
  #app { --nav-rail: 54px; }
  #app:not(.expanded) :is(.navigation nav, .nav-search, .nav-foot) { padding-inline: 5px; }
  .page { padding: 11px; }
  .dashboard-grid, .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-main { grid-template-rows: auto minmax(240px, 1fr); }
  .editor-grid { display: block; padding: 8px; }
  .editor-navigation { display: none; }
  .editor-tools { position: static; width: 100%; margin-top: 8px; }
  .document-head-fields { padding: 18px; }
  .document-sheet { overflow: auto; }
  .document-table { min-width: 580px; }
  .editor-head { flex-wrap: wrap; }
  .paper { padding: 20px 15px; margin: 0 8px 20px; overflow-x: auto; }
  .paper table { min-width: 430px; }
  .work-head h1 { font-size: 16px; }
}
@media (max-width: 500px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome > div { padding: 12px; }
  .recent { grid-template-columns: minmax(0, 1fr) auto; padding-inline: 2px; }
  .recent > small { display: none; }
  .metrics, .settings-grid, .two { grid-template-columns: 1fr; }
  .editor-head .actions { width: 100%; }
  .editor-head .actions .button { white-space: normal; }
}
@page { size: A4; margin: 14mm; }
@media print {
  body, .workspace, .preview-page { background: white; }
  .nav-shell, .editor-head, .preview-status, #message, #sync-status { display: none !important; }
  .workspace { margin: 0; }
  .paper { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; min-height: 0; }
  .paper tr, .paper .document-sum { break-inside: avoid; }
  .paper .print-appendix { break-before: page; }
  .paper thead { display: table-header-group; }
}
