:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
  --bg: #080d15;
  --panel: #111925;
  --panel-2: #172131;
  --text: #edf3ff;
  --muted: #aebbd0;
  --border: #34445d;
  --accent: #6fa8ff;
  --accent-strong: #2477ee;
  --danger: #ffb0b0;
  --success: #aee8c1;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -20%, rgba(67, 112, 184, 0.22), transparent 45%),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
[contenteditable="true"] {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Owner-requested v7.2.u presentation rule preserved through v7.3.w: Text occurrences remain fully
   editable but do not draw browser/Safari focus rectangles around each group. */
.text-node[contenteditable="true"]:focus,
.text-node[contenteditable="true"]:focus-visible {
  outline: none;
  outline-offset: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(240px, 2fr) minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 21, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  justify-self: start;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.notebook-name {
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 15px;
  font-weight: 750;
  user-select: text;
}

.topbar-right {
  justify-self: end;
  display: flex;
  gap: 10px;
}

.topbar-command {
  min-width: 84px;
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid rgba(237, 243, 255, 0.78);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.topbar-command:hover {
  background: rgba(111, 168, 255, 0.16);
}

.app-version {
  align-self: center;
  min-width: max-content;
  margin-left: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.03em;
  user-select: text;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 34px;
  padding: 5px 20px;
  border-bottom: 1px solid rgba(52, 68, 93, 0.7);
  color: var(--muted);
  background: rgba(11, 17, 27, 0.72);
  font-size: 13px;
}

.save-status[data-kind="working"] {
  color: #ffe39c;
}

.save-status[data-kind="error"] {
  color: var(--danger);
  font-weight: 750;
}

.inline-notice {
  max-width: min(760px, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--success);
}

.inline-notice[data-kind="error"] {
  color: var(--danger);
}

.workspace {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 30px 24px 48px;
  flex: 1 1 auto;
}

.page-card {
  min-height: 70vh;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(17, 25, 37, 0.92);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.page-title {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 14px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(23, 33, 49, 0.96);
  color: var(--text);
  text-align: center;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.page-title:disabled {
  opacity: 1;
  cursor: default;
}

.page-title-return {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.page-title-return:hover {
  background: rgba(111, 168, 255, 0.12);
}

.editor-flow {
  min-height: 60vh;
  padding: 28px clamp(18px, 4vw, 54px) 64px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  cursor: text;
}

.text-node {
  min-width: 1px;
  border-radius: 4px;
  white-space: pre-wrap;
  caret-color: var(--text);
}

.text-node:hover {
  background: rgba(255, 255, 255, 0.025);
}

.text-node:focus {
  background: rgba(111, 168, 255, 0.06);
}

.top-terminal-text-slot {
  /* Keep this Text occurrence in the editor's inline formatting context.
     An inline-block is atomic: a newline inside it grows a tall narrow box
     but cannot move the following protected Page Door onto the next line.
     The inner DOM-only blank-line target supplies the 44px touch surface. */
  display: inline;
  margin-right: 2px;
  vertical-align: baseline;
  touch-action: manipulation;
  background: rgba(111, 168, 255, 0.025);
}

.top-terminal-text-slot .blank-line-caret-target {
  min-width: 44px;
  min-height: 1.55em;
  padding: 0 4px;
  vertical-align: baseline;
}

.top-terminal-text-slot .blank-line-caret-target-full {
  /* A literal newline in the parent performs the actual line break.  Making
     this child 100% wide would insert an extra wrap before the newline. */
  width: 44px;
}

.top-terminal-text-slot:hover,
.top-terminal-text-slot:focus {
  background: rgba(111, 168, 255, 0.08);
}

.blank-line-caret-target {
  display: inline-block;
  min-height: 1em;
  box-sizing: border-box;
  vertical-align: top;
}

.blank-line-caret-target-full {
  width: 100%;
}

.blank-line-caret-target-inline {
  width: 8px;
}

.page-door {
  display: inline-block;
  margin: 2px 4px;
  padding: 3px 12px;
  border: 2px solid #dce9ff;
  border-radius: 999px;
  background: #dce9ff;
  color: #142238;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  vertical-align: baseline;
}


.page-door-return-highlight {
  border-color: #ffffff;
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  box-shadow:
    0 0 0 7px rgba(111, 168, 255, 0.28),
    0 0 24px rgba(111, 168, 255, 0.72);
  animation: page-door-return-pulse 900ms ease-in-out 2;
}

@keyframes page-door-return-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-door-return-highlight {
    animation: none;
  }
}

.page-door:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #081324;
  transform: translateY(-1px);
}

.practice-lane {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  margin: 10px 0 6px;
  padding: 7px 10px;
  border: 1px dashed #617493;
  border-radius: 9px;
  background: rgba(111, 168, 255, 0.045);
}

.practice-lane-empty::before {
  content: "Type My 2nd Page here, then select it";
  position: absolute;
  left: 11px;
  top: 7px;
  color: #8090a8;
  font-size: 15px;
  pointer-events: none;
}

.practice-text {
  display: inline-block;
  min-width: 100%;
  min-height: 26px;
  position: relative;
  z-index: 1;
}

.practice-lane:not(.practice-lane-empty) .practice-text {
  min-width: 1px;
}

.selection-bubble,
.selection-menu {
  position: fixed;
  z-index: 1000;
}

.selection-bubble {
  min-height: 40px;
  padding: 8px 16px;
  border: 2px solid #bcd5ff;
  border-radius: 999px;
  background: var(--accent-strong);
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.46);
  font-weight: 850;
  cursor: pointer;
}

.selection-menu {
  display: grid;
  gap: 8px;
  width: min(390px, calc(100vw - 16px));
  padding: 10px;
  border: 1px solid #58729a;
  border-radius: 12px;
  background: #111b2a;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.58);
}

.selection-command,
.selection-cancel {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}

.selection-command {
  border: 1px solid #8db9ff;
  background: #245fae;
  color: white;
  font-weight: 800;
}

.selection-cancel {
  border: 1px solid var(--border);
  background: #1a2638;
  color: var(--muted);
}

.footer {
  padding: 16px 22px 22px;
  color: #7f8da3;
  text-align: center;
  font-size: 12px;
}

.fatal-card {
  width: min(680px, calc(100% - 32px));
  margin: 90px auto;
  padding: 30px;
  border: 1px solid #8b4b54;
  border-radius: 16px;
  background: #21151a;
}

.fatal-note {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand commands"
      "notebook notebook";
    gap: 8px 12px;
    padding: 10px 14px;
  }

  .brand {
    grid-area: brand;
  }

  .notebook-name {
    grid-area: notebook;
    justify-self: center;
  }

  .topbar-right {
    grid-area: commands;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .app-version {
    flex-basis: 100%;
    text-align: right;
  }

  .topbar-command {
    min-width: 72px;
    min-height: 44px;
    padding: 7px 10px;
  }

  .workspace {
    padding: 16px 10px 34px;
  }

  .page-card {
    border-radius: 12px;
  }

  .editor-flow {
    padding: 22px 16px 50px;
    font-size: 17px;
  }

  .status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .inline-notice {
    max-width: 100%;
    white-space: normal;
  }
}

/* Baby Step 1B: owner/developer Supnote System Menu. */
.brand {
  min-width: 100px;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.brand:hover {
  background: rgba(111, 168, 255, 0.13);
}

.system-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  padding:
    max(18px, env(safe-area-inset-top, 0px))
    max(18px, env(safe-area-inset-right, 0px))
    max(18px, env(safe-area-inset-bottom, 0px))
    max(18px, env(safe-area-inset-left, 0px));
  background: rgba(3, 7, 13, 0.78);
  backdrop-filter: blur(5px);
}

.system-overlay.system-overlay-blocking {
  background: #080d15;
  backdrop-filter: none;
}

.system-dialog {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid #60789e;
  border-radius: 16px;
  background: #111925;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.7);
}

/* The validated notebook tools can occupy the public Goodies thought page
   while the private editor shell remains detached from the document. */
.public-tool-host {
  width: 100%;
  min-width: 0;
}

.public-tool-host > .system-dialog {
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  max-height: none;
  margin: 0;
  box-shadow: none;
}

.system-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.025em;
}

.system-target {
  margin: 0;
  color: #cfe0ff;
  font-weight: 850;
}

.system-message,
.system-warning,
.system-progress {
  margin: 0;
  line-height: 1.5;
}

.system-warning,
.system-error {
  color: var(--danger);
}

.system-progress {
  color: #ffe39c;
  font-weight: 800;
}

.system-reset-command,
.system-close-command {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 850;
}

.system-reset-command {
  border: 2px solid #ff9c9c;
  background: #8f2732;
  color: white;
}

.system-reset-command:hover:not(:disabled) {
  background: #b33240;
}

.system-reset-command:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.system-close-command {
  border: 1px solid var(--border);
  background: #1a2638;
  color: var(--text);
}

.system-confirm-form {
  display: grid;
  gap: 12px;
}

.system-field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.system-input {
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  border: 1px solid #60789e;
  border-radius: 8px;
  background: #0b121e;
  color: var(--text);
}

@media (max-width: 760px) {
  .brand {
    min-width: 88px;
    min-height: 44px;
    padding-left: 4px;
  }

  .system-overlay {
    align-items: end;
    padding: 8px;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
  }

  .system-dialog {
    width: 100%;
    max-height: 100%;
    padding: 20px 16px;
    border-radius: 16px 16px 10px 10px;
  }
}

/* Baby Step 2B: validated Backup and non-destructive Check Notebook. */
.system-primary-command,
.system-secondary-command {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 850;
  text-align: center;
}

.system-primary-command {
  border: 1px solid #8ab4ff;
  background: #214d85;
  color: #ffffff;
}

.system-primary-command:hover:not(:disabled) {
  background: #2b619f;
}

.system-secondary-command {
  border: 1px solid var(--border);
  background: #1a2638;
  color: var(--text);
}

.system-primary-command:disabled,
.system-secondary-command:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.integrity-summary {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.8fr);
  gap: 8px 14px;
  margin: 0;
  padding: 12px;
  border: 1px solid #425775;
  border-radius: 10px;
  background: #0b121e;
}

.integrity-summary dt {
  color: var(--muted);
  font-weight: 800;
}

.integrity-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.digest-value {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #080d15;
  color: #cfe0ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.check-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #425775;
  border-radius: 10px;
  background: #0b121e;
}

.check-category-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-category {
  padding: 10px;
  border-left: 4px solid #7488a6;
  border-radius: 6px;
  background: #0b121e;
  line-height: 1.45;
}

.check-pass { border-left-color: #63c997; }
.check-warning { border-left-color: #f0cc67; }
.check-fail { border-left-color: #ff8383; }
.check-not-available { border-left-color: #8aa1c5; }

@media (max-width: 760px), (min-resolution: 1.9dppx) {
  .integrity-summary {
    grid-template-columns: 1fr;
  }

  .system-primary-command,
  .system-secondary-command,
  .system-close-command,
  .system-reset-command {
    min-height: 48px;
    font-size: 1rem;
  }
}

/* Baby Step 2C: isolated .notebook validation and metadata/integrity preview. */
.restore-disclosure {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #425775;
  border-radius: 10px;
  background: #0b121e;
}

.restore-file-input {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #8ab4ff;
  border-radius: 10px;
  background: #0b121e;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.restore-file-input::file-selector-button {
  min-height: 44px;
  margin-right: 10px;
  padding: 9px 12px;
  border: 1px solid #8ab4ff;
  border-radius: 8px;
  background: #214d85;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.restore-findings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.restore-finding {
  min-width: 0;
  padding: 10px;
  border-left: 4px solid #ff8383;
  border-radius: 6px;
  background: #0b121e;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.restore-preview-summary dd,
.restore-finding span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px), (min-resolution: 1.9dppx) {
  .restore-file-input,
  .restore-file-input::file-selector-button {
    min-height: 48px;
  }
}

/* Baby Step 2D: local-only transactional Restore confirmation and completion. */
.restore-confirmation-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #8ab4ff;
  border-radius: 10px;
  background: #0b121e;
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.system-danger-command {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #ff9b9b;
  border-radius: 10px;
  background: #7a2929;
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
  text-align: center;
}

.system-danger-command:hover:not(:disabled) {
  background: #943333;
}

.system-danger-command:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 760px), (min-resolution: 1.9dppx) {
  .restore-confirmation-input,
  .system-danger-command {
    min-height: 48px;
    font-size: 1rem;
  }
}

/* v7.3.w preserves A3: build identity remains visible above every app-managed screen,
   including blocking recovery, confirmation, reset-progress, and fatal states. */
.global-version-badge {
  position: fixed;
  right: max(8px, env(safe-area-inset-right, 0px));
  bottom: max(6px, env(safe-area-inset-bottom, 0px));
  z-index: 4000;
  pointer-events: none;
  user-select: text;
  padding: 3px 7px;
  border: 1px solid rgba(127, 141, 163, 0.55);
  border-radius: 7px;
  background: rgba(8, 13, 21, 0.88);
  color: #aebbd0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

/* Baby Step 3D-R locked boundary: no private notebook surface is usable or visible while locked. */
.supnote-locked-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg, #0f1115);
}
.supnote-locked-screen[hidden] { display: none !important; }
.supnote-locked-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(127, 127, 127, 0.4);
  border-radius: 14px;
  background: var(--panel, #171a21);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.supnote-locked-title { margin-top: 0; letter-spacing: .08em; }
.supnote-permanent-locked { max-width: 620px; margin: 10vh auto 0; }


/* v7.3.bl: opt-in owner unlock timing trace. Default-off diagnostic UI only. */
.unlock-timing-dialog {
  width: min(920px, 100%);
}

.unlock-timing-output {
  box-sizing: border-box;
  width: 100%;
  min-height: min(54vh, 520px);
  resize: vertical;
  padding: 12px;
  border: 1px solid #60789e;
  border-radius: 10px;
  background: #080d15;
  color: #e6eefc;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre;
  overflow: auto;
}

.unlock-timing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* R44 public tutorial. It is a separate, read-only packaged model;
   actual Open/Create/Reset handlers must be supplied by the integrated client. */
.public-shell .topbar-right {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.public-shell .topbar-command,
.public-shell .public-command {
  min-height: 44px;
}
.public-shell [aria-current="page"] {
  border-color: var(--accent);
  background: rgba(111, 168, 255, 0.16);
}
.public-mode-notice {
  margin: 16px 24px 2px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(111, 168, 255, 0.09);
}
.public-tutorial-body {
  white-space: pre-wrap;
}
.public-tutorial-text {
  white-space: pre-wrap;
}
.public-practice-lane {
  min-height: 1.4em;
}
.public-thought-page {
  min-height: auto;
  padding: 24px;
}
.public-thought-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}
.public-thought-intro {
  max-width: 70ch;
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}
.public-choice {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.public-choice-description {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.public-command,
.public-primary-command,
.public-secondary-command,
.public-danger-command {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
}
.public-primary-command { background: #1855a8; }
.public-secondary-command { border-color: var(--border); background: transparent; }
.public-danger-command { border-color: var(--danger); background: #6c2929; }
.public-command:focus-visible,
.public-primary-command:focus-visible,
.public-secondary-command:focus-visible,
.public-danger-command:focus-visible,
.public-inline-form input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.public-choice-details[hidden] { display: none; }
.public-inline-form {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 13, 21, 0.45);
}
.public-inline-form label { width: min(100%, 520px); }
.public-inline-form input { width: 100%; min-height: 44px; }
.public-identifier-fields {
  display: grid;
  gap: 10px;
  width: min(100%, 520px);
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.public-identifier-fields legend { padding: 0 6px; }
.public-identifier-or { margin: 0; color: var(--muted); }
.public-inline-status { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
.public-inline-status[data-kind="error"] { color: var(--danger); }
.public-inline-status[data-kind="ok"] { color: var(--success); }
.public-inline-status[data-kind="working"] { color: #ffe39c; }
.public-reset-warning { color: var(--danger); }
.public-recovery-secret {
  display: block;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  user-select: all;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, Consolas, monospace;
}
.public-recovery-secret[hidden] { display: none; }
@media (max-width: 760px) {
  .public-shell .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px;
  }
  .public-shell .notebook-name { justify-self: start; }
  .public-shell .topbar-right {
    justify-self: stretch;
    justify-content: flex-start;
  }
  .public-shell .workspace { padding: 16px 10px 40px; }
  .public-thought-page { padding: 16px; }
  .public-mode-notice { margin: 12px 14px 2px; }
}

/* Diagnostics application page: large, readable controls; no private editor. */
.diagnostics-commands { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; margin: 1rem 0; }
.diagnostics-commands > button { min-height: 44px; max-width: 100%; white-space: normal; }

/* DIAG-R02: prominent text status, with header access on public/private/locked views. */
.diagnostics-tracing-status {
  display: block;
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #172334;
  font-size: 1.5rem;
  font-weight: 800;
}
.diagnostics-tracing-status[data-enabled="true"] { border-color: var(--accent); }
.topbar-right { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.locked-diagnostics-navigation { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
