/* Author configuration only. Reader scenes, personalised text, VN and Webtoon
   stages deliberately stay outside these selectors. */
.da-author {
  color: var(--is-text);
  font-family: var(--is-font-ui);
  font-size: .9375rem;
  line-height: 1.5;
  text-shadow: none;
  letter-spacing: normal;
}
.da-author [hidden] { display: none !important; }
.da-author :is(button, input, select, textarea, a, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--is-focus-ring); outline-offset: 3px;
}
.da-author :is(button, input, select, textarea) { font: inherit; }
.da-author :is(h2,h3,h5) { color: var(--is-text); font-family: var(--is-font-ui); font-size: 1.05rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.da-author :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select) {
  background: var(--is-bg-soft); color: var(--is-text); border: 1px solid var(--is-border-strong); border-radius: 5px; box-shadow: none; min-height: 42px; max-width: 100%;
}
.da-author input::placeholder, .da-author textarea::placeholder { color: var(--is-text-muted); opacity: 1; }
.da-author :is(button,.btn,summary) { min-height: 42px; white-space: normal; text-shadow: none; }
.da-author :is(input,select,textarea) { accent-color: var(--is-accent); }
.da-author button:disabled { opacity: .65; cursor: wait; }
.da-author :is(button,a) { touch-action: manipulation; }
.da-author .author-kicker { color: var(--is-accent); font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.da-author .author-help, .da-author .author-preview-note { color: var(--is-text-muted); font-size: .875rem; line-height: 1.55; margin: 0 0 1rem; }
.da-author .author-preview-note { padding: .75rem 1rem; margin: 0; background: var(--is-bg-soft); }
.da-author .author-save-state { color: var(--is-text-muted); display: inline-block; font-size: .8rem; font-weight: 500; max-width: 28rem; overflow-wrap: anywhere; }
.da-author .author-save-state[data-state=dirty] { color: var(--is-warning); }
.da-author .author-save-state[data-state=saving] { color: var(--is-accent-strong); }
.da-author .author-save-state[data-state=saved] { color: var(--is-success); }
.da-author .author-save-state[data-state=error] { color: var(--is-danger); }
.da-author :is(.creator-dirty-badge,.inventory-dirty-badge) { display: none !important; } /* Permanent text status replaces the duplicate legacy badge. */
.da-author :is(.creator-sheet-save,.creator-config-save,.inventory-editor-action:not(.addInventoryObject),.btn-gold) {
  background: var(--is-action); color: var(--is-action-text); border: 1px solid var(--is-action-hover); box-shadow: none;
}
.da-author :is(.creator-sheet-save,.creator-config-save,.inventory-editor-action,.btn-gold):hover { background: var(--is-action-hover); color: var(--is-action-text); transform: none; }
.da-author :is(.creator-edit-button,.creator-small-action,.creator-config-add,.creator-config-cancel,.creator-config-close,.creator-sheet-close,.inventory-editor-close,.inventory-editor-preview,.inventory-detail-secondary,.inventory-empty-action,.inventory-editor-action.addInventoryObject,.creator-sheet-preview,.author-back-list) {
  background: var(--is-surface-strong); color: var(--is-text); border: 1px solid var(--is-border); border-radius: 5px; box-shadow: none;
}
.da-author :is(.creator-small-action.is-danger,.creator-config-remove,.btn-delete-item,.btn-delete-fantasy,.expr-delete,.relation-delete) {
  background: #3a2524; color: var(--is-danger); border: 1px solid #9b6360; box-shadow: none;
}
.da-author :is(.creator-sheet-preview,.inventory-editor-preview,.creator-config-add,.creator-config-cancel):hover { background: var(--is-surface-strong); color: var(--is-accent-strong); transform: none; }
.da-author .writer-feature-toggle { background: var(--is-bg-soft); border-color: var(--is-border); color: var(--is-text); min-height: 44px; border-radius: 5px; }
.da-author .writer-feature-toggle input { position: static; opacity: 1; width: 18px; height: 18px; }
.da-author .writer-feature-toggle:has(input:checked) { background: var(--is-surface-strong); border-color: var(--is-accent); }
.da-author .writer-feature-toggle:has(input:checked)::after { background: var(--is-accent); }
.da-author .writer-feature-toggle::before, .da-author .writer-feature-toggle::after { display: none; }
.da-author .is-invalid-soft, .da-author .has-error { border-color: var(--is-danger) !important; }
.da-author .form-check-input:checked { background-color: var(--is-action); border-color: var(--is-accent); }
.da-author .form-check-input { border-color: var(--is-border-strong); }
/* Context uses the existing detail destinations, without replacing the graph dock. */
.author-context { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 2rem; padding: .8rem max(1rem,calc((100vw - 1600px)/2)); background: var(--is-bg); border-bottom: 1px solid var(--is-border); }
.author-context-title { display: grid; min-width: 0; flex: 1 1 15rem; }
.author-context-title strong { font-size: .95rem; font-weight: 550; overflow-wrap: anywhere; }
.author-context nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.author-context nav a { padding: .5rem .75rem; border: 1px solid transparent; border-radius: 4px; font-size: .875rem; color: var(--is-text-muted); }
.author-context nav a[aria-current] { background: var(--is-surface-strong); color: var(--is-accent-strong); border-color: var(--is-border); }
.author-context [data-author-global-status]:empty { display: none; }
/* Stable sheet: one section at a time when JS is active; all sections without JS. */
#creatorSheetModal .creator-sheet-dialog { height: min(88dvh,920px); max-width: min(1180px,calc(100vw - 32px)); }
#creatorSheetModal .creator-sheet-modal, .da-author .creator-config-modal, #inventoryEditorModal .inventory-editor-modal { background: var(--is-bg); color: var(--is-text); border: 1px solid var(--is-border); box-shadow: var(--is-shadow-lg); font-family: var(--is-font-ui); }
#creatorSheetModal .creator-sheet-header { background: var(--is-bg-soft); padding: 1rem 1.25rem; border-color: var(--is-border); display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
#creatorSheetModal .creator-sheet-title { color: var(--is-text); font-size: 1.1rem; margin: .1rem 0 0; text-shadow: none; }
#creatorSheetModal .creator-sheet-actions { margin-left: auto; gap: .6rem; }
#creatorSheetModal .creator-sheet-save { padding: 0 1rem; border-radius: 5px; }
#creatorSheetModal .author-sheet-workspace { display: grid; grid-template-columns: 1fr; gap: 1rem; background: var(--is-bg); color: var(--is-text); padding: 1rem; overflow-y: auto; }
#creatorSheetModal .author-sheet-nav { display: flex; flex-wrap: wrap; align-content: start; gap: .35rem; }
#creatorSheetModal .author-sheet-nav button { color: var(--is-text-muted); background: var(--is-bg-soft); border: 1px solid var(--is-border); border-radius: 5px; padding: .55rem .75rem; text-align: left; flex: 1 1 8rem; font-size: .85rem; }
#creatorSheetModal .author-sheet-nav button[aria-current] { color: var(--is-accent-strong); background: var(--is-surface-strong); border-color: var(--is-accent); }
#creatorSheetModal .creator-sheet { display: block; }
#creatorSheetModal .creator-sheet-section, #creatorSheetModal .author-sheet-settings { background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border); border-radius: 6px; box-shadow: none; padding: 1rem; }
#creatorSheetModal .creator-sheet-section::before { display: none; }
#creatorSheetModal .creator-section-header { border-color: var(--is-border); padding: 0 0 1rem; gap: .65rem; }
#creatorSheetModal .creator-section-title h3 { font-size: 1rem; font-weight: 600; color: var(--is-text); }
#creatorSheetModal .creator-section-title p, #creatorSheetModal .creator-field-label span, #creatorSheetModal .creator-number-field>span { color: var(--is-text-muted); }
#creatorSheetModal :is(.creator-section-icon,.creator-section-count,.creator-chip,.creator-empty-state) { background: var(--is-bg-soft); color: var(--is-text-muted); border-color: var(--is-border); box-shadow: none; }
#creatorSheetModal :is(.creator-field-row,.creator-simple-row) { background: var(--is-bg-soft); border-color: var(--is-border); box-shadow: none; border-radius: 5px; padding: 1rem; }
#creatorSheetModal :is(.creator-field-label strong,.creator-simple-label strong,.creator-chip) { color: var(--is-text); font-weight: 600; }
#creatorSheetModal .creator-field-row { gap: 1rem; }
#creatorSheetModal .creator-field-controls { display: grid; grid-template-columns: 1fr; align-items: start; gap: .65rem; min-width: 0; }
#creatorSheetModal .creator-field-controls .creator-icon-toggle-wrap { justify-self: start; }
#creatorSheetModal .creator-icon-toggle { width: auto; height: auto; min-height: 42px; padding: .45rem .7rem; display: flex; gap: .5rem; color: var(--is-text-muted); background: var(--is-surface); border-color: var(--is-border); font-size: .8rem; }
#creatorSheetModal .btn-check:checked+.creator-icon-toggle { color: var(--is-warning); background: var(--is-surface-strong); border-color: var(--is-accent); }
#creatorSheetModal .creator-rating { margin: 0; flex-shrink: 0; }
#creatorSheetModal .creator-rating label { color: var(--is-text-muted); background: var(--is-bg); border-color: var(--is-border-strong); min-width: 40px; min-height: 42px; }
#creatorSheetModal .creator-rating input:checked+label, #creatorSheetModal .creator-rating label:hover { color: var(--is-text-inverse); background: var(--is-accent); }
#creatorSheetModal .creator-rating input { position: absolute; opacity: 0; display: block; width: 1px; height: 1px; }
#creatorSheetModal .creator-rating input:focus-visible+label { outline: 3px solid var(--is-focus-ring); outline-offset: 3px; }
#creatorSheetModal .creator-capacity-controls { flex-wrap: wrap; justify-content: flex-start; }
#creatorSheetModal .creator-range-grid { gap: .75rem; }
#creatorSheetModal .creator-switch { color: var(--is-text-muted); }
#creatorSheetModal .author-sheet-settings>p { color: var(--is-text-muted); }
#creatorSheetModal .author-sheet-settings .creator-sheet-preview { margin: 1rem .5rem 1rem 0; padding: .5rem .8rem; }
.da-author .creator-config-header, .da-author .creator-config-footer { background: var(--is-bg-soft); border-color: var(--is-border); }
.da-author .creator-config-title :is(h2,p) { color: var(--is-text); }
.da-author .creator-config-body { background: var(--is-bg); }
.da-author .creator-config-row { background: var(--is-surface); border-color: var(--is-border); box-shadow: none; }
.da-author .creator-config-field>span { color: var(--is-text-muted); }
.da-author .creator-config-row::before { display: none; }
.da-author .creator-config-icon, .da-author .creator-config-empty { background: var(--is-surface); color: var(--is-text-muted); border-color: var(--is-border); }
.da-author .creator-config-footer .author-save-state { margin-right: auto; }
.da-author .writer-confirm-content { background: var(--is-surface); border-color: var(--is-border); color: var(--is-text); }
.da-author .writer-confirm-header, .da-author .writer-confirm-body, .da-author .writer-confirm-footer { color: var(--is-text); background: var(--is-surface); border-color: var(--is-border); }
.da-author .writer-confirm-cancel, .da-author .writer-confirm-ok { padding: .55rem 1rem; border-radius: 5px; }
.da-author .writer-confirm-cancel { color: var(--is-text); background: var(--is-bg); border: 1px solid var(--is-border); }
.da-author .writer-confirm-ok { color: var(--is-action-text); background: var(--is-action); border: 1px solid var(--is-action-hover); }
/* Inventory list/detail and explicit quantities; mobile keeps a single working panel. */
#inventoryEditorModal .inventory-editor-header { background: var(--is-bg-soft); border-color: var(--is-border); padding: 1rem; }
#inventoryEditorModal .inventory-editor-title { color: var(--is-text); }
#inventoryEditorModal .inventory-editor-title strong { font-size: 1.05rem; }
#inventoryEditorModal .inventory-editor-body { background: var(--is-bg); color: var(--is-text); padding: 1rem; }
#inventoryEditorModal .inventory-editor-grid, #inventoryEditorModal .inventory-editor-grid--editing { grid-template-columns: 1fr; gap: 1rem; align-items: start; }
#inventoryEditorModal .inventory-list-wrapper { order: 1; background: var(--is-surface); border: 1px solid var(--is-border); box-shadow: none; border-radius: 6px; }
#inventoryEditorModal #itemDetails { order: 2; position: static; min-width: 0; }
#inventoryEditorModal .inventory-list-wrapper::before, #inventoryEditorModal .rpg-item-card::before { display: none; }
#inventoryEditorModal .rpg-item-card { background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border); box-shadow: none; }
#inventoryEditorModal .inventory-detail-header { background: var(--is-bg-soft); border-color: var(--is-border); }
#inventoryEditorModal .inventory-detail-header h3 { margin: 0 0 .5rem; }
#inventoryEditorModal .inventory-detail-field>span { color: var(--is-text-muted); }
#inventoryEditorModal .inventoryObjectList { padding: .75rem; max-height: min(50dvh,600px); overflow-y: auto; }
#inventoryEditorModal .inventoryObjectRow { color: var(--is-text); background: var(--is-bg-soft); border-color: var(--is-border); grid-template-columns: 1fr; transform: none; box-shadow: none; }
#inventoryEditorModal .inventoryObjectRow :is(small b, .nameObjectText) { color: var(--is-text) !important; font-weight: 600; }
#inventoryEditorModal .inventoryObjectRow.selected { border-color: var(--is-accent); box-shadow: inset 3px 0 var(--is-accent); }
#inventoryEditorModal .inventoryObjectRow::before { display: none; }
#inventoryEditorModal .inventoryObjectRow>.col-7>.row { justify-content: start; }
#inventoryEditorModal .rowQuantityWrapper { border-color: var(--is-border); border-radius: 5px; background: var(--is-bg); box-shadow: none; }
#inventoryEditorModal .rowQuantityWrapper .btn { background: var(--is-surface-strong); color: var(--is-text); }
#inventoryEditorModal .rowQuantityWrapper .form-control { color: var(--is-text); background: var(--is-bg); }
#inventoryEditorModal .inventory-editor-filter { color: var(--is-text-muted); background: var(--is-bg); border-color: var(--is-border); flex: 1 1 auto; gap: .3rem; padding: .6rem; }
#inventoryEditorModal .typeObjectView { background: var(--is-bg); border-color: var(--is-border); flex-wrap: wrap; }
#inventoryEditorModal .btn-check:checked+.inventory-editor-filter { background: var(--is-surface-strong); color: var(--is-accent-strong); border-color: var(--is-accent); }
#inventoryEditorModal .inventory-filter-count { background: var(--is-surface-strong); color: var(--is-text); }
#inventoryEditorModal .inventory-filter-label { display: inline; font-size: .8rem; }
#inventoryEditorModal .inventory-editor-action span, #inventoryEditorModal .inventory-editor-preview span, #inventoryEditorModal .writer-feature-toggle span { display: inline; }
#inventoryEditorModal .inventory-editor-actions { flex-wrap: wrap; }
#inventoryEditorModal .inventory-editor-actions>button, #inventoryEditorModal .writer-feature-toggle { flex: 0 1 auto; padding: .4rem .6rem; }
#inventoryEditorModal .inventory-empty-state { background: var(--is-bg-soft); color: var(--is-text-muted); border-color: var(--is-border); }
#inventoryEditorModal .inventory-gear-badge, #inventoryEditorModal .item-inf-mark { color: var(--is-accent-strong); border-color: var(--is-border); background: var(--is-surface-strong); }
#inventoryEditorModal .influence-summary { color: var(--is-text); background: var(--is-bg-soft); border-color: var(--is-border); border-left-color: var(--is-accent); }
#inventoryEditorModal .influence-summary-header { color: var(--is-text-muted); }
#inventoryEditorModal .inventoryObjectInfluence { background: var(--is-surface-strong); color: var(--is-text); border-color: var(--is-border); }
.da-author .author-item-search { display: grid; gap: .4rem; color: var(--is-text-muted); padding: .8rem .8rem 0; font-size: .85rem; }
.da-author .author-item-search input { width: 100%; padding: .45rem .65rem; }
.da-author .author-no-results { margin: .75rem; color: var(--is-text-muted); }
.da-author .author-back-list { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; margin-bottom: 1rem; }
/* Narrative characters are a workspace; narrative renderers are unchanged. */
#detail-panel .characters-panel.da-author { background: var(--is-bg); color: var(--is-text); padding: 1rem; border-radius: 0; }
#detail-panel .characters-panel.da-author .characters-header { background: none; border-bottom: 1px solid var(--is-border); padding: 0 0 .75rem; margin-bottom: .75rem; }
#detail-panel .characters-panel.da-author .gameplay-surface-title { color: var(--is-text); font-family: var(--is-font-ui); }
#detail-panel .characters-panel.da-author .characters-body { display: grid; grid-template-columns: 1fr; gap: 1rem; }
#detail-panel .characters-panel.da-author .characters-list { border: 1px solid var(--is-border); border-radius: 6px; background: var(--is-bg-soft); padding: .5rem; max-height: 230px; overflow-y: auto; display: grid; gap: .4rem; align-content: start; }
#detail-panel .characters-panel.da-author .character-item { background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border); border-radius: 5px; padding: .65rem .5rem; min-height: 44px; box-shadow: none; }
#detail-panel .characters-panel.da-author .character-item.active { border-color: var(--is-accent); color: var(--is-accent-strong); background: var(--is-surface-strong); }
#detail-panel .characters-panel.da-author .char-name { overflow-wrap: anywhere; white-space: normal; }
#detail-panel .characters-panel.da-author .character-editor { background: var(--is-surface); border: 1px solid var(--is-border); border-radius: 6px; color: var(--is-text); min-width: 0; padding: 1rem; }
#detail-panel .characters-panel.da-author :is(.editor-section,.character-topbar) { background: none; color: var(--is-text); border-color: var(--is-border); box-shadow: none; }
#detail-panel .characters-panel.da-author .character-topbar { flex-wrap: wrap; gap: .5rem; }
#detail-panel .characters-panel.da-author .character-topbar h3 { margin-right: auto; }
#detail-panel .characters-panel.da-author .editor-section { margin-top: 1.25rem; padding: 0; }
#detail-panel .characters-panel.da-author .editor-section>label { display: block; color: var(--is-text-muted); font-size: .85rem; margin-bottom: .4rem; }
#detail-panel .characters-panel.da-author details.author-character-group { border-top: 1px solid var(--is-border); margin-top: 1rem; padding-top: .5rem; }
#detail-panel .characters-panel.da-author details.author-character-group>summary { display: flex; align-items: center; gap: .5rem; color: var(--is-accent-strong); font-weight: 600; cursor: pointer; }
#detail-panel .characters-panel.da-author details.author-character-group>summary::before { content: '+'; }
#detail-panel .characters-panel.da-author details.author-character-group[open]>summary::before { content: '−'; }
#detail-panel .characters-panel.da-author .visibility-toggle { color: var(--is-text); background: var(--is-bg-soft); border-color: var(--is-border); }
#detail-panel .characters-panel.da-author .expression-card { background: var(--is-bg-soft); border-color: var(--is-border); box-shadow: none; border-radius: 5px; }
#detail-panel .characters-panel.da-author .expression-thumb { min-height: 130px; background-size: contain; background-repeat: no-repeat; background-color: var(--is-bg); }
#detail-panel .characters-panel.da-author .expression-card.add { color: var(--is-accent-strong); border-color: var(--is-border-strong); }
#detail-panel .characters-panel.da-author .expression-tag { color: var(--is-text); }
#detail-panel .characters-panel.da-author .relation-card { color: var(--is-text); background: var(--is-bg-soft); border-color: var(--is-border); box-shadow: none; }
#detail-panel .characters-panel.da-author .relation-percent { color: #fff; text-shadow: 0 1px 3px #000; }
#detail-panel .characters-panel.da-author .relation-bar { background: var(--is-bg); }
#detail-panel .characters-panel.da-author .editor-empty-hint { color: var(--is-text-muted); background: var(--is-bg-soft); }
#detail-panel .characters-panel.da-author .author-character-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem; padding: .65rem 0; border-block: 1px solid var(--is-border); }
.da-author .author-order { display: inline-flex; gap: .2rem; }
.da-author .author-order button { padding: .25rem .4rem; min-width: 38px; min-height: 38px; color: var(--is-text-muted); background: var(--is-bg); border: 1px solid var(--is-border); border-radius: 4px; }
.da-author.expr-modal .expr-modal-close { background: var(--is-bg); color: var(--is-text); }
.da-author.fantasy-modal .fantasy-modal-content { background: var(--is-surface); color: var(--is-text); border: 1px solid var(--is-border); }
/* Config dialogs replace their suspended parent, without discarding its form. */
.da-author[data-author-suspended] { visibility: hidden !important; }
.da-author .creator-sheet-actions, .da-author .inventory-editor-actions { min-width: 0; }
@media (min-width: 768px) {
  #creatorSheetModal .author-sheet-workspace { grid-template-columns: 210px minmax(0,1fr); gap: 1.5rem; padding: 1.25rem; }
  #creatorSheetModal .author-sheet-nav { display: grid; position: sticky; top: 0; }
  #creatorSheetModal .creator-field-main { grid-template-columns: minmax(110px,.4fr) minmax(0,1fr); }
  #inventoryEditorModal .inventory-editor-grid--editing { grid-template-columns: minmax(260px,.85fr) minmax(0,1.15fr); }
  #inventoryEditorModal .author-back-list { display: none; }
}
@media (min-width: 1100px) {
  #istory-builder:has(.characters-panel.da-author) #left-pane { flex-basis: 28%; }
  #istory-builder:has(.characters-panel.da-author) #right-pane { flex-basis: 72%; }
  #detail-panel .characters-panel.da-author .characters-body { grid-template-columns: minmax(175px,.28fr) minmax(0,1fr); }
  #detail-panel .characters-panel.da-author .characters-list { max-height: 65dvh; position: sticky; top: 0; }
}
@media (max-width: 767.98px) {
  #creatorSheetModal .creator-sheet-dialog, #inventoryEditorModal .inventory-editor-dialog, .da-author .creator-config-dialog { margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; }
  #creatorSheetModal .creator-sheet-modal, #inventoryEditorModal .inventory-editor-modal, .da-author .creator-config-modal { border-radius: 0; height: 100%; max-height: 100%; }
  #creatorSheetModal .creator-sheet-header { padding: .65rem .75rem; gap: .5rem; }
  #creatorSheetModal .creator-sheet-actions { display: flex; flex-wrap: wrap; width: 100%; margin-left: 0; }
  #creatorSheetModal .creator-sheet-actions .author-save-state { flex: 1 1 8rem; }
  #creatorSheetModal .creator-sheet-save span { display: inline; }
  #creatorSheetModal .creator-sheet-save, #creatorSheetModal .creator-sheet-close { min-height: 42px; }
  #creatorSheetModal :is(.creator-field-main,.creator-field-controls,.creator-simple-row) { grid-template-columns: 1fr; }
  #creatorSheetModal .creator-sheet-section { padding: .75rem; }
  #creatorSheetModal .creator-section-header { grid-template-columns: auto 1fr auto; }
  #creatorSheetModal .creator-section-count { display: none; }
  #creatorSheetModal .creator-range-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #inventoryEditorModal .inventory-editor-grid--editing .inventory-list-wrapper { display: none; }
  #inventoryEditorModal .inventory-editor-grid--editing #itemDetails { display: block; }
  #inventoryEditorModal .inventory-editor-header { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'title close' 'filters filters' 'actions actions'; padding: .65rem .75rem; gap: .6rem; }
  #inventoryEditorModal .inventory-editor-actions .author-save-state { width: 100%; order: 10; }
  #inventoryEditorModal .inventory-editor-filter { min-width: 0; padding: .4rem; }
  #inventoryEditorModal .inventory-filter-label { font-size: .75rem; }
  #inventoryEditorModal .inventory-filter-count { min-width: 18px; padding: 0 4px; }
  #inventoryEditorModal .inventory-editor-filter i { display: none; }
  .author-context { padding: .6rem .75rem; }
  .author-context-title { flex-basis: 100%; }
  .author-context nav { justify-content: space-between; width: 100%; }
  .author-context nav a { padding-inline: .55rem; }
  #detail-panel .characters-panel.da-author, #detail-panel .characters-panel.da-author .character-editor { padding: .75rem; }
  #istory-builder:has(.characters-panel.da-author) #left-pane { display: none; }
  #istory-builder:has(.characters-panel.da-author) #right-pane { display: block; width: 100%; flex-basis: 100%; min-width: 0; }
}
@media (max-height: 500px) {
  #creatorSheetModal .creator-sheet-dialog, #inventoryEditorModal .inventory-editor-dialog, .da-author .creator-config-dialog { height: 100dvh; max-height: 100dvh; margin-block: 0; }
  #creatorSheetModal .creator-sheet-header, #inventoryEditorModal .inventory-editor-header { padding-block: .5rem; }
  #creatorSheetModal .author-sheet-workspace { padding-top: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .da-author *, .da-author *::before, .da-author *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
#detail-panel .characters-panel.da-author .author-character-select { display: flex; align-items: center; gap: .5rem; min-width: 0; flex: 1; text-align: left; background: transparent; color: inherit; border: 0; padding: .15rem; }
#detail-panel .characters-panel.da-author .author-order { flex-shrink: 0; }
#detail-panel .characters-panel.da-author .character-item { flex-wrap: wrap; }
#detail-panel .characters-panel.da-author .expression-thumb { width: 100%; border: 0; border-radius: 4px; }
/* Specific author selectors override the legacy ID-based tool skin. */
#creatorSheetModal.da-author { --creator-bg: var(--is-bg); --creator-panel: var(--is-surface); --creator-panel-muted: var(--is-bg-soft); --creator-ink: var(--is-text); --creator-muted: var(--is-text-muted); --creator-line: var(--is-border); --creator-accent: var(--is-accent); --creator-accent-strong: var(--is-accent-strong); }
#creatorSheetModal.da-author .creator-control, .creator-config-modal-shell.da-author :is(input,textarea,select), #inventoryEditorModal.da-author :is(input:not([type=radio]):not([type=checkbox]),textarea,select), #detail-panel .characters-panel.da-author :is(.input-fantasy,.textarea-fantasy,.expression-tag,.relation-label) { color: var(--is-text); background: var(--is-bg-soft); border: 1px solid var(--is-border-strong); min-height: 42px; box-shadow: none; }
#creatorSheetModal.da-author .creator-control:focus { outline: 3px solid var(--is-focus-ring); outline-offset: 2px; box-shadow: none; border-color: var(--is-accent); }
#creatorSheetModal.da-author .creator-section-header { background: transparent; }
#creatorSheetModal.da-author .creator-sheet-save, #detail-panel .characters-panel.da-author #btnAddCharacter, #inventoryEditorModal.da-author [name=updateInventory] { background: var(--is-action); border: 1px solid var(--is-action-hover); color: var(--is-action-text); }
#creatorSheetModal.da-author .creator-small-action { background: var(--is-surface-strong); border-color: var(--is-border); color: var(--is-text); }
#creatorSheetModal.da-author .creator-small-action.is-danger { color: var(--is-danger); }
#creatorSheetModal.da-author .creator-range-meta { color: var(--is-text-muted); }
#creatorSheetModal.da-author .creator-field-list, #creatorSheetModal.da-author .creator-simple-list { gap: .75rem; }
#creatorSheetModal.da-author .creator-field-label { align-content: start; gap: .4rem; }
#creatorSheetModal.da-author .creator-field-row { grid-template-columns: 1fr; }
#creatorSheetModal.da-author .creator-field-controls { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
#creatorSheetModal.da-author .creator-rating input:checked~label { background: var(--is-surface-strong); color: var(--is-accent-strong); }
#creatorSheetModal.da-author .creator-rating input:checked+label { border: 2px solid var(--is-accent); color: var(--is-accent-strong); background: var(--is-surface-strong); }
.da-author input[type=checkbox] { appearance: auto; }
.da-author .writer-feature-toggle input { width: 18px; height: 18px; background: transparent; border-radius: 3px; }
.da-author .writer-feature-toggle input::after { display: none; }
#detail-panel .characters-panel.da-author .character-editor-title { color: var(--is-text); }
#detail-panel .characters-panel.da-author .character-dialogue-color-toggle { color: var(--is-text-muted); }
#detail-panel .characters-panel.da-author .character-item { display: grid; grid-template-columns: 20px minmax(0,1fr); }
#detail-panel .characters-panel.da-author .author-character-select { display: block; width: 100%; }
#detail-panel .characters-panel.da-author .character-item-icon { display: none; }
#detail-panel .characters-panel.da-author .author-order { grid-column: 2; justify-self: end; }
#detail-panel .characters-panel.da-author .char-name { white-space: normal; display: block; font-size: .875rem; }
#detail-panel .characters-panel.da-author .character-topbar { padding: 0 0 1rem; }
#detail-panel .characters-panel.da-author .btn-gold { color: var(--is-action-text); background: var(--is-action); border-color: var(--is-action-hover); }
#istory-builder:has(.characters-panel.da-author) #right-pane { background: #1b1513; }
#detail-panel .characters-panel.da-author { height: auto; min-height: 100%; overflow: visible; }
#detail-panel .characters-panel.da-author .characters-body { overflow: visible; }
#detail-panel .characters-panel.da-author .character-editor { overflow: visible; }
@media(min-width: 768px) {
  #creatorSheetModal.da-author .creator-field-controls { grid-template-columns: minmax(130px,.4fr) minmax(0,1fr); }
}
@media(max-width: 767.98px) {
  #creatorSheetModal.da-author .creator-field-controls { grid-template-columns: 1fr; }
}
.da-author:is(#influenceModal,#confirmDeleteInfModal,#confirmDeleteModal,#statusModal) .modal-content { background: var(--is-surface); color: var(--is-text); border-color: var(--is-border); }
.da-author:is(#influenceModal,#confirmDeleteInfModal,#confirmDeleteModal,#statusModal) :is(.modal-header,.modal-footer) { background: var(--is-bg-soft); color: var(--is-text); border-color: var(--is-border); }
#influenceModal.da-author .modal-dialog { max-width: min(1000px,calc(100vw - 24px)); }
#influenceModal.da-author .modal-content { max-height: calc(100dvh - 24px); overflow-y: auto; }
#influenceModal.da-author :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { background: var(--is-bg-soft); color: var(--is-text); border-color: var(--is-border-strong); }
#inventoryEditorModal.da-author { --inventory-panel: var(--is-surface); --inventory-ink: var(--is-text); --inventory-muted: var(--is-text-muted); --inventory-accent: var(--is-accent); --inventory-line: var(--is-border); }
#inventoryEditorModal.da-author .inventory-gear-badge { color: var(--is-accent-strong); background: var(--is-surface-strong); border-color: var(--is-border); }
#creatorSheetModal.da-author .creator-edit-button { width: auto; min-width: 80px; height: auto; min-height: 42px; padding: .45rem .6rem; flex-shrink: 0; }
#creatorSheetModal.da-author .creator-section-icon, #detail-panel .characters-panel.da-author .gameplay-surface-title__icon { display: none; }
#detail-panel .characters-panel.da-author .character-dialogue-color-controls label { color: var(--is-text-muted); }
@media(max-width:767.98px) {
  #creatorSheetModal .author-sheet-nav { flex-wrap: nowrap; overflow-x: auto; padding: .25rem .25rem .65rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
  #creatorSheetModal .author-sheet-nav button { flex: 0 0 auto; max-width: 12rem; min-height: 48px; scroll-snap-align: start; }
}
#creatorSheetModal .author-sheet-nav, #creatorSheetModal .author-sheet-panels { min-width: 0; }
#inventoryEditorModal.da-author .inventory-detail-secondary { background: var(--is-surface-strong); color: var(--is-text); border-color: var(--is-border); }
#influenceModal.da-author :is(.accordion-item,.accordion-body,.alert-light) { background: var(--is-bg-soft); color: var(--is-text); border-color: var(--is-border); }
#influenceModal.da-author .accordion-button { background: var(--is-surface-strong); color: var(--is-text); box-shadow: none; }
#influenceModal.da-author .accordion-button::after { filter: invert(.8); }
#influenceModal.da-author .modal-footer .author-save-state { margin-right: auto; }
#influenceModal.da-author .btn-primary { background: var(--is-action); color: var(--is-action-text); border-color: var(--is-action-hover); }
#influenceModal.da-author .form-floating>label { color: var(--is-text-muted); }
#influenceModal.da-author .text-dark { color: var(--is-text) !important; }
#influenceModal.da-author .modal-body { overflow-wrap: anywhere; }
#influenceModal.da-author .alert-light>.col-3 { min-width: 0; }
@media(max-width:575.98px) {
  #influenceModal.da-author .row.alert>.col-3, #influenceModal.da-author .row.alert>.col-9 { flex: 0 0 100%; width: 100%; }
  #influenceModal.da-author .modal-dialog { margin: 0; width: 100%; max-width: 100%; height: 100dvh; }
  #influenceModal.da-author .modal-content { max-height: 100dvh; border-radius: 0; }
  #influenceModal.da-author .accordion-body { padding: .6rem; }
}
/* Keep the section rail visible while only the working form scrolls. */
#creatorSheetModal .author-sheet-workspace { overflow: hidden; grid-template-rows: max-content minmax(0,1fr); }
#creatorSheetModal .author-sheet-panels { min-height: 0; overflow-y: auto; padding: .15rem; overscroll-behavior: contain; }
#creatorSheetModal .author-sheet-nav { min-height: 64px; overflow-y: hidden; }
#inventoryEditorModal.da-author .inventory-editor-action.addInventoryObject { color: var(--is-accent-strong); background: var(--is-surface-strong); border-color: var(--is-border-strong); }
@media(min-width:768px) { #creatorSheetModal .author-sheet-workspace { grid-template-rows: minmax(0,1fr); } }
#influenceModal.da-author .form-floating>label { opacity: 1; }
#influenceModal.da-author [data-author-influence-cycle] { color: var(--is-text); background: var(--is-surface-strong); border: 1px solid var(--is-border-strong); padding: .4rem .55rem; font-size: .8rem; }
#influenceModal.da-author [data-author-influence-cycle] i { display: none; }
.da-author .btn-close { filter: invert(1) grayscale(1) brightness(.85); }
/* Long effect labels stay fully readable, including at 320px and at zoom. */
#influenceModal.da-author .form-floating { display: flex; flex-direction: column-reverse; gap: .35rem; }
#influenceModal.da-author .form-floating>label { position: static; transform: none !important; height: auto; white-space: normal; overflow: visible; text-overflow: clip; padding: .15rem 0; pointer-events: auto; }
#influenceModal.da-author .form-floating>.form-control { height: auto; padding: .6rem; }
#influenceModal.da-author .btn-outline-danger { color: var(--is-danger); border-color: #b57c77; }
#influenceModal.da-author .btn-check:checked+.btn-outline-danger, #influenceModal.da-author .btn-outline-danger:hover { color: var(--is-action-text); background: var(--is-action); border-color: var(--is-action-hover); }

.author-context-back { color:var(--is-text-muted); font-size:.8rem; padding:8px; }
#istory-test-tools, #istory-distribution { scroll-margin-top:90px; }
@media(max-width:992px) {
 .author-context { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; padding:6px 10px; }
 .author-context-title { min-width:0; }
 .author-context-title .author-kicker { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .author-context nav { grid-column:1/-1; grid-row:2; width:100%; justify-content:space-between; }
 .author-context nav a { padding:8px 6px; min-height:40px; }
 .author-context-back { grid-column:2; grid-row:1; max-width:140px; font-size:.72rem; padding:4px; }
}

@media(max-height:440px) and (min-width:600px) {
 .author-context { grid-template-columns:minmax(110px,1fr) auto auto; }
 .author-context nav { grid-column:2; grid-row:1; width:auto; }
 .author-context-back { grid-column:3; max-width:100px; }
}

.author-context-back-short { display:none; }
@media(max-width:992px) { .author-context-back-label { display:none; } .author-context-back-short { display:inline; } }

.author-space-return { display:inline-flex; padding:8px 0; color:var(--is-accent-strong); font-size:.85rem; }

.author-space { max-width:1100px; margin:auto; padding:16px; }
.author-space-heading { margin:24px 0; max-width:720px; }
.author-space-heading h1 { font:600 clamp(1.7rem,4vw,2.4rem)/1.2 var(--is-font-heading,Georgia,serif); color:var(--is-text); }
.author-space-panel { padding:clamp(16px,3vw,28px); margin:16px 0; border:1px solid var(--is-border); border-radius:8px; background:var(--is-surface); color:var(--is-text); }
.author-space-panel h2 { font:600 1.3rem/1.3 var(--is-font-heading,Georgia,serif); margin-bottom:16px; }
.author-space .da-button { margin-block:6px; min-height:44px; }
.author-space-actions { display:flex; flex-wrap:wrap; gap:12px; }
.author-space .story-form-upcoming-grid { display:grid; gap:16px; }
.author-space .story-form-upcoming-estimate { display:flex; gap:12px; flex-wrap:wrap; }
.author-space .story-form-label { display:block; margin:12px 0 6px; color:var(--is-text); }
.author-space :is(input:not([type=checkbox]):not([type=hidden]),select,textarea) { color:var(--is-text); background:var(--is-bg); border:1px solid var(--is-border); border-radius:4px; padding:10px; min-height:44px; max-width:100%; }
.author-space textarea { width:100%; }
.author-space .story-form-help { font-size:.875rem; color:var(--is-text-muted); margin-block:6px; }
@media(min-width:768px){.author-space .story-form-upcoming-grid { grid-template-columns:1fr 1fr; }}

/* Compact management entry on a story detail, without the full workspace header. */
.author-detail-navigation { display:grid; gap:12px; }
.author-detail-tools .da-button { min-height:44px; max-width:100%; font:inherit; line-height:1.5; white-space:normal; text-align:center; }
.author-detail-tools .author-detail-editor { justify-content:space-between; text-align:left; padding:12px 16px; }
.author-detail-editor > span:first-child { min-width:0; }
.author-detail-editor :is(small,strong) { display:block; }
.author-detail-editor small { font-size:.8em; }
.author-detail-editor strong { font-weight:650; }
.author-detail-secondary { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.author-detail-secondary > a { flex:1 1 7rem; padding:8px 12px; }
.author-detail-tools .author-detail-hint, .da-detail-access .author-detail-status { font-size:.8125rem; line-height:1.5; color:var(--is-text-muted); margin:12px 0 0; }
