/* Web-only additions to the shared Ledgerlyne stylesheet:
   the subscription-pass screen, the book chooser, the browser-capability banner,
   and the narrow-viewport rules a browser window needs and an app window does not. */

.visually-hidden-input { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Overlay screens sit above every app screen without touching their layout. */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow: auto;
  background: radial-gradient(circle at 20% 0%, rgba(52, 220, 255, .12), transparent 45%), rgba(3, 8, 14, .88);
  backdrop-filter: blur(8px);
}

.overlay-card {
  width: min(620px, 100%);
  padding: clamp(22px, 3.4vw, 34px);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overlay-card h2 { margin: 0; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.2; }
.overlay-card p { margin: 0; }
.overlay-card .button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.overlay-card .picker-actions { display: grid; gap: 10px; }

.file-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: rgba(52, 220, 255, .07);
}
.file-target small { display: block; color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.file-target strong { display: block; margin-top: 5px; font-size: 14px; overflow-wrap: anywhere; }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 7px; color: var(--muted); line-height: 1.5; font-size: 13px; }
.steps strong { color: var(--text); }

.small-note { font-size: 12px; }
.status-note { margin: 0; color: var(--green); font-size: 12.5px; line-height: 1.5; }
.status-note.bad { color: var(--orange); }

/* Honest browser-capability notice. Only shown when this browser cannot save in place. */
.capability-banner {
  position: fixed;
  left: 50%;
  bottom: 84px; /* clear of the app's own toast, which sits at the bottom centre */
  transform: translateX(-50%);
  z-index: 35;
  width: min(720px, calc(100vw - 28px));
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 35, 54, .96), rgba(7, 18, 29, .94));
  box-shadow: var(--shadow);
}
.capability-banner.limited { border-color: rgba(255, 189, 90, .5); }
.capability-banner strong { display: block; font-size: 13.5px; }
.capability-banner p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.capability-banner .icon-button { flex: 0 0 auto; }

.reopen-prompt {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.reopen-prompt strong { font-size: 14px; overflow-wrap: anywhere; }
.reopen-prompt p { margin: 6px 0 0; font-size: 12.5px; }
.reopen-prompt .button-row { display: flex; gap: 10px; }

#use-file-picker { align-self: flex-start; }

/* Keep the next step visible before the marketing copy on narrow screens. */
@media (max-width: 900px) {
  .auth-panel-wrap { order: -1; min-height: 0; padding: 28px 18px; }
  .auth-panel { padding: 28px; }
  .auth-panel .security-orbit { display: none; }
  .auth-hero { min-height: 0; padding: 28px; }
  .hero-copy { margin: 28px 0; }
}

/* A browser window can be far narrower than the desktop app window ever is. */
@media (max-width: 640px) {
  body { overflow: auto; }
  .auth-hero { padding: 26px 20px; min-height: 0; gap: 26px; }
  .auth-panel-wrap { padding: 22px 18px; min-height: 0; }
  .hero-copy h1 { font-size: 30px; }
  .trust-grid article:nth-child(3) { display: flex; }
  .picker-header { flex-wrap: wrap; gap: 12px; padding: 18px; }
  .picker-content { padding: 18px; }
  .picker-actions { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100vh; overflow-x: hidden; }
  .app-shell > * { min-width: 0; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar { min-width: 0; overflow: hidden; }
  .sidebar > * { min-width: 0; }
  .sidebar nav { display: flex; flex: 1 1 100%; min-width: 0; overflow-x: auto; gap: 6px; width: 100%; scrollbar-width: thin; }
  .sidebar nav button { flex: 0 0 auto; }
  .sidebar .brand-lockup > div:last-child { font-size: 11px; }
  .book-identity, .nav-button:not(.active) { font-size: 12px; }
  .book-identity { flex: 1 1 100%; padding: 12px 14px; }
  .nav-button { width: auto; flex: 0 0 auto; justify-content: flex-start; padding: 10px 13px; font-size: 13px; }
  .nav-button span { width: auto; }
  .sidebar-bottom { display: flex; align-items: center; gap: 10px; flex: 1 1 100%; margin-top: 0; }
  .sidebar-bottom .sync-card { flex: 1 1 auto; }
  .sidebar-bottom .sync-card div { display: grid; }
  .sidebar-bottom .secondary-button { display: block; flex: 0 0 auto; width: auto; }
  .workspace { padding: 18px 14px 46px; }
  .panel { overflow: hidden; }
  .panel-heading { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .panel-heading > * { min-width: 0; max-width: 100%; }
  .panel-heading label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
  .panel-heading select { max-width: 100%; width: 100%; }
  .workspace-header { flex-wrap: wrap; gap: 12px; }
  .header-actions { flex-wrap: wrap; }
  .metric-grid { grid-template-columns: 1fr; }
  .report-controls { grid-template-columns: 1fr; }
  .report-controls button { grid-row: auto; }
  .two-fields { grid-template-columns: 1fr; }
  .modal { width: min(94vw, 460px); }
  .file-target { grid-template-columns: 1fr; }
  .capability-banner { bottom: 92px; }
  .segment-control { flex-wrap: wrap; }
  table { min-width: 640px; }
}

/* A browser window is narrower than the desktop app frame, so let these captions wrap
   instead of being cut off with an ellipsis. */
.trust-grid article { align-items: flex-start; }
.trust-grid small { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }

/* The book chooser reuses the picker's action cards, without their large icon slot. */
#book-choice-list { grid-template-columns: 1fr; }
#book-choice-list .action-card { min-height: 0; padding: 15px 17px; display: grid; gap: 3px; place-items: start; text-align: left; }
#book-choice-list .action-card strong { overflow-wrap: anywhere; }
