/* Michael's creative tools share the paper/ink shell. Preview canvases and
   generated artwork keep their own appearance; this layer styles controls. */
:root {
  --paper: #F2EFE8; --paper-raised: #FBF9F4; --paper-inset: #E8E4DA;
  --ink: #111110; --soft: #4A4740; --quiet: #736E64; --rule: rgba(17,17,16,.17);
  --blue: #1F3DFF;
}
html { background: var(--paper); color-scheme: light; }
body.michael-tool {
  background: var(--paper) !important; color: var(--ink) !important;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif !important;
  --bg: var(--paper); --bg-primary: var(--paper); --bg-secondary: var(--paper-inset);
  --surface: var(--paper-raised); --surface2: var(--paper-inset); --separator: var(--rule);
  --text: var(--ink); --text2: var(--soft); --text3: var(--quiet);
  --text-primary: var(--ink); --text-secondary: var(--soft); --text-muted: var(--quiet);
  --accent: var(--blue); --accent2: var(--blue); --primary: var(--blue);
  --border: var(--rule); --border-color: var(--rule);
  --void: var(--paper); --deep: var(--paper); --panel: var(--paper-inset); --elevated: var(--paper-raised);
  --border-bright: rgba(17,17,16,.28); --text-tertiary: var(--quiet);
  --amber: var(--blue); --amber-dark: #1832D6; --amber-glow: transparent;
  --cyan: var(--blue); --cyan-dark: #1832D6; --cyan-glow: transparent;
  --orange: var(--blue); --orange-glow: transparent; --gold: #946008; --gold-glow: transparent;
  --bg-dark: var(--paper); --bg-darker: var(--paper); --bg-panel: var(--paper-raised);
  --neon-cyan: var(--blue); --neon-blue: var(--blue); --neon-purple: var(--blue);
}
body.michael-tool ::selection { background: var(--blue); color: #fff; }
body.michael-tool :where(button,input,textarea,select) { font-family: inherit; }
body.michael-tool :where(h1,h2,h3,h4,.header-logo .title,.boot-logo,.library-title,.editor-mode-tab,.section-title) { font-family: inherit !important; letter-spacing: -.035em; }
body.michael-tool :where(button,a,input,textarea,select):focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
body.michael-tool :where(.starfield,.nebula,.tron-grid,.crt-overlay,.crt-lines,.crt-vignette,.crt-scanline,.matrix-fog,.scanlines,.vignette,.bg-video-wrap,.hero-aurora,.particles) { display: none !important; }
body.michael-tool :where(.d-topbar,.s-topbar,.topbar,.header,.toolbar,.status-bar,.statusbar,.nav) {
  background: var(--paper) !important; color: var(--ink) !important;
  border-color: var(--rule) !important; box-shadow: none !important; text-shadow: none !important;
}
body.michael-tool :where(.topbar-title,.d-topbar-title,.s-topbar-title,.logo,.logo-text,.brand,.hero h1,.hero h2) {
  color: var(--ink) !important; -webkit-text-fill-color: var(--ink) !important;
  background-image: none !important; text-shadow: none !important;
}
body.michael-tool :where(.d-bottom,.d-prompt-section,.d-controls,.d-access-summary,.s-tabs,.s-upload-zone,.s-options,.s-settings,.s-login,.auth-section,.promo-banner,.panel,.sidebar,.file-tree-panel,.file-tree-header,.focus-pack-panel,.chat-panel,.preview-header,.editor-header,.book-sidebar,.chapter-sidebar,.writing-panel,.comparison-card,.feature-card,.pricing-card,.testimonial-card) {
  background: var(--paper-raised) !important; color: var(--ink) !important;
  border-color: var(--rule) !important; box-shadow: none !important;
}
body.michael-tool :where(.d-section-label,.s-upload-hint,.d-access-description,.s-upload-text,.form-group label,.section-tag,.section-subtitle,.hero p,.feature-card p,.pricing-card p,.testimonial-card p) { color: var(--soft) !important; }
body.michael-tool :where(input:not([type=range]):not([type=checkbox]):not([type=radio]),textarea,select) {
  background: var(--paper-raised) !important; color: var(--ink) !important;
  border-color: var(--rule) !important; box-shadow: none !important;
}
body.michael-tool :where(input,textarea)::placeholder { color: var(--quiet) !important; opacity: 1; }
body.michael-tool :where(.d-generate-btn,.s-generate-btn,.submit-btn,.btn-primary,.cta-primary,.primary-btn) {
  background: var(--blue) !important; color: #fff !important; -webkit-text-fill-color: #fff !important;
  box-shadow: none !important; border-color: var(--blue) !important;
}
body.michael-tool :where(.d-topbar-back,.s-topbar-back,.topbar-btn,.toolbar-btn,.back-btn,.nav a,.nav-link,.file-tree-item,.chapter-item,.tab,.s-tab) { color: var(--soft) !important; }
body.michael-tool #dreamifyBgVideo,
body.michael-tool .dreamify-app::before,
body.michael-tool .dreamify-app::after,
body.michael-tool .d-topbar::before,
body.michael-tool .d-topbar::after { display: none !important; }
body.michael-tool :where(.dreamify-app,.d-scroll,.d-bottom-bar,.studio-app,.s-content) { background: var(--paper) !important; }
body.michael-tool :where(.d-input-box,.d-edit-bar,.d-upload-status,.d-confirm-card,.d-login-card,.d-aspect-menu,.d-studio-link,.s-prompt-box) {
  background: var(--paper-raised) !important; color: var(--ink) !important;
  border: 1px solid var(--rule) !important; box-shadow: none !important;
}
body.michael-tool :where(.d-video-allowance,.d-empty p,.d-empty svg,.d-attach-btn,.d-send-btn,.d-studio-link) { color: var(--soft) !important; }
body.michael-tool .d-empty { background: transparent !important; border: 1px solid var(--rule) !important; box-shadow: none !important; border-radius: 0 !important; }
body.michael-tool .d-access-summary { border-radius: 0 !important; border: 0 !important; border-bottom: 1px solid var(--rule) !important; }
body.michael-tool .d-access-upgrade { background: transparent !important; border-radius: 0 !important; border: 0 !important; border-bottom: 1px solid var(--ink) !important; }
body.michael-tool :where(.book-card,.outline-chapter-item,.ai-action-btn,.header-btn,.editor-mode-tab,.new-book-btn) { border-radius: 0 !important; box-shadow: none !important; }
body.michael-tool :where(header,#editor-toolbar,#editor-mode-tabs) { background: var(--paper-inset) !important; }
body.michael-tool :where(.tab.active,.s-tab.active,.file-tree-item.active,.chapter-item.active) { color: var(--blue) !important; background: var(--paper-inset) !important; }
body.michael-tool :where(.boot-logo,.boot-subtitle,.boot-status,.boot-diagnostics,.boot-screen,#bootScreen) { background-color: var(--paper) !important; color: var(--ink) !important; text-shadow: none !important; }
/* The Junior landing page uses the same calm shell; its play content remains colorful. */
body.michael-tool :where(.hero,.section-alt,.section,.content-wrap,.cta-section,.footer) { background-color: var(--paper) !important; }
@media (max-width: 640px) {
  body.michael-tool :where(.d-topbar,.s-topbar,.topbar) { padding-left: 16px; padding-right: 16px; }
}

/* Keep the writing studio legible against paper, including inline controls. */
body.michael-tool { --green: #187344; --purple: #6943AD; --red: #B3322A; }
body.michael-tool :where(button,input,textarea,select,.outline-label,.notes-panel-title,.tools-section-title,.publish-card-title,.modal-title,.modal-label,.writing-status) { font-family: "Geist", ui-sans-serif, system-ui, sans-serif !important; letter-spacing: normal !important; }
body.michael-tool :where(.book-card.active,.breadcrumb-item.active,.ai-action-btn,.new-book-btn,.generate-btn) { background: var(--paper-inset) !important; }
body.michael-tool :where(#booklab-tools,.tools-section,.publish-card) { background: var(--paper-raised) !important; border-color: var(--rule) !important; box-shadow: none !important; }
body.michael-tool #editor-toolbar { flex-wrap: wrap; gap: 10px; }
body.michael-tool #editor-toolbar > div { flex-wrap: wrap; }
body.michael-tool .header-logo .title { background: none !important; color: var(--ink) !important; -webkit-text-fill-color: var(--ink) !important; letter-spacing: -.04em !important; }

/* App Builder's editor chrome; generated preview iframe stays independent. */
body.michael-tool { --bg-tertiary: var(--paper-inset); --bg-hover: #E2DED3; --bg-active: #D7D2C6; --border-primary: var(--rule); --border-secondary: var(--rule); --accent-blue: var(--blue); --success: #187344; --accent-green: #187344; --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif; }
body.michael-tool :is(.left-panel,.right-panel,.lp-header,.rp-header,.chat-form,.preview-wrap,.preview-empty,.suggestion-card,.console-panel,.console-header,.console-body,.code-file-tabs,.code-line-numbers,.studio-activity-bar,.studio-side-panel,.github-modal,.github-status-card,.github-file-review,.github-modal-actions,.builder-beta-dialog,#cookie-consent-banner) { background: var(--paper-raised) !important; color: var(--ink) !important; border-color: var(--rule) !important; box-shadow: none !important; }
body.michael-tool :is(.msg-body,.msg-role.user,.preview-empty-title,.suggestion-card,.builder-beta-dialog h2,.github-modal-title,.github-status-user,.github-checkbox-title) { color: var(--ink) !important; }
body.michael-tool :is(.lp-header-left,.studio-model-badge,.lp-header-dot,.msg-role.assistant,.topbar-left a,.console-tab.active,.rp-tab.active) { color: var(--blue) !important; }
body.michael-tool :is(.preview-empty-sub,.suggestion-card span,.suggestion-card div,.builder-beta-dialog p,.console-tab,.console-clear,.console-empty,.msg-meta,.msg-time,.rp-tab,.lp-header-btn,.rp-action-btn,.chat-action-btn,.github-status-subtitle,.github-field-label,.github-checkbox-hint,.github-file-review-hint) { color: var(--soft) !important; }
body.michael-tool :is(.rp-tab.active,.code-file-tab,.code-file-tab.active,.studio-model-badge,.github-publish-btn,.builder-beta-badge) { background: var(--paper-inset) !important; border-color: var(--rule) !important; color: var(--ink) !important; }
body.michael-tool .builder-beta-overlay { background: rgba(242,239,232,.8) !important; }
body.michael-tool :is(.builder-beta-continue,.github-btn.primary) { background: var(--blue) !important; color: #fff !important; }
body.michael-tool .chat-form::before { display: none !important; }
body.michael-tool .topbar-center { min-width: 0; position: static; transform: none; margin-left: auto; }
body.michael-tool .topbar { gap: 12px; }

/* Competition policies retain their clauses in the same readable paper style. */
body.michael-legal { --card: var(--paper-raised); --dim: var(--soft); --muted: var(--quiet); --font-display: "Geist", sans-serif; --font-tech: "Geist", sans-serif; --font-body: "Geist", sans-serif; font-weight: 400; }
body.michael-legal :is(.doc-title,.legal-section h2,.legal-section h3,.callout-title,strong) { color: var(--ink) !important; font-family: inherit !important; text-shadow: none !important; letter-spacing: -.02em; }
body.michael-legal :is(.callout,.toc,.doc-header,.doc-footer,.legal-section) { border-color: var(--rule) !important; }
body.michael-legal :is(.callout,.toc) { background: var(--paper-raised) !important; border-radius: 0; }
body.michael-legal :is(.doc-brand,.doc-subtitle,.doc-meta,.doc-footer) { color: var(--soft) !important; }
