:root {
  font-family: system-ui, "Segoe UI", -apple-system, sans-serif;
  color: #1e293b;
  background: #e2e8f0;
  font-size: 14px;
  accent-color: #d62828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #e2e8f0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button, select, input:not([type=checkbox]):not([type=range]), textarea {
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px 11px;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

button {
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
}

button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:hover:enabled {
  background: #f8fafc;
  border-color: #94a3b8;
}

button.primary, .title-actions #save, button.primary-sm {
  background: #d62828;
  color: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 1px 2px rgba(214, 40, 40, 0.25);
}

button.primary:hover:enabled, .title-actions #save:hover:enabled, button.primary-sm:hover:enabled {
  background: #b91c1c;
  border-color: #991b1b;
}

button.danger-btn {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

button.danger-btn:hover:enabled {
  background: #fee2e2;
  border-color: #f87171;
}

button:disabled {
  opacity: 0.42;
  cursor: default;
}

:focus-visible {
  outline: 2px solid #d62828;
  outline-offset: 2px;
}

button[aria-pressed=true] {
  background: #fff1f2;
  border-color: #d62828;
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px #d62828;
}

label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

input[type=number] {
  width: 76px;
  font-weight: 500;
  color: #1e293b;
}

input[type=search] {
  width: 165px;
  font-weight: 500;
  color: #1e293b;
}

input[type=color] {
  width: 52px;
  padding: 3px;
  cursor: pointer;
}

/* TITLEBAR (Word / Office Header) */
.titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: #ffffff;
  border-top: 4px solid #d62828;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #d62828;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(214, 40, 40, 0.25);
}

.brand-text h1 {
  font-size: 21px;
  line-height: 1.05;
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.brand-text small {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.quick-access {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 12px;
  border-left: 1px solid #e2e8f0;
}

.quick-access button {
  padding: 6px;
  border-color: transparent;
  background: transparent;
  color: #475569;
}

.quick-access button:hover:enabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.doc-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  max-width: 440px;
  margin: 0 auto;
}

.doc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d62828;
  flex-shrink: 0;
}

#document-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* RIBBON (Office / Acrobat Style) */
.ribbon {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.ribbon-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.ribbon-tabs button {
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  min-width: 92px;
  min-height: 44px;
  padding: 8px 16px;
  color: #475569;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.ribbon-tabs button:hover:enabled {
  color: #0f172a;
  background: #f1f5f9;
}

.ribbon-tabs button[aria-selected=true] {
  color: #d62828;
  border-bottom-color: #d62828;
  background: #ffffff;
  font-weight: 700;
}

.ribbon-panels section {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  min-height: 108px;
  padding: 8px 16px 6px;
  gap: 14px;
  background: #ffffff;
}

.ribbon-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #e2e8f0;
  padding-right: 14px;
  flex-shrink: 0;
}

.ribbon-group:last-child {
  border-right: 0;
}

.group-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.group-tools > button {
  flex-direction: column;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  padding: 6px 10px;
  min-height: 62px;
  border-radius: 6px;
  color: #1e293b;
}

.group-tools > button:hover:enabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.group-tools > button[aria-pressed=true] {
  background: #fff1f2;
  border-color: #d62828;
  color: #b91c1c;
}

.group-tools > button[data-stamp="geprueft"] svg,
.group-tools > button[data-symbol="check"] svg,
.group-tools > button[data-symbol="pe"] svg,
#quick-stamp-ok svg {
  color: #15803d;
}

.group-tools > button[data-stamp="mangel"] svg,
.group-tools > button[data-symbol="cross"] svg,
.group-tools > button[data-symbol="measure"] svg,
#ribbon-add-circuit svg,
#ribbon-add-circuit-5 svg {
  color: #d62828;
}

