@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #191919;
  --panel-raised: #202020;
  --line: #303030;
  --text: #f4f1eb;
  --muted: #a6a39d;
  --soft: #77746e;
  --accent: #d7b477;
  --accent-ink: #21190d;
  --success: #8fbd9a;
  --radius: 20px;
  font-family: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100dvh; }
.screen { min-height: 100dvh; }
.hidden { display: none !important; }
.splash-screen { position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; padding: max(34px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom)); background: #17364a url('/assets/roxy-beach-splash.webp') center center / cover no-repeat; }
.splash-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,18,30,.10) 0%, rgba(5,18,30,.02) 30%, rgba(5,15,24,.42) 54%, rgba(5,12,19,.88) 100%); }
.splash-content { position: relative; z-index: 1; width: min(100%, 520px); padding: 24px 4px 12px; text-align: left; animation: splash-rise .65s ease-out both; }
.splash-mark { height: 38px; justify-content: flex-start; margin-bottom: 25px; filter: drop-shadow(0 2px 8px #0005); }
.splash-mark span { background: #f1d4a0; }
.splash-mark span:nth-child(1) { height: 17px; }
.splash-mark span:nth-child(2) { height: 32px; }
.splash-mark span:nth-child(3) { height: 23px; }
.splash-kicker { color: #f3d9ad; font-size: 11px; font-weight: 700; letter-spacing: .24em; margin: 0 0 14px; text-shadow: 0 2px 14px #0008; }
.splash-title { color: #fffaf2; font-family: Manrope, system-ui, sans-serif; font-size: clamp(42px, 11vw, 64px); line-height: .99; letter-spacing: -.055em; margin: 0 0 15px; text-shadow: 0 3px 24px #0007; }
.splash-subtitle { color: rgba(255,250,242,.88); font-size: 15px; margin: 0 0 28px; text-shadow: 0 2px 14px #0008; }
.splash-enter { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px; padding: 0 20px; border: 1px solid rgba(255,255,255,.48); border-radius: 15px; color: #251b0c; background: #efd09a; font-size: 15px; font-weight: 700; box-shadow: 0 12px 35px #0003; transition: transform .15s, filter .15s; }
.splash-enter:active { transform: scale(.99); }
.splash-enter:hover { filter: brightness(1.05); }
.splash-footnote { color: rgba(255,250,242,.72); font-size: 9px; font-weight: 600; letter-spacing: .16em; margin: 22px 0 0; text-align: center; }
@keyframes splash-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .splash-content { animation: none; } .splash-enter { transition: none; } }
.splash-mark, .small-mark { display: flex; align-items: center; justify-content: center; gap: 4px; }
.splash-mark { height: 54px; }
.splash-mark span { display: block; width: 5px; border-radius: 99px; background: var(--accent); }
.splash-mark span:nth-child(1) { height: 21px; opacity: .55; }
.splash-mark span:nth-child(2) { height: 42px; }
.splash-mark span:nth-child(3) { height: 29px; opacity: .75; }
.quiet-label, .eyebrow { color: var(--soft); letter-spacing: .17em; font-size: 10px; font-weight: 700; margin: 0; }
.loading-line { width: 76px; height: 2px; border-radius: 9px; background: #292929; overflow: hidden; }
.loading-line span { display: block; height: 100%; width: 40%; background: var(--accent); animation: loading 1.1s ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(0); } to { transform: translateX(150%); } }
.auth-screen { display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 35%, #24211b 0%, #141414 50%, #101010 100%); }
.auth-card { width: min(100%, 420px); padding: clamp(24px, 6vw, 42px); border: 1px solid var(--line); border-radius: 26px; background: rgba(24,24,24,.92); box-shadow: 0 28px 80px #0005; }
.small-mark { width: 32px; height: 32px; border: 1px solid #454036; border-radius: 11px; margin-bottom: 32px; }
.small-mark span { width: 3px; border-radius: 9px; background: var(--accent); }
.small-mark span:nth-child(1) { height: 10px; opacity: .6; }
.small-mark span:nth-child(2) { height: 19px; }
.small-mark span:nth-child(3) { height: 13px; opacity: .8; }
h1, h2, .brand-title { font-family: Manrope, system-ui, sans-serif; letter-spacing: -.045em; }
h1 { font-size: clamp(32px, 8vw, 44px); line-height: 1.08; margin: 12px 0; font-weight: 700; }
h2 { font-size: 25px; line-height: 1.15; margin: 10px 0; }
.muted { color: var(--muted); line-height: 1.65; margin: 0; font-size: 14px; }
form { margin-top: 30px; }
label { display: block; color: #d8d4cc; font-size: 12px; font-weight: 600; margin-bottom: 9px; }
input { display: block; width: 100%; min-height: 50px; padding: 13px 15px; border: 1px solid #3b3a37; border-radius: 12px; color: var(--text); background: #111; }
input::placeholder { color: #68655f; }
.primary-button { min-height: 49px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 13px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; transition: filter .15s, transform .15s; }
.primary-button:hover { filter: brightness(1.07); }
.primary-button:active { transform: scale(.99); }
.full-width { width: 100%; }
form .primary-button { margin-top: 13px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: #e4a19a; font-size: 12px; }
.fine-print { border-top: 1px solid var(--line); margin: 22px 0 0; padding-top: 16px; color: var(--soft); font-size: 11px; line-height: 1.5; }
.dashboard-screen { max-width: 1050px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) clamp(20px, 5vw, 56px) max(22px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 26px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup .small-mark { margin: 0; }
.brand-title { display: block; font-size: 15px; font-weight: 700; margin-top: 3px; letter-spacing: -.02em; }
.icon-button { width: 43px; height: 43px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 22px; }
.icon-button:hover { color: var(--text); border-color: #555; }
.welcome-block { padding: clamp(38px, 8vw, 72px) 0 30px; max-width: 620px; }
.welcome-block h1 { max-width: 560px; margin-top: 13px; }
.welcome-block .muted { max-width: 500px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.action-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 180px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--panel); color: var(--text); transition: border-color .18s, transform .18s, background .18s; }
.action-card:hover { border-color: #625744; transform: translateY(-2px); background: #1d1c1a; }
.action-card.featured { border-color: #64553c; background: linear-gradient(140deg, #29241b, #1a1917 65%); }
.action-icon { display: grid; place-items: center; width: 35px; height: 35px; margin-bottom: 18px; border-radius: 11px; background: #2b2924; color: var(--accent); font-size: 22px; }
.action-title { font-family: Manrope, system-ui, sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -.025em; }
.action-description { margin-top: 7px; max-width: 245px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.action-arrow { position: absolute; right: 19px; top: 20px; color: #77736b; font-size: 17px; }
.status-panel { display: flex; align-items: center; gap: 12px; margin-top: 24px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #151515; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px #8fbd9a18; }
.status-title { margin: 0 0 4px; font-size: 12px; font-weight: 700; }
.status-copy { margin: 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.version-pill { margin-left: auto; flex: 0 0 auto; padding: 6px 8px; border: 1px solid #35342f; border-radius: 8px; color: var(--soft); font-size: 9px; letter-spacing: .1em; }
.dashboard-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; color: var(--soft); font-size: 11px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px 0 8px 12px; font-size: 12px; }
.text-button:hover { color: var(--text); text-decoration: underline; }
.notice { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 22px; background: #000a; backdrop-filter: blur(9px); }
.notice-card { position: relative; width: min(100%, 410px); padding: 28px; border: 1px solid #3a3934; border-radius: 22px; background: #1a1a19; box-shadow: 0 30px 100px #0009; }
.notice-card .muted { margin-bottom: 24px; }
.notice-close { position: absolute; right: 16px; top: 13px; border: 0; background: transparent; color: var(--muted); font-size: 24px; }
@media (max-width: 560px) {
  .action-grid { grid-template-columns: 1fr; gap: 10px; }
  .action-card { min-height: 138px; padding: 18px; }
  .action-icon { margin-bottom: 13px; }
  .dashboard-screen { padding-left: 18px; padding-right: 18px; }
  .status-panel { align-items: flex-start; }
  .version-pill { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Build 02 project library and create form */
.projects-panel { margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #151515; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.projects-list { display: grid; gap: 10px; margin-top: 14px; }
.project-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px; border: 1px solid #343434; border-radius: 13px; background: var(--panel); }
.project-row-main { min-width: 0; }
.project-row-title { overflow-wrap: anywhere; margin: 0 0 5px; font-size: 14px; font-weight: 700; }
.project-row-meta { margin: 0; color: var(--soft); font-size: 11px; line-height: 1.5; }
.project-row button { flex: 0 0 auto; border: 1px solid #4b4437; border-radius: 10px; background: #29241b; color: var(--accent); padding: 9px 12px; font-size: 12px; font-weight: 700; }
.project-form { margin-top: 20px; }
.project-form label:not(:first-child) { margin-top: 16px; }
.project-form select, .project-form textarea { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #3b3a37; border-radius: 12px; color: var(--text); background: #111; font: inherit; }
.project-form textarea { resize: vertical; line-height: 1.5; }
.project-form .form-message { margin-top: 5px; }
.project-form .primary-button { margin-top: 6px; }
.project-form .muted { margin-bottom: 14px; }
@media (max-width: 560px) { .projects-panel { padding: 16px; } .project-row { align-items: flex-start; } .project-row button { padding: 9px; } }

/* Build 03 Niche Pack Engine */
.packs-list { display: grid; gap: 10px; margin-top: 14px; }
.pack-row { padding: 15px; border: 1px solid #343434; border-radius: 13px; background: var(--panel); }
.pack-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pack-row-title { margin: 0 0 5px; font-size: 14px; font-weight: 700; }
.pack-row-meta { margin: 0 0 8px; color: var(--soft); font-size: 11px; }
.pack-row-description { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pack-pill { display: inline-flex; align-items: center; border: 1px solid #4b4437; border-radius: 999px; padding: 4px 8px; color: var(--accent); font-size: 10px; white-space: nowrap; }
.pack-row button { margin-top: 10px; border: 1px solid #4b4437; border-radius: 10px; background: #29241b; color: var(--accent); padding: 8px 11px; font-size: 12px; font-weight: 700; }

.provider-form select { display: block; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #3b3a37; border-radius: 10px; color: var(--text); background: #111; font: inherit; }
.provider-form label { display: block; margin-bottom: 7px; }
.provider-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.provider-task-grid > div { min-width: 0; }
.provider-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.provider-metric { border: 1px solid var(--line, #333); border-radius: 12px; padding: 13px; background: rgba(255,255,255,.025); }
.provider-metric strong { display: block; font-size: 1.2rem; font-weight: 600; }
.provider-metric span { color: var(--muted); font-size: .8rem; }
.provider-actions { margin-top: 18px; }
.provider-actions .muted { margin-top: 10px; }
@media (max-width: 520px) { .provider-task-grid { grid-template-columns: 1fr; } }

/* Build 05 chat writing workspace */
.chat-panel { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #141414; }
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px; border-bottom: 1px solid var(--line); }
.chat-header h2 { margin: 8px 0 6px; overflow-wrap: anywhere; }
.chat-header .muted { font-size: 12px; }
.secondary-button { flex: 0 0 auto; min-height: 40px; padding: 9px 12px; border: 1px solid #44413a; border-radius: 10px; background: #22211e; color: var(--text); font-size: 12px; font-weight: 600; }
.chat-toolbar { display: grid; grid-template-columns: 90px minmax(0, 1fr) 150px minmax(0, 1fr); align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: #181817; }
.chat-toolbar label { margin: 0; }
.chat-toolbar select { min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #3b3a37; border-radius: 10px; color: var(--text); background: #111; font: inherit; font-size: 12px; }
.chat-context { display: flex; flex-direction: column; gap: 5px; padding: 13px 22px; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 11px; line-height: 1.55; }
.chat-context strong { color: var(--accent); font-size: 11px; }
.chat-transcript { display: flex; flex-direction: column; gap: 14px; min-height: 240px; max-height: min(58vh, 660px); overflow-y: auto; padding: 20px; }
.chat-empty { display: grid; place-items: center; min-height: 190px; padding: 22px; color: var(--soft); text-align: center; font-size: 13px; line-height: 1.7; }
.chat-message { max-width: 94%; border: 1px solid #343434; border-radius: 15px; padding: 13px 15px; background: #1b1b1b; }
.chat-user { align-self: flex-end; background: #252117; border-color: #514632; }
.chat-assistant { align-self: flex-start; }
.chat-message-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 9px; font-size: 11px; }
.chat-message-header strong { color: var(--accent); }
.chat-message-header span { color: var(--soft); font-size: 10px; overflow-wrap: anywhere; text-align: right; }
.chat-message-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 13px; }
.chat-status { margin: 0; padding: 12px 20px; color: var(--muted); background: #181817; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.6; }
.chat-composer { margin: 0; padding: 18px 20px 20px; border-top: 1px solid var(--line); background: #191919; }
.chat-composer textarea { display: block; width: 100%; min-height: 96px; resize: vertical; padding: 14px; border: 1px solid #45423a; border-radius: 13px; color: var(--text); background: #101010; font: inherit; font-size: 13px; line-height: 1.6; }
.chat-composer textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.chat-composer-footer .muted { font-size: 10px; }
.chat-composer-footer .primary-button { margin: 0; min-height: 43px; font-size: 12px; }
button:disabled, textarea:disabled { opacity: .6; cursor: wait; }
@media (max-width: 700px) {
  .chat-toolbar { grid-template-columns: 1fr 1fr; align-items: start; }
  .chat-toolbar label { align-self: end; }
  .chat-header { padding: 17px; }
  .chat-transcript { padding: 14px; }
  .chat-message { max-width: 100%; }
  .chat-composer { padding: 15px; }
}
@media (max-width: 420px) {
  .chat-toolbar { grid-template-columns: 1fr; gap: 7px; padding: 14px; }
  .chat-toolbar label { margin-top: 5px; }
  .chat-composer-footer { align-items: stretch; flex-direction: column; }
  .chat-composer-footer .primary-button { width: 100%; }
  .chat-header { flex-direction: column; }
}

/* Build 06: Import & Continue */
#imports-panel .project-form { margin-top: 1rem; }
#import-content { width: 100%; min-height: 16rem; resize: vertical; font: inherit; line-height: 1.5; }
.import-list-heading { margin-top: 2rem; }
#imports-list .project-row { align-items: center; }
#imports-list .project-row button { flex-shrink: 0; }
@media (max-width: 680px) { #imports-list .project-row { align-items: stretch; flex-wrap: wrap; } #imports-list .project-row-main { flex-basis: 100%; } #imports-list .project-row button { flex: 1; } }

.context-preview-output { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--soft); background: #111; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-context .secondary-button { align-self: flex-start; }

.bible-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.bible-grid > div, .bible-record-grid > div { min-width:0; }
.bible-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; }
.bible-record-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:14px; }
.bible-record-form { margin-top:1rem; padding:16px; border:1px solid var(--line); border-radius:13px; }
.bible-record-row { display:flex; flex-direction:column; gap:8px; padding:15px; border:1px solid #343434; border-radius:13px; background:var(--panel); }
.bible-record-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.bible-record-title { font-weight:700; margin:0; }
.bible-record-meta { color:var(--muted); font-size:12px; margin:4px 0 0; }
.bible-record-fact { white-space:pre-wrap; overflow-wrap:anywhere; margin:0; line-height:1.55; }
.bible-record-actions { display:flex; flex-wrap:wrap; gap:8px; }
.status-pill { display:inline-flex; border:1px solid #49443a; border-radius:999px; padding:4px 8px; font-size:11px; color:var(--muted); }
.status-pill.approved { color:#c8e6ce; border-color:#426b4a; }
@media (max-width:560px) { .bible-grid,.bible-record-grid { grid-template-columns:1fr; } .bible-actions > button { width:100%; } }


/* Build 10: Outline Workshop */
.outline-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}
.outline-toolbar label { grid-column: 1 / -1; }
#outline-json {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 2;
}
#outline-approve:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 680px) {
  .outline-toolbar { grid-template-columns: 1fr 1fr; }
  .outline-toolbar label { grid-column: 1 / -1; }
  #outline-version { grid-column: 1 / -1; }
  #outline-generate-chat { grid-column: 1 / -1; }
}


/* Build 11: Manuscript Workshop */
.manuscript-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.manuscript-summary > div {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px; border: 1px solid var(--border, #343434); border-radius: 12px;
}
.manuscript-summary strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.manuscript-toolbar {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto auto;
  gap: 10px; align-items: end; margin: 16px 0;
}
.manuscript-toolbar label { grid-column: 1 / -1; }
#manuscript-prose {
  width: 100%; min-height: 360px; resize: vertical;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1rem; line-height: 1.75; white-space: pre-wrap;
}
.manuscript-editor-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted, #999); font-size: .85rem; }
.manuscript-history { margin-top: 24px; }
.chat-message-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.chat-message-actions button { font-size: .85rem; }
@media (max-width: 680px) {
  .manuscript-summary { grid-template-columns: 1fr 1fr; }
  .manuscript-toolbar { grid-template-columns: 1fr 1fr; }
  .manuscript-toolbar label, #manuscript-unit-select { grid-column: 1 / -1; }
}


/* Build 12: Proofreader */
.proofreader-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 18px 0;
}
.proofreader-toolbar label { margin-top: 8px; }
.proofreader-source, .proofreader-results {
  border: 1px solid var(--border, #343434);
  border-radius: 14px;
  padding: 14px;
  margin-top: 16px;
}
.proofreader-source-heading, .proofreader-actions, .proofread-issue-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
#proofreader-source-text, #proofreader-revised-text {
  width: 100%; min-height: 260px; resize: vertical;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1rem; line-height: 1.7; white-space: pre-wrap;
  margin-top: 12px;
}
#proofreader-source-text { opacity: .82; }
.proofreader-actions { margin-top: 12px; }
.proofreader-summary { padding: 12px; border-radius: 10px; background: var(--surface-secondary, #242424); }
.proofread-issue {
  padding: 14px; border: 1px solid var(--border, #343434); border-radius: 12px;
  margin: 10px 0;
}
.proofread-issue-heading { align-items: flex-start; }
.proofread-issue p { overflow-wrap: anywhere; }
.proofread-original { margin-bottom: 4px; }
.proofread-suggestion { margin-top: 4px; font-weight: 600; }
@media (max-width: 680px) {
  .proofreader-source, .proofreader-results { padding: 10px; }
  .proofreader-actions > button { width: 100%; }
}

/* Build 14: book assembly and export */
.assembly-toggles{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:18px 0}.assembly-toggles label{display:flex;align-items:flex-start;gap:8px;font-size:.9rem}.assembly-toggles input{margin-top:3px}.assembly-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.assembly-checklist{display:grid;gap:8px;margin:12px 0}.assembly-check-item{border:1px solid var(--border,#343434);border-radius:10px;padding:10px 12px}.assembly-check-item strong{display:block;margin-bottom:4px}.assembly-check-item p{margin:0;color:var(--muted,#999);font-size:.9rem}.assembly-check-item.warning{border-color:#8c7445}.assembly-check-item.pass{border-color:#426b55}@media(max-width:680px){.assembly-actions>button{width:100%}}

/* Build 02: Roxy Universal Story Desk */
.factory-saved-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:end;margin:18px 0}.factory-saved-select{min-width:0}.factory-saved-select select{width:100%}.factory-form{margin-top:16px}.factory-form-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.factory-form-heading h3{margin:7px 0 0}.format-pill{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:11px;white-space:nowrap}.factory-section-label{display:flex;align-items:baseline;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:20px 0 10px;margin:8px 0 14px;font-weight:700}.factory-section-label small{font-weight:400;color:var(--muted);font-size:11px}.factory-form textarea,.factory-form select{display:block;width:100%;min-height:48px;padding:12px 14px;border:1px solid #3b3a37;border-radius:12px;color:var(--text);background:#111;font:inherit;resize:vertical}.factory-form textarea{line-height:1.55}.factory-form select{min-height:50px}.factory-form .bible-grid{margin-top:10px}.factory-form .format-summary{white-space:pre-line;line-height:1.65}.factory-checkbox{display:flex;align-items:flex-start;gap:10px;margin:16px 0;padding:13px;border:1px solid var(--line);border-radius:12px;line-height:1.5}.factory-checkbox input{width:20px;height:20px;min-height:20px;flex:0 0 auto;margin:1px 0 0;accent-color:var(--accent)}.factory-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:8px}.factory-actions button{width:100%}.factory-lineage{margin-top:18px}.factory-lineage h3{margin-top:0}.factory-lineage .record-card{overflow-wrap:anywhere}.factory-lineage .record-card .secondary-button{margin-top:8px}.factory-saved-row select{min-height:50px;width:100%;padding:12px;border:1px solid #3b3a37;border-radius:12px;background:#111;color:var(--text)}
@media(max-width:680px){.factory-saved-row{grid-template-columns:1fr 1fr}.factory-saved-select{grid-column:1/-1}.factory-saved-row button{width:100%}.factory-actions{grid-template-columns:1fr}.factory-section-label{align-items:flex-start;flex-direction:column;gap:5px}.factory-form-heading{align-items:flex-start;flex-direction:column}}
.factory-blueprint{margin-top:20px}.factory-blueprint textarea{display:block;width:100%;min-height:260px;margin:8px 0 14px;padding:14px;border:1px solid #3b3a37;border-radius:12px;background:#111;color:var(--text);font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical}.factory-blueprint h4{margin:20px 0 10px}.factory-blueprint .record-card{overflow-wrap:anywhere}

/* Build 06 · Chapter production queue */
.production-queue { margin-top: 1rem; }
.production-queue-list { display: grid; gap: .75rem; margin-top: .75rem; }
.production-queue-item { border: 1px solid var(--border, #d9dce2); border-radius: 12px; padding: .85rem; display: grid; gap: .6rem; }
.production-queue-item-head { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.production-queue-title { font-weight: 650; overflow-wrap: anywhere; }
.production-queue-meta { color: var(--muted, #697386); font-size: .9rem; }
.queue-status { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border, #d9dce2); border-radius: 999px; padding: .2rem .6rem; font-size: .82rem; white-space: nowrap; }
.queue-status[data-status="approved"] { border-color: #5c9d76; }
.queue-status[data-status="draft"] { border-color: #c39b4b; }
.production-queue-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.queue-summary { color: var(--muted, #697386); font-size: .95rem; }

/* Build 07 · Story continuity ledger */
.continuity-ledger { margin-top: 1.25rem; }
.continuity-ledger .project-form { margin-top: .75rem; }
.continuity-record { border: 1px solid var(--border, #d9dce2); border-radius: 12px; padding: .85rem; display: grid; gap: .55rem; }
.continuity-record-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.continuity-record-head > div { display: grid; gap: .25rem; }
.continuity-category, .continuity-terms, .continuity-match-details { font-size: .9rem; color: var(--muted, #697386); }

/* Build 08 · Continuity-aware writing context */
.continuity-context-panel { margin-top: 1rem; }
.continuity-context-list { display: grid; gap: .5rem; margin: .75rem 0; max-height: 360px; overflow-y: auto; }
.continuity-context-option { display: flex; align-items: flex-start; gap: .65rem; border: 1px solid var(--border, #d9dce2); border-radius: 10px; padding: .7rem; cursor: pointer; }
.continuity-context-option input { margin-top: .25rem; flex: 0 0 auto; }
.continuity-context-option > span { display: grid; gap: .25rem; min-width: 0; }
.continuity-context-option > span > span { color: var(--muted, #697386); font-size: .9rem; overflow-wrap: anywhere; }


/* Build 09 · Draft Review & Continuity QA */
.draft-qa-panel{margin-top:1.25rem}.draft-qa-findings{display:grid;gap:.65rem;margin:.8rem 0}.draft-qa-item{border:1px solid var(--border,#d9dce2);border-radius:11px;padding:.8rem;display:grid;gap:.45rem}.draft-qa-item[data-level="review"]{border-color:#b58b45}.draft-qa-item[data-level="pass"]{border-color:#5c9d76}.draft-qa-item-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.6rem}.draft-qa-item p{margin:0;line-height:1.5;overflow-wrap:anywhere}.draft-qa-panel textarea{width:100%;margin-top:.5rem;resize:vertical;font: .88rem/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:680px){.draft-qa-panel .section-heading{align-items:flex-start;flex-direction:column}.draft-qa-panel .section-heading button{width:100%}}
