/* Shared interactive-page theme. Print documents retain their paper layout. */
@media screen {
  .app-theme {
    --wp-paper:#fffefa;--wp-surface:#fff;--wp-soft:#f3f6fa;--wp-border:#dce4ee;
    --wp-ink:#2d425c;--wp-muted:#667b94;--wp-blue:#245c9c;--wp-hover:#e5eef9;
    --app-font:system-ui,-apple-system,"Segoe UI",sans-serif;
    font-family:var(--app-font);font-size:13px;color:var(--wp-ink);
    max-width:1648px;margin-inline:auto;
  }
  [data-theme="dark"] .app-theme {
    --wp-paper:#101e32;--wp-surface:#14243a;--wp-soft:#203149;--wp-border:#31445f;
    --wp-ink:#e0eaf7;--wp-muted:#adbed3;--wp-blue:#a8ccfa;--wp-hover:#2b425c;
    color-scheme:dark;
  }
  .app-theme .theme-shell {
    background:var(--wp-paper);border:1px solid var(--wp-border);border-radius:14px;
    padding:26px 28px;margin:8px auto 24px;box-shadow:0 10px 28px #1b34500c;min-width:0;
  }
  /* Existing notebook/editor/page frames are already the approved outer panel. */
  .app-theme .theme-shell:has(.workspace-page,.vault-editor,.notebook,.vault-notebook,.notebook-list,.vault-unlock) {
    background:transparent;border:0;padding:0;box-shadow:none;
  }
  body .app-theme.app-theme :is(.workspace-page,.vault-editor) {
    font-family:var(--app-font);color:var(--wp-ink);
  }
  body .app-theme.app-theme .vault-editor {border-left:1px solid var(--wp-border)!important}
  body .app-theme.app-theme .workspace-page {padding:26px 28px!important;margin:0 auto 24px!important;max-width:1600px!important;border-left:1px solid var(--wp-border)!important}
  body .app-theme.app-theme :is(h1,h2,h3,h4,h5,h6,.btn,.form-control,.form-select,.table) {font-family:var(--app-font)!important}
  body .app-theme.app-theme :is(.workspace-page-heading,.vault-editor-heading) {padding-bottom:16px;margin-bottom:16px;gap:12px;flex-wrap:wrap}
  body .app-theme.app-theme :is(.workspace-page-heading h1,.vault-editor-heading h1,.theme-shell>h1,.theme-shell>h2,.theme-shell>h3,.theme-shell>h4,.theme-shell>.d-flex>h1,.theme-shell>.d-flex>h2,.theme-shell>.d-flex>h3,.theme-shell>.d-flex>div>h3) {font-size:27px!important;font-weight:650;line-height:1.25;letter-spacing:-.6px;color:var(--wp-ink)!important;margin-bottom:0}
  body .app-theme.app-theme :is(.card-title,.card-header h5,.card-header h6) {font-size:14px!important;font-weight:650;margin-bottom:0}
  body .app-theme.app-theme :is(.card,.modal-content,.list-group-item) {background:var(--wp-surface)!important;color:var(--wp-ink)!important;border-color:var(--wp-border)!important}
  body .app-theme.app-theme .theme-shell>.row>:is(.col-md-8,.col-lg-8,.col-md-10,.col-lg-10):only-child {margin-inline:auto}
  body .app-theme.app-theme .card {border-radius:10px;box-shadow:none!important}
  body .app-theme.app-theme :is(.card-header,.card-footer) {background:var(--wp-soft)!important;border-color:var(--wp-border)!important;color:var(--wp-ink)!important;padding:10px 16px}
  body .app-theme.app-theme .card-body {padding:16px}
  body .app-theme.app-theme :is(.form-control,.form-select,.input-group-text) {font-size:12px!important;line-height:1.5!important;padding:5px 9px!important;min-height:32px;border-radius:6px;color:var(--wp-ink)!important;background-color:var(--wp-surface)!important;border-color:var(--wp-border)!important;box-sizing:border-box}
  body .app-theme.app-theme :is(input.form-control,select.form-select,.input-group-text) {height:32px!important;min-height:32px!important}
  body .app-theme.app-theme .form-select {padding-right:28px!important}
  body .app-theme.app-theme textarea.form-control {min-height:80px;height:auto;line-height:1.6!important;resize:vertical}
  body .app-theme.app-theme :is(input[readonly],textarea[readonly],.input-group-text) {background-color:var(--wp-soft)!important}
  body .app-theme.app-theme :is(.form-control,.form-select):disabled {opacity:.7}
  body .app-theme.app-theme :is(.form-control,.form-select):focus {border-color:#7299c7!important;box-shadow:0 0 0 3px #3673b328!important}
  body .app-theme.app-theme .form-control::placeholder {color:var(--wp-muted)!important;opacity:1}
  body .app-theme.app-theme :is(.form-label,label:not(.btn):not(.form-check-label)) {font-size:12px!important;font-weight:550;color:var(--wp-muted);margin-bottom:4px}
  body .app-theme.app-theme .form-check-label {font-size:12px!important;color:var(--wp-ink)}
  body .app-theme.app-theme .btn {font-size:12px!important;line-height:1.4!important;padding:5px 9px!important;min-height:28px;border-radius:6px!important}
  body .app-theme.app-theme .btn-primary {background:#245c9c!important;border-color:#245c9c!important;color:#fff!important}
  body .app-theme.app-theme :is(.btn-outline-secondary,.btn-light) {color:var(--wp-muted)!important;border-color:var(--wp-border)!important;background:var(--wp-surface)!important}
  body .app-theme.app-theme .btn-outline-primary {color:var(--wp-blue)!important;border-color:var(--wp-blue)!important}
  body .app-theme.app-theme .btn:focus-visible {outline:2px solid var(--wp-blue);outline-offset:2px}
  body .app-theme.app-theme :is(.table,.table-sm) {--bs-table-bg:var(--wp-surface);--bs-table-color:var(--wp-ink);--bs-table-border-color:var(--wp-border);--bs-table-hover-bg:var(--wp-hover);font-size:12px!important;color:var(--wp-ink)!important}
  body .app-theme.app-theme .table :is(th,td) {font-size:12px!important;line-height:1.35;vertical-align:middle;border-color:var(--wp-border)!important}
  body .app-theme.app-theme .table th {padding:9px 12px!important;letter-spacing:0!important;text-transform:none!important;font-weight:650}
  body .app-theme.app-theme .table td {padding:6px 12px!important}
  body .app-theme.app-theme .table thead th {background:var(--wp-soft)!important;color:var(--wp-ink)!important}
  body .app-theme.app-theme .table tbody tr:nth-child(even)>:is(td,th) {--bs-table-bg:var(--wp-soft)}
  body .app-theme.app-theme .table tbody tr:hover>:is(td,th) {--bs-table-bg:var(--wp-hover)}
  body .app-theme.app-theme.app-theme.app-theme.app-theme .table tbody tr:nth-child(odd)>:is(td,th) {background:var(--wp-surface)!important}
  body .app-theme.app-theme.app-theme.app-theme.app-theme .table tbody tr:nth-child(even)>:is(td,th) {background:var(--wp-soft)!important}
  body .app-theme.app-theme.app-theme.app-theme.app-theme .table tbody tr:hover>:is(td,th) {background:var(--wp-hover)!important}
  body .app-theme.app-theme .table tfoot :is(td,th) {background:var(--wp-soft)!important;color:var(--wp-ink)}
  body .app-theme.app-theme :is(.table,.nav) .badge {font-size:9px!important;line-height:1.2;padding:3px 5px!important;border-radius:5px}
  body .app-theme.app-theme :is(.text-muted,.form-text,.text-secondary) {color:var(--wp-muted)!important}
  body .app-theme.app-theme :is(.small,small) {font-size:12px}
  body .app-theme.app-theme :is(.bg-light,.bg-white) {background-color:var(--wp-soft)!important}
  body .app-theme.app-theme :is(.nav-tabs,.nav-pills) {gap:6px;flex-wrap:wrap;border-color:var(--wp-border)}
  body .app-theme.app-theme :is(.nav-tabs,.nav-pills) .nav-link {display:inline-flex;align-items:center;gap:5px;min-height:30px;font-size:12px!important;line-height:18px;padding:5px 10px!important;border-radius:6px!important;color:var(--wp-muted)}
  body .app-theme.app-theme .nav-pills .nav-link.active {background:#245c9c;color:#fff}
  body .app-theme.app-theme .pagination {gap:4px;flex-wrap:wrap}
  body .app-theme.app-theme .page-link {font-size:12px;padding:4px 8px;border-color:var(--wp-border);background:var(--wp-surface);color:var(--wp-blue)}
  body .app-theme.app-theme .page-item.active .page-link {background:#245c9c;border-color:#245c9c;color:#fff}
  body .app-theme.app-theme :is(.dropdown-menu,.popover) {background:var(--wp-surface);border-color:var(--wp-border);color:var(--wp-ink)}
  body .app-theme.app-theme .dropdown-item {font-size:12px;color:var(--wp-ink)}
  body .app-theme.app-theme .dropdown-item:hover {background:var(--wp-hover)}
  body .app-theme.app-theme :is(.border,.border-top,.border-bottom,hr,.modal-header,.modal-footer) {border-color:var(--wp-border)!important}
  [data-theme="dark"] body .app-theme.app-theme :is(.text-dark,.text-body) {color:var(--wp-ink)!important}
  [data-theme="dark"] body .app-theme.app-theme .text-primary {color:var(--wp-blue)!important}
  [data-theme="dark"] body .app-theme.app-theme .text-success {color:#81cbb0!important}
  [data-theme="dark"] body .app-theme.app-theme .text-danger {color:#f09aab!important}
  [data-theme="dark"] body .app-theme.app-theme .form-select {--bs-form-select-bg-img:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adbed3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}
  [data-theme="dark"] body .app-theme.app-theme .btn-primary {background:#2a65aa!important;border-color:#2a65aa!important}
  body .app-theme.app-theme :is(input[type="search"],input[name="q"],input[name="search"]) {height:30px!important;min-height:30px}
  body .app-theme.app-theme :is(.vault-editor #titleInput,.vault-editor-title .form-control) {font-size:16px!important;font-weight:600}
  [data-theme="dark"] body .app-theme.app-theme [style*="background:#f8fafc"],
  [data-theme="dark"] body .app-theme.app-theme [style*="background: #f8fafc"] {background:var(--wp-soft)!important}
  .app-theme .login-card {background:var(--wp-surface);border:1px solid var(--wp-border);color:var(--wp-ink)}
  .app-theme .login-body {padding:24px}
  .app-theme .login-card .bg-portal {background:#245c9c}
  /* Preserve intentional notebook prose and descriptions; only ordinary controls are compact. */
  body .app-theme.app-theme :is(#pageEditor,#notesField,[contenteditable="true"]) {font-size:13px;line-height:1.7}
  @media(max-width:700px) {
    .app-theme {padding-inline:12px!important}
    .app-theme .theme-shell,body .app-theme.app-theme .workspace-page {padding:20px 16px!important}
    .app-theme .theme-shell:has(.workspace-page,.vault-editor,.notebook,.vault-notebook,.notebook-list,.vault-unlock) {padding:0!important}
    body .app-theme.app-theme :is(.workspace-page-heading h1,.vault-editor-heading h1,.theme-shell>h1,.theme-shell>h2,.theme-shell>h3,.theme-shell>h4) {font-size:24px!important}
    body .app-theme.app-theme :is(.theme-shell>.d-flex,.workspace-page-heading) {flex-wrap:wrap;gap:10px}
    body .app-theme.app-theme .table-responsive {max-width:100%;overflow-x:auto}
  }
}