.group-tools > button[data-stamp="freigegeben"] svg,
.group-tools > button[data-symbol="socket"] svg,
.group-tools > button[data-symbol="switch"] svg,
.group-tools > button[data-symbol="lamp"] svg,
.group-tools > button[data-tool="edit-pdf"] svg {
  color: #1d4ed8;
}

.group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
  color: #64748b;
  margin-top: 4px;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}

.swatch {
  position: relative;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #94a3b8;
}

.swatch::after {
  content: "";
  position: absolute;
  inset: -7px;
}

.swatch:hover:enabled {
  transform: scale(1.1);
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 195px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* PRIVACY / DOCUMENT INFO & PROTOCOL BAR */
.document-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  font-size: 12px;
  color: #475569;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.privacy {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shield-badge {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

.protocol-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.protocol-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.protocol-bar button {
  min-height: 32px;
  min-width: 36px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

#offline-status {
  white-space: nowrap;
  font-weight: 600;
  color: #1d4ed8;
}

/* CONTEXTUAL SELECTION BAR */
.selection {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  max-height: 28vh;
  overflow: auto;
  flex-shrink: 0;
}

.selection textarea {
  width: 240px;
}

/* WORKSPACE: THUMBNAILS + VIEWER */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #cbd5e1;
}

.workspace.dragover {
  outline: 3px dashed #d62828;
  outline-offset: -3px;
}

#thumbnails {
  width: 168px;
  background: #f8fafc;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-title {
  padding: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-title button {
  width: 100%;
  background: transparent;
  border: 0;
  color: #334155;
}

#page-list {
  padding: 10px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

#page-list button {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 12px;
  padding: 7px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #f1f5f9;
  font-weight: 600;
  font-size: 12px;
  color: #475569;
  gap: 6px;
}

#page-list button:hover:enabled {
  background: #e2e8f0;
}

#page-list button.active {
  border-color: #d62828;
  background: #ffffff;
  color: #d62828;
  box-shadow: 0 2px 6px rgba(214, 40, 40, 0.15);
}

#page-list canvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
  border-radius: 2px;
}

#thumbnails.collapsed {
  width: 58px;
}

#thumbnails.collapsed #page-list {
  display: none;
}

#thumbnails.collapsed .sidebar-title button {
  flex-direction: column;
  font-size: 11px;
  padding: 4px;
}

#viewer {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 24px;
  position: relative;
  overscroll-behavior: contain;
}

/* START SCREEN / BACKSTAGE (#empty) */
#empty {
  margin: 2vh auto;
  max-width: 840px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #d62828;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  color: #475569;
}

.empty-hero {
  text-align: center;
  padding-bottom: 22px;
  border-bottom: 1px solid #e2e8f0;
}

.empty-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #d62828;
  background: #fff1f2;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

#empty h2 {
  color: #0f172a;
  font-size: 24px;
  margin: 6px 0 8px;
}

#empty p {
  margin: 0 auto 16px;
  max-width: 560px;
  line-height: 1.5;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.template-section {
  padding-top: 18px;
}

.template-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin: 0 0 12px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.template-card {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #d62828;
  border-radius: 8px;
  background: #f8fafc;
  gap: 6px;
}

.template-card:hover:enabled {
  background: #fff1f2;
  border-color: #d62828;
}

.template-card strong {
  color: #0f172a;
  font-size: 14px;
}

.template-card span {
  font-weight: 400;
  font-size: 12.2px;
  color: #475569;
  line-height: 1.4;
}

.template-card sub {
  font-size: 0.76em;
  font-weight: 600;
  line-height: 0;
}

.template-card i {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

.empty-footer {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: #64748b;
}

/* PDF PAGE CANVAS & OVERLAYS */
.page-shell {
  position: relative;
  margin: 0 auto 20px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
}

.page-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
}

/* PDF EXISTING TEXT EDIT LAYER */
.pdf-text-layer {
  pointer-events: none;
}

.page-shell.editing-pdf .pdf-text-layer {
  pointer-events: auto;
}

