/* components.css — shared component styles (canon for now = the Notes ones). Copied from notes-app/index.html (2026-09-30.4). */
  [data-theme="dark"] .modal,
  [data-theme="dark"] .setup { background: var(--panel); }
  * { box-sizing: border-box; }
  body {
    margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.5;
  }
  textarea {
    width: 100%; min-height: 180px; background: var(--panel); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 14px; resize: vertical;
    font-family: inherit;
  }
  input, select {
    background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit;
  }
  .row { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
  button {
    background: var(--accent); color: #ffffff; border: none; border-radius: 8px;
    padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  button:disabled { opacity: 0.5; cursor: not-allowed; }
  button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
  .status { color: var(--muted); font-size: 13px; }
  .status.err { color: var(--danger); }
  .row { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  .linklike {
    background: none; border: none; padding: 0; color: var(--crimson); font-weight: 600;
    font-size: inherit; cursor: pointer; text-decoration: underline;
  }
  .modal-overlay {
    position: fixed; inset: 0; background: rgba(2,30,53,0.45); z-index: 100;
    display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto;
  }
  .modal {
    background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(2,30,53,0.3); padding: 20px 22px;
  }
  .modal-head { display: flex; align-items: center; justify-content: space-between; }
  .modal-head strong { font-size: 17px; color: var(--navy); }
  .acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .acc-err { color: var(--danger, #C21234); }
  .acc-warn { border: 1px solid var(--danger, #C21234); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
  .hist-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border, rgba(128,128,128,.25)); font-size: 14px; }
  .hist-row small { color: var(--muted); }
  .modal-sub { font-size: 13px; color: var(--muted); margin: 6px 0 14px; line-height: 1.5; }
  .modal-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
  /* In-app confirm/alert dialog */
  .modal.dialog { max-width: 420px; }
  .modal-overlay:has(.dialog) { align-items: center; }   /* confirm/alert dialogs sit in the middle (the Writer's canon); settings and login stay near the top */
  .dialog-msg { font-size: 14px; color: var(--text); margin: 4px 0 18px; line-height: 1.5; white-space: pre-line; }
  .dialog-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
  /* toast() — a message visible regardless of the collapsible input panel's state (unlike
     .status, which lives inside it). Fixed to the bottom so it never collides with the header. */
  .app-toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + var(--bottom-offset)); z-index: 140;
    background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 10px;
    font-size: 13px; max-width: min(92vw, 420px);
  }
  .app-toast-msg { flex: 1; }
  .app-toast-action {
    background: var(--crimson); color: #fff; border: none; border-radius: 6px;
    padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  }
  .app-toast-close {
    background: transparent; border: none; color: #fff; opacity: .7; cursor: pointer;
    font-size: 13px; padding: 2px 4px; flex-shrink: 0;
  }
  .app-toast-close:hover { opacity: 1; }
  /* Notifications modal (Fase 2) */
  .notif-section { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; }
  .notif-section strong { color: var(--navy); font-size: 13px; }
  [data-theme="dark"] .notif-section strong { color: var(--text); }
  .notif-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
  .notif-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
  .notif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
  .notif-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
  .notif-upcoming { margin-top: 8px; max-height: 140px; overflow-y: auto; font-size: 12px; color: var(--muted); }
  .notif-upcoming-row { padding: 4px 0; border-bottom: 1px dashed var(--border); }

@media (max-width: 860px) {
  /* iOS zooms the page on focusing any input under 16px — keep every form field at/above it. */
  input, select, textarea { font-size: 16px; }
}
