/* Variante A: shared compact interface; editor text and page previews retain their scale. */
:root {
  --bg: #f5f7f9;
  --ink: #202e38;
  --muted: #60717e;
  --line: #dce3e8;
  --panel: #fff;
  --brand: #126373;
  --radius: 6px;
  --shadow: none;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: var(--font);
}
body { background: var(--bg); font-size: 14px; line-height: 1.45; }
.topbar { background: #fff; backdrop-filter: none; }
.topbar-inner { max-width: 1440px; padding: 0.6rem 1.5rem; gap: 1.8rem; }
.brand { font-size: 1.05rem; letter-spacing: -0.035em; }
.topbar nav { gap: 1.25rem; font-size: 0.85rem; }
.topbar-user { font-size: 0.8rem; }
.main { max-width: 1440px; padding: 1.25rem 1.5rem 2.5rem; }
.page-head { margin-bottom: 1rem; gap: 0.75rem; }
.page-head h1 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.035em; margin: 0.35rem 0; }
.breadcrumb { font-size: 0.75rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.lead { font-size: 0.85rem; }
.panel { padding: 1rem; box-shadow: none; }
.panel h2 { font-size: 1rem; font-weight: 650; letter-spacing: -0.015em; }
.view-article_form .panel-wide { max-width: none; }
.panel-head-row { margin-bottom: 0.6rem; }
.btn { border-radius: 5px; padding: 0.4rem 0.75rem; font-size: 0.8125rem; min-height: 34px; font-weight: 600; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-secondary { border-color: var(--line); }
.btn-ghost:hover { background: #eaf0f3; }
.btn-danger { border-color: transparent; background: transparent; }
.btn-danger:hover { background: #fff1f2; border-color: #efc7ce; }
.btn-sm { min-height: 30px; padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.actions { gap: 0.4rem; align-items: center; }
label { gap: 0.25rem; font-size: 0.8rem; font-weight: 600; }
input, select, textarea { border-radius: 5px; padding: 0.4rem 0.55rem; font-size: 0.875rem; font-weight: 400; }
input:not([type=checkbox]), select { min-height: 34px; }
input[type=checkbox] { accent-color: var(--brand); }
textarea { line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
.btn:focus-visible, summary:focus-visible, .issue-table-scroll:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.form-grid { gap: 0.8rem 1rem; }
.stack { gap: 0.6rem; }
.hint, .small { font-size: 0.75rem; }
.hint { margin-top: 0.65rem; }
.flash { border-radius: 5px; font-size: 0.85rem; padding: 0.6rem 0.8rem; }
.issue-header { flex-wrap: nowrap; align-items: flex-start; }
.issue-header > .actions { flex-shrink: 0; padding-top: 1.65rem; }
.issue-summary { flex: 1; width: auto; }
.issue-settings { margin-top: 0.6rem; }
.issue-settings-panel { background: #fff; padding: 0.85rem; border-radius: 6px; }
.issue-meta-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.issue-meta-form .form-actions { margin-top: 0; }
.table { font-size: 0.85rem; }
.table th, .table td { padding: 0.5rem 0.65rem; }
.table td { vertical-align: middle; }
.table th { font-size: 0.68rem; letter-spacing: 0.055em; }
.table td a strong { font-weight: 600; }
.table tbody tr:hover { background: #f6f9fa; }
.table-tools th[data-col] { min-width: 6.25rem; }
.issue-articles th:first-child { width: 36%; min-width: 13rem; }
.issue-articles th:last-child { width: 1%; }
.issue-articles td:last-child { font-size: 0.75rem; white-space: nowrap; }
.issue-articles thead th,
.issue-articles.filters-stuck thead th::before { background: #f5f8fa; }
.table-tools .th-sort { margin-bottom: 0.3rem; font-weight: 650; }
.table-tools .th-filter { border-radius: 4px; padding: 0.3rem 0.4rem; font-size: 0.75rem; min-height: 30px; }
.pill { padding: 0.15rem 0.45rem; font-size: 0.7rem; font-weight: 600; border-radius: 4px; white-space: nowrap; }
.issue-articles td[data-value="frei"] .pill { color: #246447; background: #e5f3eb; }
.issue-articles td[data-value="zur Freigabe"] .pill { color: #84436c; background: #f5eaf2; }
.pill.status-arbeit { color: #79591e; background: #fbf1da; }
.badge { border-radius: 3px; font-size: 0.6rem; }
.issue-archive { margin-top: 0.85rem; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0.85rem 0; font-size: 0.75rem; }
.issue-archive h2 { font-size: 0.8rem; }
.issue-archive .btn { font-size: 0.75rem; }
.article-page-header { background: #fff; border-radius: 6px; padding: 0.85rem 1rem; box-shadow: 0 2px 0 #e8edf1; margin-bottom: 0.85rem; }
.article-page-header .page-head { margin-bottom: 0.65rem; }
.article-page-header h1 { font-size: 1.4rem; }
.article-page-header .breadcrumb { margin-bottom: 0.25rem; }
.article-command-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.article-navigation-hint { margin: 0 0 0 auto; font-size: 0.7rem; white-space: nowrap; }
#article-edit-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-title-field, .article-content-field { grid-column: span 2; }
.rubrik-field { gap: 0.25rem; }
.material-panel { margin-top: 0.85rem; }
.material-panel > p, #audio-material > p { margin: 0.4rem 0 0.75rem; font-size: 0.8rem; }
.material-grid { gap: 0.85rem; margin-top: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.material-block { min-width: 0; padding: 0.8rem; border-radius: 5px; background: #fafcfd; }
.material-block h3 { font-size: 0.85rem; }
.material-block p { margin: 0.4rem 0; }
.file-row { border-radius: 4px; padding: 0.45rem 0.55rem; }
.file-upload-label { min-width: 0; flex-basis: 100%; font-size: 0.75rem; }
input[type=file] { max-width: 100%; font-size: 0.75rem; padding: 0.35rem; }
input[type=file]::file-selector-button { border: 0; border-radius: 3px; padding: 0.25rem 0.4rem; background: #eaf0f3; color: var(--ink); margin-right: 0.4rem; }
#audio-material { margin-top: 0.85rem; }
#audio-material h2 { margin: 0 0 0.5rem; }
#audio-material .stack { max-width: 46rem; }
#audio-material input[type=checkbox] { width: auto; }
@media (max-width: 1000px) {
  .topbar-inner { gap: 1rem; }
  .material-grid { grid-template-columns: 1fr; }
  #article-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-title-field, .article-content-field { grid-column: auto; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; padding: 0.5rem 1rem; gap: 0.4rem 1rem; }
  .topbar-user { width: 100%; justify-content: space-between; }
  .main { padding: 0.85rem 1rem 2rem; }
  .issue-header { flex-direction: column; }
  .issue-header > .actions { padding-top: 0; }
  .issue-summary { width: 100%; }
  .issue-meta-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-table-scroll { overflow: auto; max-height: 65vh; }
  .issue-articles { min-width: 820px; }
  .issue-articles thead th { top: 0; }
  .issue-articles.filters-stuck thead th::before { display: none; }
  .article-page-header { padding: 0.65rem 0.75rem; }
  .article-page-header h1 { font-size: 1.15rem; }
  .article-navigation-hint { margin-left: 0; }
}
@media (max-width: 520px) {
  #article-edit-form, .issue-meta-form { grid-template-columns: minmax(0, 1fr); }
  .btn { min-height: 38px; }
  .panel { padding: 0.85rem; }
}


/* Shared lists, administration and sign-in. */
.panel { min-width: 0; }
.panel h2 { margin: 0 0 0.75rem; }
.main > .panel + .panel, .main > .grid-2 + .panel { margin-top: 0.85rem; }
.grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
.page-head > div { min-width: 0; }
.page-head h1, .list strong, .table td, .view-platform .panel a { overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll .table { min-width: 440px; }
.view-title .table-scroll .table { min-width: 560px; }
.table-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.list a { padding: 0.65rem 0.25rem; }
.list .meta { font-size: 0.75rem; margin-top: 0.15rem; }
.rubrik-list li { padding: 0.4rem 0; }
.auth-card { border-radius: 8px; padding: 1.5rem; box-shadow: none; }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -0.025em; }
.auth-card .eyebrow { color: var(--brand); }
.view-company .panel-wide { max-width: 46rem; }
/* Remove browser-specific select text insets so both rubric values line up. */
.rubrik-field .rubrik-preset {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m4 5 3 3 3-3' fill='none' stroke='%2360717e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: right 0.55rem center;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.rubrik-field .rubrik-preset, .rubrik-field .rubrik-input {
  padding-left: 0.75rem;
  text-indent: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
}
/* Compact editor chrome, with the manuscript kept at a readable size. */
.manuscript-workspace { padding: 0.85rem; }
#manuscript-status { font-size: 0.8rem; }
.manuscript-actions { margin-bottom: 0.5rem; }
.manuscript-statistics { font-size: 0.75rem; margin: 0.4rem 0; }
#manuscript-toolbar { background: #f5f8fa; border-color: var(--line); border-radius: 5px 5px 0 0; }
#manuscript-editor { border-color: var(--line); }
#manuscript-editor .ql-editor { font-size: 1rem; line-height: 1.65; padding: 1rem; }
.manuscript-find { background: #f5f8fa; padding: 0.5rem 0.65rem; border-radius: 5px; margin-bottom: 0.75rem; }
.manuscript-find summary { font-size: 0.8rem; }
.manuscript-find .manuscript-find-body { margin-top: 0.6rem; }
.manuscript-find .manuscript-case { font-size: 0.8rem; }
.manuscript-versions li { padding: 0.6rem 0; }
.manuscript-render, .manuscript-diff { border-radius: 5px; }
.manuscript-sections h3 { font-size: 0.9rem; }
#manuscript-ai-form { max-width: 56rem; }
#manuscript-app .ql-tooltip input { min-height: 0; }
/* Blattplan keeps its page proportions and drag/drop targets. */
.spreads { grid-auto-rows: max-content; align-content: start; row-gap: 1.25rem; }
.spread { align-items: start; }
.blatt-head { margin-bottom: 0.75rem; }
.legend { font-size: 0.75rem; gap: 0.5rem 0.85rem; margin-bottom: 0.75rem; }
.legend-item i { width: 11px; height: 11px; border-radius: 3px; }
.pool-list { gap: 0.4rem; margin-top: 0.6rem; }
.pool-item { border-radius: 5px; padding: 0.45rem 0.55rem; }
.pool-item strong { font-size: 0.85rem; }
.pool-item-top, .pool-item-meta { font-size: 0.7rem; }
.blatt-progress { border-radius: 5px; font-size: 0.75rem; }
.modal-dialog { border-radius: 8px; }
.modal-head h2 { font-family: var(--font); font-size: 1.1rem; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  #manuscript-editor .ql-editor { padding: 0.8rem; }
  .manuscript-compare-controls label { min-width: 0; flex-basis: 100%; }
  .topbar nav { gap: 0.75rem; }
}

.delete-project { position: relative; }
.delete-project summary { list-style: none; cursor: pointer; }
.delete-project summary::-webkit-details-marker { display: none; }
.delete-project-panel {
  position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 25;
  width: min(25rem, calc(100vw - 2rem)); background: #fff;
  box-shadow: 0 8px 28px rgba(32,46,56,0.14);
}
.delete-project-panel p { font-size: 0.8rem; }
.delete-project-panel .btn-danger { border-color: #efc7ce; background: #fff1f2; }
@media (max-width: 900px) { .delete-project-panel { right: auto; left: 0; } }


.tenant-delete { margin-top: 0.35rem; }
.tenant-delete summary { list-style: none; cursor: pointer; }
.tenant-delete summary::-webkit-details-marker { display: none; }
.tenant-delete-panel { margin-top: 0.5rem; padding: 0.75rem; border: 1px solid #efc7ce; border-radius: 5px; background: #fffafb; }
.tenant-delete-panel p { font-size: 0.8rem; }
.tenant-delete-panel .btn-danger { background: #fff1f2; border-color: #efc7ce; }

@media (max-width: 760px) {
  .view-platform .table-scroll { overflow: visible; }
  .view-platform .table-scroll .table { min-width: 0; display: block; }
  .view-platform .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .view-platform .table tbody { display: block; }
  .view-platform .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .view-platform .table td { border: 0; padding: 0.25rem 0; }
  .view-platform .table td:last-child { grid-column: 1 / -1; }
}

#issue-archive { scroll-margin-top: 5rem; }

#audio-material { scroll-margin-top: calc(var(--article-toolbar-offset, 12rem) + 1rem); }