.pdf-text-item {
  position: absolute;
  transform-origin: 0 0;
  border: 1px dashed transparent;
  background: transparent;
  padding: 0;
  margin: 0;
  min-width: 8px;
  min-height: 8px;
  cursor: text;
  pointer-events: auto;
  border-radius: 2px;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.page-shell.editing-pdf .pdf-text-item {
  border-color: rgba(29, 78, 216, 0.45);
  background: rgba(219, 234, 254, 0.22);
  cursor: pointer;
}

.pdf-text-item:hover {
  border-color: #d62828 !important;
  background: rgba(254, 226, 226, 0.45) !important;
}

/* ON-PAGE ADD CIRCUIT FLOATING BAR */
.onpage-add-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid #d62828;
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 0 4px 14px rgba(214, 40, 40, 0.22);
  z-index: 15;
  pointer-events: auto;
}

.onpage-add-bar button {
  min-height: 30px;
  min-width: 34px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.objects {
  pointer-events: none;
}

.object {
  position: absolute;
  transform-origin: 0 0;
  white-space: pre;
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1;
  pointer-events: auto;
  cursor: move;
  user-select: none;
}

.object.whiteout-box {
  background: #ffffff;
  padding: 1px 2px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.object.selected {
  outline: 2px dashed #d62828;
  outline-offset: 2px;
}

.object .resize-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: #d62828;
  border: 2px solid #ffffff;
  border-radius: 50%;
  cursor: nwse-resize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.object .resize-handle::after {
  content: "";
  position: absolute;
  inset: -14px;
}

.object img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.drawing {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.drawing path.selectable-stroke {
  pointer-events: stroke;
  cursor: pointer;
}

.drawing.selected path {
  filter: drop-shadow(0 0 3px rgba(214, 40, 40, 0.8));
}

.form-field {
  position: absolute;
  transform-origin: 0 0;
  min-height: 0 !important;
  padding: 1px 3px !important;
  border: 1px solid rgba(100, 116, 139, 0.65) !important;
  border-radius: 2px !important;
  background: rgba(239, 246, 255, 0.72) !important;
  color: #0f172a !important;
  font-family: Helvetica, Arial, sans-serif;
}

.form-field:focus {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: #d62828 !important;
  z-index: 5;
}

.form-field[type=checkbox], .form-field[type=radio] {
  margin: 0;
  cursor: pointer;
}

.page-shell.inking {
  touch-action: none;
  cursor: crosshair;
}

.page-shell.placing {
  cursor: crosshair;
}

.page-shell .object {
  touch-action: none;
}

/* STATUSBAR */
.statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 16px;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
  min-height: 46px;
  flex-shrink: 0;
  font-size: 12.5px;
}

.status-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-nav-btn {
  min-width: 34px;
  min-height: 34px;
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
}

#status-page {
  white-space: nowrap;
  font-weight: 700;
  color: #0f172a;
}

#status {
  flex: 1;
  min-width: 0;
  max-height: 52px;
  overflow: auto;
  color: #334155;
}

#status.error {
  color: #b91c1c;
  font-weight: 700;
}

