:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:where(.app-root, .modal) :focus-visible { outline: 3px solid var(--active); outline-offset: 3px; }
.password-reset { display: grid; place-items: center; min-height: 100svh; padding: 1.25rem; }
.password-reset .auth-card { width: min(100%, 34rem); }
.password-reset h1 { font-family: Georgia, serif; color: var(--primary); }
.currency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .85rem; margin-top: .8rem; }
.currency-card { border: 1px solid var(--border); border-radius: .8rem; background: var(--surface); padding: .9rem; min-width: 0; }
.currency-card h3 { margin: 0; color: var(--primary); }
.currency-card dl { display: grid; gap: .75rem; margin-bottom: 0; }
.currency-card dt { color: var(--muted); }
.currency-card dd { margin: .12rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.line-row > output { color: var(--primary); text-align: end; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }
dialog.modal { width: min(calc(100% - 2rem), 620px); max-height: min(90dvh, 820px); padding: 0; margin: auto; color: var(--text); }
dialog.modal:has(.document-form), dialog.modal:has(.document-preview-shell) { width: min(calc(100% - 2rem), 1120px); }
dialog.modal::backdrop { background: rgb(6 15 10 / 60%); }
body:has(dialog[open]) { overflow: hidden; }
dialog.modal .modal-head { scroll-margin-bottom: 4rem; }
dialog.modal :is(button, select, input, textarea) { scroll-margin-top: 5rem; }
dialog.modal .modal-actions { flex-wrap: wrap; }
.modal .close-btn, .assistant-close, .topbar :is(.icon-btn, .avatar) { min-height: 44px; min-width: 44px; }
@media (max-width: 860px) {
  .sidebar:not(.open) { visibility: hidden; }
  .line-row > output { text-align: start; }
}
:root:not([data-theme="dark"]) { --muted: #58645e; }
.modal-feedback:not(:has([hidden]:first-child + [hidden])) { padding: 0 1.1rem 1rem; }
.modal-feedback > .notice { margin: .35rem 0 0; }
:root[data-theme="dark"] .btn.danger { color: #26130f; }
:root[data-theme="dark"] .btn.danger:hover { color: #26130f; }

:where(#app, dialog.modal) [hidden] { display: none !important; }
.account-entry .auth-welcome {
  margin: 2rem 0 .85rem;
  color: var(--primary);
  font: 700 clamp(2.1rem, 5.5vw, 5rem)/1.02 Georgia, serif;
  letter-spacing: -.04em;
}
.account-entry .auth-card h1 {
  margin: 0 0 .8rem;
  color: var(--primary);
  font: 700 clamp(1.65rem, 4vw, 2.2rem)/1.2 Georgia, serif;
}
.account-entry .auth-hint { margin: .65rem 0; font-size: .91rem; line-height: 1.45; }
.account-entry .auth-tabs { margin-bottom: .9rem; }
.auth-help-actions { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .4rem; }
.auth-help-actions button { min-height: 40px; text-align: start; }
.account-entry .divider { margin: .75rem 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: start; gap: .4rem; }
.sidebar-close { display: none; }
.schedule-note, .report-period { color: var(--muted); font-size: .92rem; }
.inventory-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.document-options { border: 1px solid var(--border); border-radius: .8rem; padding-inline: .75rem; }
.document-options > summary { color: var(--primary); cursor: pointer; min-height: 44px; padding-block: .75rem; font-weight: 700; }
.document-options > div { padding-bottom: .75rem; }
.document-save-actions {
  position: sticky;
  bottom: -.1px;
  margin-block: 0 -.6rem;
  padding: .65rem .1rem;
  z-index: 1;
  background: var(--surface);
}
.app-root .table-wrap:focus-visible, .compact-table:focus-visible { outline-offset: -3px; }
.account-delete { color: var(--danger); }

@media (max-width: 860px) {
  .account-entry .auth-visual { min-height: auto; padding: .8rem 1rem; background: var(--bg); }
  .account-entry .auth-visual > :not(.auth-brand) { display: none; }
  .account-entry .auth-brand img { width: 38px; height: 38px; }
  .account-entry .auth-panel { padding: 1rem; align-items: start; }
  .account-entry .auth-card { max-width: 30rem; }
  .sidebar-close { display: inline-grid; width: 44px; min-height: 44px; }
  body:has(.sidebar.open) { overflow: hidden; }
  .document-form > .document-form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
}
