:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --fg: #1a1a1a;
  --fg-muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1f2937;
  --primary-fg: #ffffff;
  --accent: #2563eb;
  --danger: #b00020;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.4 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    sans-serif;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

button {
  font: inherit;
  cursor: pointer;
}

.boot {
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--primary);
  color: var(--primary-fg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--primary-fg);
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.topbar button {
  background: transparent;
  color: var(--primary-fg);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

/* ---------- page container ---------- */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.page h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

/* ---------- auth view ---------- */

.auth {
  max-width: 360px;
  margin: 6rem auto 0;
  padding: 2rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.auth h1 {
  margin: 0;
  font-size: 1.25rem;
}

.auth p {
  color: var(--fg-muted);
  margin: 0;
  font-size: 0.95rem;
}

.auth form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.auth button {
  background: var(--accent);
  color: var(--primary-fg);
  border: 0;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.auth .status {
  font-size: 0.9rem;
  color: var(--fg-muted);
  min-height: 1.2em;
}

/* The beta / privacy page (step 6, G), from the login and the top bar. */
.beta-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* The deployed version (the commit's short sha, or `dev`), on the login
   view and in the top bar: there to tell one deploy from the last. */
.version {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg-muted);
}

.topbar .version {
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- dashboard ---------- */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary-fg);
  border: 0;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.btn-secondary {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.btn-danger {
  background: var(--panel);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.projects {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.project {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
}

.project:first-child {
  border-top: 0;
}

.project .meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.project .title {
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  word-break: break-word;
}

.project .sub {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.project .badge {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--line);
  color: var(--fg-muted);
}

.project .badge.published {
  background: #dcfce7;
  color: #166534;
}

/* An app its author took offline, kept for the retention period (step 6, E). */
.project .badge.offline {
  background: #fef3c7;
  color: #92400e;
}

.project .actions {
  display: flex;
  gap: 0.4rem;
}

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--fg-muted);
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ---------- workspace ---------- */

.page.wide {
  max-width: 1400px;
}

.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
}

.workspace .back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.workspace h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.workspace-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.workspace-title h1 {
  margin: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr) minmax(280px, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.workspace-grid.editor-hidden {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.workspace-grid.editor-hidden .editor-pane {
  display: none;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  }
  .workspace-grid .preview-pane {
    grid-column: 1 / -1;
  }
  .workspace-grid.editor-hidden {
    grid-template-columns: minmax(280px, 1fr);
  }
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-toggle {
  font-size: 0.85rem;
}

.pane {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 480px;
  overflow: hidden;
}

/* ---------- preview ---------- */

.preview {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--panel);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.preview-role {
  margin-left: auto;
  margin-right: 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.preview-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #ffffff;
}

/* ---------- publish ---------- */

.publish {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.publish .live-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

.publish .live-link:hover {
  text-decoration: underline;
}

.publish .live-link.offline {
  color: var(--fg-muted);
  text-decoration: line-through;
}

.publish .unpublish[hidden],
.publish .share[hidden] {
  display: none;
}

.publish-status {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
  min-height: 1.1em;
}

.publish-status strong {
  color: var(--danger);
  display: block;
  margin-bottom: 0.25rem;
}

.publish-errors,
.publish-changes,
.publish-notices,
.publish-access,
.publish-weakened,
.publish-limitations,
.publish-invites {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.publish-errors {
  color: var(--danger);
}

.publish-notices {
  color: var(--fg);
}

/* Phase 3.19: the promises review, a heading per part. */
.publish-heading {
  color: var(--fg);
  font-weight: 600;
  margin-top: 0.5rem;
}

.publish-weakened,
.publish-access .wider {
  color: var(--danger);
}

.publish-invite-toggle {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.publish-invite-unsent {
  color: var(--danger);
}

.publish-confirm {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Phase 3.30: the share panel. The QR code stays dark on white in either
   theme, as scanners expect. */
.share-panel {
  color: var(--fg);
}

.share-who {
  margin-top: 0.25rem;
}

.share-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.share-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.share-qr-image svg {
  display: block;
  width: 160px;
  height: 160px;
}

.share-qr-save {
  color: var(--accent);
}

.share-text {
  flex: 1;
  min-width: 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.share-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-url {
  flex: 1;
  min-width: 12rem;
  font: inherit;
}

.share-message {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  resize: vertical;
}

/* ---------- chat ---------- */

.chat {
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-empty {
  color: var(--fg-muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

.msg {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  max-width: 85%;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--primary-fg);
}

.msg.assistant {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
}

.msg.tool-use {
  align-self: flex-start;
  background: transparent;
  color: var(--fg-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.msg.tool-result {
  align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
}

.msg.tool-result.ok {
  color: #166534;
}

.msg.tool-result.err {
  color: var(--danger);
}

.chat-status {
  padding: 0 0.75rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  min-height: 1.1em;
}

/* A failed or interrupted reply stays in the log (step 6, G), with the way back. */
.msg.error {
  align-self: stretch;
  max-width: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.msg.error button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  background: #fff;
  color: #991b1b;
  cursor: pointer;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.chat-input textarea {
  flex: 1;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}

.chat-input button {
  align-self: flex-end;
}

/* ---------- editor ---------- */

.editor {
  padding: 0.75rem;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 700px;
  overflow-y: auto;
}

.editor-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.editor-section .row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.editor-section .row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.editor-section .row input,
.editor-section .row select,
.editor-section .field-row input,
.editor-section .field-row select {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.9rem;
}

.editor-section .has-err input,
.editor-section .has-err select {
  border-color: var(--danger);
}

.editor .block {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
}

.editor .block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.editor .sub-block {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
}

.editor .sub-head {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.editor .policy-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.editor .policy-row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-transform: lowercase;
}

.editor .policy-row select {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
}

.editor .field-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto auto;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.editor .field-row .check {
  font-size: 0.8rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.editor .field-block {
  margin-bottom: 0.55rem;
}

.editor .field-constraints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin: 0.1rem 0 0.3rem 0;
  padding-left: 0.4rem;
}

.editor .field-constraints label.inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.editor .field-constraints label.inline input[type='number'],
.editor .field-constraints label.inline input[type='text'],
.editor .field-constraints label.inline select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.editor .field-constraints label.inline input[type='number'] {
  width: 5rem;
}

.editor .field-constraints label.inline.showif {
  flex-wrap: wrap;
}

/* Phase 3.16 status flow: a from × to grid of allowed moves. */
.editor .status-flow {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}

.editor .status-grid {
  border-collapse: collapse;
  font-size: 0.78rem;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

.editor .status-grid th,
.editor .status-grid td {
  padding: 0.15rem 0.4rem;
  text-align: center;
  border: 1px solid var(--line);
}

.editor .status-grid th[scope='row'] {
  text-align: left;
  font-weight: normal;
  color: var(--fg-muted);
}

.editor .status-flow .sub-muted {
  flex-basis: 100%;
}

.editor .btn-link {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.editor .list-affordance-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.5rem;
}

.editor .list-affordance-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.editor .sub-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.4rem 0 0.2rem;
}

.editor .repeater-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.4rem;
}

.editor .sub-muted {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.editor .err-pill {
  display: inline-block;
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #fecaca;
  margin-top: 0.2rem;
}

.editor-summary {
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
}

.editor-summary.ok {
  background: #dcfce7;
  color: #166534;
}

.editor-summary.err {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.editor-summary ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
}

/* ---------- editor tab strip ---------- */

.editor-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin: -0.25rem -0.25rem 0.5rem;
  padding: 0 0.25rem;
}

.editor-tab {
  background: transparent;
  border: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.editor-tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.editor-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-tab-pane.graph,
.editor-tab-pane.json {
  gap: 0.5rem;
}

/* ---------- screen rename flash ---------- */

.editor .block.flash {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transition: outline-color 0.4s ease;
}

/* ---------- graph view ---------- */

.graph {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  overflow: auto;
  max-height: 600px;
}

.graph-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.graph-svg {
  display: block;
  background: var(--panel);
  border-radius: 4px;
}

.graph-note {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.graph-node {
  width: 100%;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.2;
  overflow: hidden;
}

.graph-node:hover,
.graph-node.hover,
.graph-node:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}

.graph-node.entry {
  border-width: 2px;
  border-color: var(--primary);
}

.graph-node.orphan {
  border-color: #f59e0b;
  background: #fffbeb;
}

.graph-node-badge {
  display: inline-block;
  width: max-content;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.graph-node-id {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-node-sub {
  color: var(--fg-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-edge {
  transition: stroke-width 0.1s ease;
}

.graph-edge:hover {
  stroke-width: 2.5;
}

.graph-edge.err {
  stroke-dasharray: 4 2;
}

/* ---------- json peek ---------- */

.editor-json-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.editor-json-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editor-json {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  max-height: 480px;
  overflow: auto;
  white-space: pre;
}

/* ---------- orphan banner ---------- */

.orphan-banner-mount {
  margin-top: 0.5rem;
}

.orphan-banner {
  width: 100%;
  text-align: left;
  background: #fffbeb;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}

.orphan-banner:hover {
  background: #fef3c7;
}

/* Phase 3.22: the wizard wrote the draft over an unsaved editor change. */
.conflict-notice {
  margin-top: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* ---------- chat diff pill ---------- */

.msg.diff {
  align-self: flex-start;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

/* Built-in icon picker: preview of the chosen SVG beside the select. */
.editor .icon-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.editor .icon-preview {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--fg-muted);
}

.editor .icon-preview svg {
  width: 20px;
  height: 20px;
}

/* Computed-field expression input (Phase 3.9) */
.editor .expr-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-width: 14rem;
}

.editor .expr-error {
  color: var(--danger, #b00020);
  font-size: 0.8rem;
}

/* Read-time computed field (Phase 3.14): the tooltip says why and what it rules out. */
.editor .read-time-badge {
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--fg-muted);
  cursor: help;
  white-space: nowrap;
}

.editor .read-time-badge[hidden] {
  display: none;
}

/* Links out of the app on a screen node (Phase 3.9): a leaf chip, not an edge. */
.graph-node {
  position: relative;
}

.graph-node-external {
  position: absolute;
  top: 4px;
  right: 6px;
  max-width: 55%;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--fg-muted);
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Multi-clause conditions (Phase 3.11): an "All of" / "Any of" group. */
.editor .condition-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
}

/* Theme extras (Phase 3.11) */
.editor .font-sample {
  font-size: 1rem;
  color: var(--fg);
}

.editor .icon-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.editor .app-icon-preview {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.editor .icon-options {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.editor .icon-options input[type='text'] {
  flex: 1 1 14rem;
  min-width: 10rem;
}

.editor .logo-preview {
  max-height: 32px;
  max-width: 120px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