.zoom-control {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.zoom-control input {
  width: 125px;
  padding: 0;
  min-height: 44px;
  border: 0;
}

.zoom-control output {
  min-width: 85px;
  font-weight: 600;
  color: #0f172a;
}

/* DIALOGS */
dialog {
  border: 1px solid #cbd5e1;
  border-top: 4px solid #d62828;
  border-radius: 10px;
  width: min(720px, 95vw);
  padding: 22px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

dialog h2 {
  margin-top: 0;
  color: #0f172a;
}

dialog p {
  font-size: 14px;
  color: #475569;
}

.sig-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.sig-colors {
  display: flex;
  gap: 8px;
}

.sig-color {
  color: #ffffff;
  font-size: 12px;
  padding: 6px 12px;
  min-height: 44px;
  border: 2px solid transparent;
}

.sig-color.active {
  outline: 2px solid #d62828;
  outline-offset: 2px;
}

#signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  touch-action: none;
  background: #ffffff;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}

[hidden] {
  display: none !important;
}

body.busy button, body.busy input, body.busy select, body.busy textarea {
  pointer-events: none;
}

body.busy .workspace {
  pointer-events: none;
}

body.busy {
  cursor: progress;
}

/* MOBILE & TABLET (< 900px) */
@media (max-width: 899px) {
  .titlebar {
    padding: 6px 10px;
    gap: 8px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }
  .brand-text h1 {
    font-size: 19px;
  }
  .brand-text small {
    font-size: 10.5px;
  }
  .quick-access,
  #company-profile-btn,
  #export-word-top,
  #print-pdf {
    display: none;
  }
  .title-actions {
    gap: 4px;
  }
  .title-actions button {
    padding: 7px 10px;
  }
  .title-actions button svg {
    display: none;
  }
  .doc-pill {
    padding: 4px 10px;
  }
  #document-name {
    font-size: 12px;
  }
  .document-info {
    padding: 4px 10px;
    font-size: 11px;
    gap: 6px;
  }
  #offline-status {
    display: none;
  }
  .ribbon {
    order: 5;
    border-top: 1px solid #cbd5e1;
    border-bottom: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ribbon-tabs {
    order: 2;
    padding: 0 4px;
    gap: 0;
    border: 0;
    flex-shrink: 0;
  }
  .ribbon-tabs button {
    flex: 1;
    min-width: 60px;
    padding: 6px 6px;
    font-size: 12.5px;
    border-radius: 0;
    border-bottom: 0;
    border-top: 3px solid transparent;
  }
  .ribbon-tabs button[aria-selected=true] {
    border-top-color: #d62828;
  }
  .ribbon-panels section {
    min-height: 92px;
    max-height: 22dvh;
    padding: 6px 10px;
  }
  .group-tools {
    gap: 4px;
  }
  .group-tools > button {
    min-height: 54px;
    padding: 5px 8px;
  }
  .ribbon-panels {
    border-bottom: 1px solid #e2e8f0;
  }
  .group-label {
    margin-top: 2px;
    font-size: 10px;
  }
  .statusbar {
    gap: 6px;
    padding: 0 8px;
    flex-wrap: wrap;
    min-height: 44px;
  }
  .status-nav-btn {
    min-width: 28px;
    min-height: 28px;
    padding: 2px 6px;
    font-size: 14px;
  }
  .zoom-control {
    margin-left: auto;
    font-size: 11px;
    gap: 4px;
  }
  .zoom-control input {
    width: 64px;
  }
  .zoom-control output {
    min-width: 52px;
  }
  #status {
    order: 3;
    flex-basis: 100%;
    max-height: 28px;
    padding-bottom: 3px;
    font-size: 11.5px;
  }
  .workspace {
    min-height: 80px;
    position: relative;
  }
  #viewer {
    padding: 10px;
  }
  #empty {
    margin: 1vh auto;
    padding: 14px;
  }
  #empty h2 {
    font-size: 18px;
  }
  #thumbnails {
    width: 118px;
  }
  #thumbnails.collapsed {
    width: 46px;
  }
  .sidebar-title {
    padding: 2px;
  }
  #page-list {
    padding: 5px;
  }
  .selection {
    max-height: 20dvh;
    padding: 5px 8px;
  }
  .selection textarea {
    width: 160px;
  }
  dialog {
    padding: 15px;
  }
  #signature-canvas {
    height: 150px;
  }
}

@media (max-width: 430px) {
  .doc-pill {
    display: none;
  }
  .title-actions {
    margin-left: auto;
  }
  .titlebar {
    gap: 6px;
  }
  .zoom-control input {
    width: 48px;
  }
  .shield-badge {
    display: none;
  }
  .privacy {
    display: none;
  }
}
