@import url('/appearance-fonts.css');
@import url('/licences.css');
@import url('/appearance-palettes.css');
@import url('/appearance-foundation.css');
@import url('/appearance-layouts.css');
@import url('/appearance-controls.css');
@import url('/theme-shell.css');
@import url('/theme-sheet.css');
@import url('/theme-variants.css');
@import url('/theme-arcane-stone.css');
@import url('/theme-desktop.css');
@import url('/theme-equipment.css');
@import url('/theme-details-journal.css');
@import url('/theme-details-prism.css');
@import url('/theme-details-folio.css');
@import url('/theme-details-atlas-ledger.css');
@import url('/theme-details-saga.css');
@import url('/theme-material-frames.css');
@import url('/theme-material-surfaces.css');
@import url('/workspace-layout.css');
/* Shared Oserym UI. Print dossiers retain their own export typography. */
@media screen {
  :root {
    --shadow: 0 8px 24px #00000012;
    --ui-font: 'Source Sans 3', system-ui, sans-serif;
    --heading-font: 'EB Garamond', Georgia, serif;
  }
  html {
    scrollbar-color: var(--line) var(--bg);
  }
  body {
    font-family: var(--ui-font) !important;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text) !important;
    background:
      radial-gradient(
        ellipse at 50% 0%,
        color-mix(in srgb, var(--accent) 8%, transparent),
        transparent 65%
      ),
      var(--bg) !important;
  }
  body :is(h1, h2, h3, h4):not(.oserym-dossier *) {
    font-family: var(--heading-font) !important;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
  }
  body :is(button, input, select, textarea) {
    font-family: var(--ui-font);
    font-size: inherit;
  }
  body :is(a, button, input, textarea, select):focus-visible {
    outline: 2px solid var(--gold) !important;
    outline-offset: 3px;
  }
  body ::selection {
    color: var(--on-accent);
    background: var(--gold);
  }
  body :is(.muted, .intro-copy, .gm-landing > p, .section-name, .side-title) {
    color: var(--muted);
  }
  body a:not(.role-card):not(.oserym-dossier *) {
    color: var(--gold);
  }
  body
    :is(
      .btn,
      .smallbtn,
      .home-back,
      .filters button,
      .pager button,
      .gm-note button,
      #login button,
      .image-upload,
      dialog button
    ) {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel2);
    color: var(--text);
    min-height: 36px;
    padding: 8px 12px;
    line-height: 1.3;
    vertical-align: middle;
  }
  body
    :is(.btn, .smallbtn, .filters button, .pager button, dialog button):hover {
    background: var(--panel3);
    border-color: var(--gold);
  }
  body
    :is(
      .btn.primary,
      button.primary,
      #login button[type='submit'],
      #login button:not([type])
    ) {
    background: var(--gold) !important;
    color: var(--on-accent) !important;
    border-color: var(--gold);
    font-weight: 600;
  }
  body
    :is(button.danger, .btn.danger, .deny, [data-character-action='delete']) {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-bg);
  }
  body :is(.approve, .btn.good) {
    color: var(--success);
    border-color: var(--success);
    background: var(--success-bg);
  }
  body button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  body
    :is(
      input:not([type='checkbox']):not([type='radio']):not([type='range']):not(
          [type='file']
        ),
      select,
      textarea
    ) {
    color: var(--text) !important;
    background: var(--bg2) !important;
    border-color: var(--line) !important;
    border-radius: 8px;
    line-height: 1.5;
    padding: 10px 12px;
    max-width: 100%;
    box-sizing: border-box;
  }
  body :is(input, textarea)::placeholder {
    color: var(--muted);
    opacity: 1;
  }
  body :is(input[type='checkbox'], input[type='radio'], input[type='range']) {
    accent-color: var(--gold);
  }
  body
    :is(
      .card,
      .gm-card,
      .gm-note,
      .item-card,
      .item-detail,
      .shared-content-card,
      .shared-manager,
      .image-reference-panel,
      .delete-dialog-card
    ) {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  body :is(dialog, .dialog-card, .oserym-import-dialog) {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--line2) !important;
    border-radius: 12px;
    box-shadow: 0 24px 70px #0008;
  }
  dialog::backdrop {
    background: #020b08c9;
    backdrop-filter: blur(4px);
  }
  body .section-title {
    background: #ffffff03;
    border-color: var(--line);
  }
  body .sidebar {
    background: var(--bg2);
    border-color: var(--line);
  }
  body .nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: var(--muted);
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.3;
    font-size: 13px;
  }
  body .nav button.active {
    color: var(--gold);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-left-color: var(--gold);
  }
  body .nav button:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--text);
  }
  body .nav .ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 1;
  }
  body .topnav {
    gap: 8px;
    border-color: var(--line);
  }
  body .topnav button {
    font: 500 13px/1.3 var(--ui-font);
    min-height: 38px;
    border-radius: 8px;
    color: var(--muted);
  }
  body :is(.topnav button.active, button[aria-current='page']) {
    color: var(--gold);
    border-color: var(--gold);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
  }
  .oserym-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  body :is(.nav .ico, .gm-card .symbol, .home-icon-tile) {
    color: var(--gold);
  }
  body :is(.sitebar, .database-sitebar) {
    box-sizing: border-box;
    min-height: 56px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
    font: 13px/1.3 var(--ui-font);
    color: var(--gold);
    max-width: none;
    margin: 0;
    flex-wrap: wrap;
  }
  body .sitebar .links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  body .sitebar :is(a, button) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 8px;
    line-height: 1.3;
    font: inherit;
    color: var(--gold);
    text-decoration: none;
    background: transparent;
    border: 0;
  }
  body :is(.brand h1, .home-brand h1, .wordmark) {
    font: 400 24px/1.2 var(--heading-font) !important;
    letter-spacing: 0.19em;
    color: var(--gold) !important;
  }
  body :is(.brand small, .home-brand small) {
    font: 500 10px/1.4 var(--ui-font);
    letter-spacing: 0.14em;
    color: var(--accent-secondary, var(--muted));
  }
  body :is(.brandmark, .home-brandmark) {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line2);
    border-radius: 10px;
    color: var(--gold);
    background: var(--bg2);
  }
  /* The d20 brand mark, drawn in the surrounding text colour. */
  body :is(.brandmark, .home-brandmark) svg {
    width: 64%;
    height: 64%;
  }
  .brand-d20 {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    vertical-align: -0.22em;
  }
  /* Add-character tile: the d20 brand mark with a plus badge. */
  .add-character-art {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--bg2);
    color: var(--accent);
    stroke-linecap: round;
  }
  .add-character-art .ac-d20 {
    overflow: visible;
    transition: color 0.16s ease;
  }
  .add-character-art .ac-badge {
    fill: var(--bg2);
    stroke: var(--accent);
    stroke-width: 2.5;
  }
  .add-character-art .ac-plus {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
  }
  .home-icon-tile:is(:hover, :focus-visible) .add-character-art {
    color: var(--accent2);
  }
  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  body .banner {
    background: var(--bg2);
    border-color: var(--line);
    min-height: 72px;
    height: auto;
    padding: 14px 24px;
    box-shadow: none;
  }
  body .home-shell {
    background: transparent;
    min-height: calc(100vh - 56px) !important;
  }
  body .home-inner {
    min-height: calc(100vh - 56px) !important;
    padding: 40px 24px;
  }
  body .home-brand {
    max-width: 1050px;
    padding-bottom: 24px;
    border-color: var(--line);
  }
  body :is(.entry, .gm-landing) {
    padding-top: 48px;
  }
  body :is(.entry h1, .gm-landing h1) {
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.15;
  }
  body .gm-landing {
    max-width: 1100px;
  }
  body .gm-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 24px;
    min-width: 0;
  }
  body .gm-card .symbol {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  body .gm-card .symbol .oserym-icon {
    width: 28px;
    height: 28px;
  }
  body .gm-card strong {
    font: 400 24px/1.2 var(--heading-font);
    color: var(--text);
    margin: 0 0 10px;
  }
  body .gm-card p {
    font: 13px/1.6 var(--ui-font);
    color: var(--muted);
    margin: 0;
  }
  body .home-grid {
    width: min(720px, 100%);
    gap: 24px;
    margin: 48px auto;
  }
  body .home-grid .tile-entry {
    filter: none;
  }
  body .home-grid .square-tile {
    display: grid;
    place-items: center;
    background: var(--panel) !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    box-shadow: var(--shadow);
    transition:
      border-color 0.15s,
      transform 0.15s;
  }
  body .home-icon-tile .oserym-icon {
    width: clamp(44px, 7vw, 72px);
    height: clamp(44px, 7vw, 72px);
  }
  body .home-grid .tile-label {
    font: 400 24px/1.2 var(--heading-font);
    letter-spacing: 0;
    margin-top: 16px;
  }
  body :is(.gm-card, .home-grid .square-tile, .role-card):hover {
    border-color: var(--gold) !important;
    transform: translateY(-3px);
  }
  body .role-card {
    background: var(--panel);
    border-color: var(--line);
    border-radius: 12px;
    color: var(--gold);
  }
  body .role-card > svg {
    display: block;
    margin: auto;
  }
  body > .gm-note {
    margin: 10px auto !important;
    padding: 10px 16px !important;
    width: calc(100% - 32px);
    box-shadow: none !important;
    border-radius: 8px;
  }
  body .gm-note {
    font-size: 13px;
    padding: 16px 20px;
    line-height: 1.6;
  }
  body .gm-note > button {
    margin: 4px 0 4px 8px;
  }
  body.database-page > main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 24px;
  }
  body.database-page main > .panel {
    background: var(--panel);
    border-color: var(--line);
    border-radius: 12px;
  }
  body.database-page h1 {
    font-size: clamp(30px, 4vw, 42px);
  }
  body.database-page .filters {
    gap: 12px;
  }
  body.database-page nav.filters {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  body.database-page th {
    color: var(--muted);
    font-size: 12px;
  }
  body.database-page :is(td, th) {
    border-color: var(--line);
  }
  body.database-page .actions {
    align-items: center;
  }
  body.database-page .actions button {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  body #login label {
    font: 500 13px/1.5 var(--ui-font);
    color: var(--muted);
    display: block;
    text-align: left;
  }
  body #login #error {
    color: var(--danger);
  }
  @media (max-width: 700px) {
    body :is(.sitebar, .database-sitebar) {
      padding: 10px 14px;
      gap: 8px;
    }
    body .home-inner {
      padding: 28px 16px;
    }
    body .home-grid {
      gap: 12px;
    }
    body .home-grid .tile-label {
      font-size: 18px;
    }
    body .gm-landing {
      padding: 28px 16px;
    }
    body .gm-landing .gm-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body .gm-card {
      padding: 16px;
    }
    body .gm-card strong {
      font-size: 21px;
    }
    body.database-page > main {
      padding: 24px 14px;
    }
    body .gm-note > button {
      margin-left: 0;
    }
    body .banner {
      padding: 12px 16px;
    }
  }
  @media (max-width: 420px) {
    body .gm-landing .gm-grid {
      grid-template-columns: 1fr;
    }
    body .home-grid {
      gap: 8px;
    }
    body .home-grid .tile-label {
      font-size: 16px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    body *,
    body *::before,
    body *::after {
      scroll-behavior: auto !important;
      transition: none !important;
      animation: none !important;
    }
  }
}
