:root,[data-theme="editorial"]{--bg:#f6f5f1;--paper:#fff;--surface:#fff;--surface-alt:#f0f1e9;--field:#fcfdf9;--ink:#293529;--muted:#74816c;--line:#dfe4d5;--orange:#b95737;--orange-soft:#f3e6dd;--green:#657968;--on-accent:#fff;--ornament:#9da98e;--focus:#bd775933;color-scheme:light}
[data-theme="forest"]{--bg:#f1f4ee;--paper:#fffef8;--surface:#fffef8;--surface-alt:#e4ebdf;--field:#f8faf3;--ink:#223e30;--muted:#647b68;--line:#d0ddcb;--orange:#346b50;--orange-soft:#e0ecdf;--green:#406c4a;--on-accent:#fff;--ornament:#91a47d;--focus:#346b5033;color-scheme:light}
[data-theme="royal"]{--bg:#f6f2f8;--paper:#fffdfd;--surface:#fffdfd;--surface-alt:#eee6f1;--field:#fcf8fe;--ink:#3f2c4a;--muted:#83718e;--line:#e2d6e9;--orange:#81529b;--orange-soft:#efe2f6;--green:#786782;--on-accent:#fff;--ornament:#ad94bb;--focus:#81529b33;color-scheme:light}
[data-theme="midnight"]{--bg:#171e24;--paper:#202a32;--surface:#202a32;--surface-alt:#26343d;--field:#1c252d;--ink:#eee9df;--muted:#a5b6b8;--line:#3a4a52;--orange:#efa87e;--orange-soft:#44372f;--green:#b0c5af;--on-accent:#27231f;--ornament:#9eaf96;--focus:#efa87e33;color-scheme:dark}
body{background:var(--bg);color:var(--ink)}
.ui-icon{display:inline-block;vertical-align:middle;flex-shrink:0;width:20px;height:20px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}
.icon-starburst{color:var(--ornament);stroke-width:1.05}
.topbar,.paper,.article-panel,.auth-card,.dropdown,.small-dialog,.preview-dialog,.settings-form,.template-card,.article-card,.media-item,.public-empty{background:var(--surface);color:var(--ink);border-color:var(--line)}
.sidebar,.top-note,.local-note,.tag-box,.cover-thumbnail{background:var(--surface-alt);border-color:var(--line)}
.headline-field,.share-controls input,.auth-card input:not([type=checkbox]),.panel-section input,.panel-section select,.settings-form>input,.small-dialog input,.small-dialog textarea,#searchForm{background:var(--field);color:var(--ink);border-color:var(--line)}
.headline-field{border-color:var(--line)}
.headline-field:focus-within,.story-body-field:focus-within{border-color:var(--orange);box-shadow:0 0 0 3px var(--focus)}
.article-title,.reading-page h1,.news-card h2,.article-card h2,.page-heading h1,.section-heading h1,.template-card h2,.auth-card h1,.panel-title h2,.section-row h3{color:var(--ink)}
.article-body,.reading-body,.cover-caption,.article-subtitle,.reading-deck,.byline,.news-meta,.news-card p,.article-card p,.page-heading p,.section-heading p,.auth-card>p,.auth-note,.public-footer p,.panel-section label,.field-note,.field-note#tagHelp,.share-heading,.share-heading label,.share-heading span,.below-paper,.paper-footer,.writing-tip p,.writing-tip strong,.saved-tags-heading,.goal-section p,.goal-numbers,.profile strong,.profile small,.settings-form small,.settings-description,.tag-empty{color:var(--muted)}
.article-body h2,.article-body h3,.reading-body h2,.reading-body h3,.byline>span:nth-child(2),.breadcrumb strong{color:var(--ink)}
.nav-item,.eyebrow,.editor-link,.back-link,.text-button,.live-link,.complete-button,.seo-row,.icon-button,.logout-button,.format-bar button,.format-bar select,.news-tools nav button,.today,.public-footer>span{color:var(--muted)}
.nav-item.active,.news-tools nav button.active,.badge.ready,.tag,.reading-tags span,.tag-suggestions button[aria-pressed="true"]{background:var(--surface-alt);color:var(--ink);border-color:var(--line)}
.nav-item:hover,.icon-button:hover,.dropdown button:hover,.secondary:hover,.format-bar button:hover,.format-bar button.selected{background:var(--surface-alt)}
.secondary,.logout-button,.complete-button,.load-more,.tag-suggestions button,.share-controls button,.published-preview{background:var(--surface-alt);color:var(--ink);border-color:var(--line)}
.public-button,.publish-button,.new-button,.button.primary{background:var(--orange);color:var(--on-accent);border-color:var(--orange)}
.public-button:hover,.publish-button:hover,.new-button:hover,.button.primary:hover{background:var(--orange);filter:brightness(.94)}
.public-brand>span,.brand-dot,.public-hero h1 em,.article-body a,.reading-body a,.news-category{color:var(--orange)}
.paper-footer,.panel-title,.panel-section,.app-footer,.public-header,.public-footer,.news-tools,.public-hero,.news-card,.auth-note,.profile,.seo-row{border-color:var(--line)}
.brand-mark{background:var(--orange);color:var(--on-accent)}
.tiny-avatar,.avatar{background:var(--surface-alt);color:var(--ink)}
.hero-star{display:block;width:100px;height:100px}
.hero-star .ui-icon{display:block;width:100%;height:100%}
.empty-star{display:flex;align-items:center;justify-content:center;width:54px;height:54px}
.empty-star .ui-icon{width:54px;height:54px}
.no-cover .icon-starburst{width:55px;height:55px}
.editorial-stamp>span .ui-icon{width:32px;height:32px}
.goal-icon .ui-icon{width:20px;height:20px}
.writing-tip>span .ui-icon{width:20px;height:20px}
.app-footer .ui-icon,.public-footer .ui-icon{width:16px;height:16px;margin-left:5px}
.new-button>span{display:inline-flex;align-items:center}
.new-button>span .ui-icon{width:17px;height:17px}
.nav-item>.icon-external{width:13px;height:13px;margin-left:auto}
.editor-link .ui-icon,.back-link .ui-icon,.load-more .ui-icon{width:15px;height:15px}
.back-link{display:inline-flex;align-items:center;gap:7px}
.public-footer{display:flex;flex-wrap:wrap}
.public-footer .site-disclaimer{flex:0 0 100%;max-width:100%;width:100%;font-size:11px;line-height:1.9;color:var(--muted);margin:12px 0 0;padding-top:22px;border-top:1px solid var(--line)}
.preview-disclaimer{font:11px/1.9 var(--font);color:var(--muted);margin-top:35px;padding-top:20px;border-top:1px solid var(--line)}
.story-body-field{border:1px solid var(--line);border-radius:9px;margin:22px 0 10px;background:var(--field);transition:border-color .15s,box-shadow .15s;overflow:clip}
.body-field-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;background:var(--surface-alt);border-bottom:1px solid var(--line)}
.body-field-heading h2{font:600 11px/1.5 var(--font);letter-spacing:.3px;color:var(--ink);margin:0}
.body-field-heading>span{font-size:9px;color:var(--muted)}
.story-body-field .format-bar{border-bottom-color:var(--line);background:var(--surface);border-radius:0;padding:10px 12px;gap:4px}
.story-body-field .article-body{min-height:370px;padding:22px;background:var(--field);color:var(--ink);line-height:1.8}
.preview-article .article-body,.reading-body{line-height:1.8}
.article-body p{margin-bottom:12px}.reading-body p{margin-bottom:18px}
.small-dialog.image-dialog{width:min(720px,calc(100vw - 32px));max-width:720px;max-height:85vh;padding:26px;overflow:auto}
.image-picker-note{font-size:12px;line-height:1.8;color:var(--muted);margin:14px 0 20px}
.image-picker-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding-bottom:22px;border-bottom:1px solid var(--line)}
.image-picker-actions .button{display:inline-flex;align-items:center;gap:7px;min-height:42px}
.image-picker-actions>span{font-size:10px;color:var(--muted)}
.image-library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 12px}
.image-library-heading h3{margin:0;font:600 12px/1.5 var(--font)}.image-library-heading>span{font-size:10px;color:var(--muted)}
.image-dialog #imageSearch{margin:0 0 15px;width:100%;font-size:12px}
.image-picker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-height:350px;overflow:auto;padding:3px}
.image-choice{display:flex;flex-direction:column;min-width:0;border:1px solid var(--line);border-radius:7px;overflow:hidden;text-align:left;padding:0;background:var(--field);color:var(--ink);font:11px/1.5 var(--font);cursor:pointer}
.image-choice:hover{border-color:var(--orange);background:var(--surface-alt)}.image-choice:focus-visible{outline:2px solid var(--orange);outline-offset:1px}
.image-choice img{display:block;width:100%;aspect-ratio:1.45;object-fit:cover;background:var(--surface-alt)}
.image-choice span{display:block;max-width:100%;padding:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.image-picker-empty{grid-column:1/-1;text-align:center;padding:25px 12px;font-size:12px;line-height:1.8;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:700px){.small-dialog.image-dialog{padding:20px;max-height:88dvh}.image-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:40dvh;gap:10px}.image-dialog #imageSearch{font-size:16px}.image-choice{min-height:44px}.image-picker-actions>span{font-size:9px}}
.share-controls{align-items:stretch}
.share-actions{display:flex;align-items:stretch;gap:7px;flex-shrink:0}
.share-controls button,.published-preview{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);border-radius:6px;padding:10px 11px;font-size:11px;line-height:1.5;min-height:40px;text-decoration:none;white-space:nowrap}
.share-controls button .ui-icon,.published-preview .ui-icon{width:16px;height:16px}
.published-preview:hover:not(.is-disabled),.share-controls button:hover:not(:disabled){background:var(--surface-alt);border-color:var(--orange)}
.published-preview.is-disabled{opacity:.45;cursor:default;pointer-events:none}
.share-controls button:disabled{opacity:.45}
.tag-suggestions button{display:inline-flex;align-items:center;gap:4px}
.tag-suggestions .ui-icon{width:12px;height:12px}
.publish-button{gap:7px}.publish-button .ui-icon{width:15px;height:15px}
.upload-status{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);z-index:90;background:var(--surface);border:1px solid var(--line);border-radius:7px;color:var(--ink);padding:13px 22px;box-shadow:0 5px 25px #0002;font-size:12px}
.cover-edit{opacity:1;min-height:34px;background:#26332bd9;color:#fff;font-size:10px;padding:7px 9px}
.cover-edit .ui-icon{width:15px;height:15px}
.media-actions{display:flex;align-items:center;gap:8px}
.media-actions .ui-icon{width:16px;height:16px}
.media-actions [data-remove-media]{padding:8px;border:1px solid var(--line);border-radius:5px}
.settings-description{font-size:11px;line-height:1.9;margin:12px 0 20px}
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin:20px 0 30px}
.settings-form .theme-card{position:relative;border:1px solid var(--line);border-radius:9px;padding:12px;cursor:pointer;margin:0;background:var(--surface);min-width:0}
.theme-card:has(input:checked){outline:2px solid var(--orange);outline-offset:2px}
.theme-card:has(input:focus-visible){outline:3px solid var(--orange)}
.theme-card>input{position:absolute;right:14px;top:14px;appearance:none;background:var(--field);border:1.5px solid var(--muted);border-radius:50%;width:16px;height:16px;margin:0;cursor:pointer}
.theme-card>input:checked{background:var(--orange);border-color:var(--orange);box-shadow:inset 0 0 0 3px var(--field)}
.theme-card strong{display:block;font-size:12px;margin:10px 0 3px;color:var(--ink)}
.settings-form .theme-card small{font-size:9px;line-height:1.7;margin:0;color:var(--muted)}
.theme-sample{display:block;padding:16px;border-radius:5px;background:#f5f3eb;color:#35452c;border:1px solid #dfe4d5}
.theme-sample>span{font:24px/1.2 var(--serif);color:#bd5d3c}
.theme-sample i{display:block;margin-top:10px;width:85%;height:3px;background:currentColor;opacity:.2}
.theme-sample i:last-child{width:60%;margin-top:5px}
[data-theme-option="forest"] .theme-sample{background:#e7efdf;color:#28583d;border-color:#cadaC1}
[data-theme-option="forest"] .theme-sample>span{color:#346b50}
[data-theme-option="royal"] .theme-sample{background:#f0e6f4;color:#664378;border-color:#d8c5e0}
[data-theme-option="royal"] .theme-sample>span{color:#81529b}
[data-theme-option="midnight"] .theme-sample{background:#1c272e;color:#dae2da;border-color:#3a4a52}
[data-theme-option="midnight"] .theme-sample>span{color:#efa87e}
.profile-settings-heading{margin-top:30px!important}
@media(max-width:1000px){.story-body-field .format-bar{flex-wrap:wrap}.story-body-field .format-bar select{width:110px}.story-body-field .format-bar .toolbar-spacer{display:none}}
@media(max-width:700px){
  .topbar{height:auto;min-height:90px;flex-wrap:wrap;padding:11px 16px;gap:8px}.top-actions{order:5;width:100%;justify-content:flex-end;margin:0}.top-actions .button{font-size:11px;min-height:36px;padding:9px 12px}.top-actions .preview-button{font-size:11px;padding:9px 12px}.top-actions .button .ui-icon{width:16px;height:16px}.logout-button{margin-left:auto}.breadcrumb{flex:1}.focus-mode .topbar{justify-content:flex-end}
  .share-controls{flex-wrap:wrap}.share-controls input{flex-basis:100%;font-size:12px}.share-actions{width:100%}.share-actions button,.share-actions .published-preview{flex:1;width:auto;min-height:42px;font-size:11px}
  .body-field-heading{padding:13px 14px}.body-field-heading>span{display:none}.story-body-field .article-body{min-height:350px;padding:18px;font-size:16px}.story-body-field .format-bar{gap:3px;padding:10px 8px;overflow:visible}.story-body-field .format-bar button{min-height:30px;min-width:27px}.story-body-field .format-bar button[data-command="strikeThrough"]{display:grid}.story-body-field .format-bar .toolbar-divider{margin:0 2px}.story-body-field .format-bar select{width:100px}
  .hero-star{width:75px;height:75px}.public-footer{display:flex}.public-footer .site-disclaimer{font-size:10px;line-height:1.9}.theme-grid{gap:10px}.settings-form .theme-card{padding:10px}.theme-sample{padding:13px}.settings-form{padding:22px}.cover-edit{min-height:34px;font-size:9px}.cover-edit .ui-icon{width:15px;height:15px}.editorial-stamp{display:flex;font-size:0;letter-spacing:0;position:absolute;right:0;top:0}.editorial-stamp>span .ui-icon{width:26px;height:26px}.page-heading{position:relative;padding-right:28px}
}
@media print{.body-field-heading,.story-body-field .format-bar{display:none!important}.story-body-field{border:0;background:none}.story-body-field .article-body{padding:0}.theme-grid,.share-actions{display:none!important}}

.reset-story-link{font:10px/1.5 var(--font);color:var(--orange);padding:0;text-decoration:underline;text-underline-offset:3px}
.story-link-hint{font-size:10px;color:var(--muted);line-height:1.7;margin:9px 0 0}
.story-link-hint.error{color:#b14e37}
[data-theme="midnight"] .story-link-hint.error{color:#ffb49e}
.share-controls #publishedUrl{cursor:text}
.article-body [data-story-cover="true"],.reading-body [data-story-cover="true"]{margin:0 0 18px;display:block}
.article-body [data-story-cover="true"] img,.reading-body [data-story-cover="true"] img{display:block;width:100%;height:auto;margin:0;border-radius:4px}
.reading-body .reading-cover-caption{font:italic 12px/1.8 var(--serif);color:var(--muted);text-align:center;margin:-10px 0 28px}

.article-body [data-text-align="left"],.reading-body [data-text-align="left"]{text-align:left}
.article-body [data-text-align="center"],.reading-body [data-text-align="center"]{text-align:center}
.article-body [data-text-align="right"],.reading-body [data-text-align="right"]{text-align:right}
.article-body [data-text-align="justify"],.reading-body [data-text-align="justify"]{text-align:justify}
.article-body img[data-image-align],.reading-body img[data-image-align]{display:block;width:auto;max-width:100%;height:auto}
.article-body img[data-image-align="left"],.reading-body img[data-image-align="left"]{margin-left:0;margin-right:auto}
.article-body img[data-image-align="center"],.reading-body img[data-image-align="center"]{margin-left:auto;margin-right:auto}
.article-body img[data-image-align="right"],.reading-body img[data-image-align="right"]{margin-left:auto;margin-right:0}
.story-body-field .format-bar{flex-wrap:wrap}
.alignment-tools{display:inline-flex;align-items:center;gap:3px;flex-shrink:0}
.history-tools{display:inline-flex;align-items:center;gap:3px;margin-left:auto;flex-shrink:0}
.brand-name .brand-dot{font:600 18px/1.2 var(--serif);letter-spacing:-.5px;margin-top:2px}
.story-link-field{display:flex;align-items:stretch;flex:1;min-width:0;border:1px solid var(--line);border-radius:6px;background:var(--field);overflow:hidden}
.story-link-base{display:flex;align-items:center;flex-shrink:0;padding:10px 8px;background:var(--surface-alt);border-right:1px solid var(--line);color:var(--muted);font:10px/1.5 var(--font);white-space:nowrap;user-select:text}
.story-link-field #publishedUrl{flex:1;flex-basis:0;width:0;min-width:0;margin:0;border:0;border-radius:0;background:var(--field);color:var(--ink);padding:10px 9px;font-size:12px;outline:none;box-shadow:none}
.story-link-field:focus-within{border-color:var(--orange);box-shadow:0 0 0 3px var(--focus)}
@media(max-width:700px){.story-link-field{flex-basis:100%;flex-wrap:wrap}.story-link-base{width:100%;border-right:0;border-bottom:1px solid var(--line);padding:9px 11px;font-size:11px}.story-link-field #publishedUrl{flex-basis:100%;width:100%;font-size:16px;padding:11px}}
.article-body img.editor-selected-image{outline:2px solid var(--orange);outline-offset:3px;cursor:pointer}
.story-image-tools{position:fixed;z-index:80;display:flex;align-items:center;gap:3px;max-width:calc(100vw - 24px);padding:6px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:9px;box-shadow:0 5px 24px #0002}
.story-image-tools[hidden]{display:none}
.story-image-tools button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:40px;min-width:67px;padding:8px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--ink);font:11px/1.4 var(--font);cursor:pointer}
.story-image-tools .ui-icon{width:16px;height:16px}
.story-image-tools button:hover,.story-image-tools button[aria-pressed="true"]{background:var(--surface-alt);border-color:var(--line)}
.story-image-tools button:focus-visible{outline:2px solid var(--orange);outline-offset:0}
.story-image-tools [data-image-action="remove"]{color:#b14e37;border-left-color:var(--line);margin-left:3px}
[data-theme="midnight"] .story-image-tools [data-image-action="remove"]{color:#ffb49e}
@media(max-width:700px){.story-image-tools{gap:2px;padding:5px}.story-image-tools button{min-width:65px;min-height:42px;padding:7px;font-size:10px}}
@media print{.story-image-tools{display:none!important}.article-body img.editor-selected-image{outline:0}}
.footer-links{display:flex;flex-wrap:wrap;flex:0 0 100%;gap:13px 27px;align-items:center;padding-top:20px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.footer-links a{display:inline-block;padding:5px 0;text-decoration:none;line-height:1.7}.footer-links a:hover{color:var(--orange);text-decoration:underline;text-underline-offset:4px}.footer-links a:focus-visible{outline:2px solid var(--orange);outline-offset:4px}
.public-footer .site-disclaimer{margin-top:0;padding-top:17px}
.inbox-messages{display:grid;gap:14px}.inbox-message{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--orange);border-radius:7px;overflow:hidden}.inbox-message.is-read{border-left-color:var(--line)}.inbox-message summary{display:flex;flex-wrap:wrap;gap:8px 15px;align-items:center;padding:20px;cursor:pointer;list-style:none}.inbox-message summary::after{content:'+';margin-left:auto;color:var(--muted);font-size:19px}.inbox-message details[open] summary::after{content:'−'}.inbox-message summary:focus-visible{outline:2px solid var(--orange);outline-offset:-3px}.message-topic{flex-basis:100%;font-size:10px;color:var(--orange)}.inbox-message strong{font:500 21px/1.5 var(--serif);overflow-wrap:anywhere}.message-date{font-size:10px;color:var(--muted)}.message-content{padding:0 20px 22px}.message-content>p{font-size:12px;line-height:1.8;overflow-wrap:anywhere}.message-content a{color:var(--orange)}.message-reference{font-size:10px!important;color:var(--muted)}.message-text{white-space:pre-wrap;overflow-wrap:anywhere;padding:20px;background:var(--field);border:1px solid var(--line);border-radius:5px;font-size:13px;line-height:1.9}.message-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:18px}.message-actions .button{display:inline-flex;align-items:center;gap:7px;font-size:11px;min-height:40px;text-decoration:none;color:var(--ink)}.message-actions .ui-icon{width:15px;height:15px}.inbox-pagination{display:flex;align-items:center;justify-content:center;gap:20px;margin:25px 0;font-size:11px;color:var(--muted)}.inbox-pagination button:disabled,.message-actions button:disabled{opacity:.5;cursor:default}.inbox-error{color:var(--orange);font-size:13px;line-height:1.8}
@media(max-width:700px){.footer-links{display:grid;grid-template-columns:1fr 1fr;gap:9px 18px;font-size:11px}.footer-links a{min-height:36px}.message-actions .button{min-height:42px}.inbox-message summary,.message-content{padding-left:16px;padding-right:16px}.message-date{flex-basis:100%}.message-text{padding:15px}}
