/* blogcms admin — plain CSS, no build step */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #667085; --border: #e3e6eb;
  --primary: #3b5bdb; --primary-hover: #364fc7; --primary-soft: #edf2ff;
  --danger: #e03131; --danger-soft: #fff5f5; --ok: #2f9e44; --ok-soft: #ebfbee;
  --warn: #e67700; --warn-soft: #fff4e6; --side: #151923; --side-text: #c4c9d4; --side-active: #ffffff;
  --radius: 8px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
[x-cloak] { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; padding: 4px 8px 14px; }
.side .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #ff8f4d; }
.side select { width: 100%; background: #232838; color: #fff; border: 1px solid #333a4d; border-radius: 6px; padding: 6px 8px; margin-bottom: 14px; }
.side nav a { display: flex; align-items: center; justify-content: space-between; color: var(--side-text); padding: 7px 10px; border-radius: 6px; font-size: .93rem; }
.side nav a:hover { background: #20263a; color: #fff; text-decoration: none; }
.side nav a.active { background: #2b3350; color: var(--side-active); }
.side nav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #7c8499; margin: 16px 10px 4px; }
.side .count { background: #e8590c; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 28px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .who { color: var(--muted); font-size: .9rem; display: flex; gap: 14px; align-items: center; }
.content { padding: 24px 28px 64px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
/* the sidebar is always visible on wide screens; the menu button, close button and backdrop are for phones */
.topbar .menu-toggle, .side .side-close, .side-backdrop { display: none; }
.side .side-close { margin-left: auto; background: none; border: 0; color: var(--side-text); font-size: 1.1rem; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.side .side-close:hover { background: #20263a; color: #fff; }

/* components */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.card:has(> .table) { overflow-x: auto; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.split-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grid.split-side { grid-template-columns: 300px minmax(0, 1fr); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 7px 14px; border-radius: 6px; font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; line-height: 1.3; white-space: nowrap; }
.btn:hover { background: #f1f3f5; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #ffc9c9; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef0f3; }
.btn.small { padding: 4px 10px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] { opacity: .55; }
fieldset[disabled] * { cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }
.linkbtn.danger { color: var(--danger); }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: 3px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search],
input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; border: 1px solid #d0d5dd; border-radius: 6px; padding: 7px 10px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 8px; }
.check input { width: auto; margin: 0; }
.inline-form { display: inline; }
.popover-form { position: absolute; right: 30px; z-index: 5; width: min(280px, calc(100vw - 32px)); white-space: normal; }
@media (max-width: 800px) { .popover-form { right: 16px; } }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfcfd; }
.table .title { font-weight: 600; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f1f3f5; color: #495057; }
.badge.draft { background: #f1f3f5; color: #495057; }
.badge.review { background: var(--warn-soft); color: var(--warn); }
.badge.published, .badge.approved { background: var(--ok-soft); color: var(--ok); }
.badge.scheduled { background: var(--primary-soft); color: var(--primary); }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.spam { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
a.badge.warn { text-decoration: none; }
.badge.lang { background: #e7f5ff; color: #1971c2; text-transform: uppercase; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash.success { background: var(--ok-soft); border-color: #b2f2bb; color: #2b8a3e; }
.flash.error { background: var(--danger-soft); border-color: #ffc9c9; color: #c92a2a; }
.flash.info { background: var(--primary-soft); border-color: #bac8ff; color: #364fc7; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 14px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; font: inherit; cursor: pointer; margin-bottom: -1px; }
.tabs a.active, .tabs button.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; text-decoration: none; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.stat .num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .85rem; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: min(960px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal .body { padding: 18px; }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-tile { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; position: relative; }
.media-tile .thumb { aspect-ratio: 4 / 3; background: #f1f3f5 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.media-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .meta { padding: 6px 8px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile.selected { outline: 3px solid var(--primary); }
.dropzone { border: 2px dashed #ced4da; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); background: #fafbfc; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }

/* post editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-main { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 36px 60px; min-height: 70vh; }
.editor-main input.title-input { border: 0; outline: none; font-size: 2rem; font-weight: 700; line-height: 1.25; width: 100%; padding: 0; margin-bottom: 12px; background: transparent; font-family: inherit; }
.editor-side .card { padding: 14px; }
.editor-side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.editor-status { font-size: .82rem; color: var(--muted); }
.codex-editor__redactor { padding-bottom: 120px !important; }
.ce-block__content, .ce-toolbar__content { max-width: 760px; }
.cover-preview { border-radius: 6px; overflow: hidden; background: #f1f3f5; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.sticky-actions { position: sticky; top: 70px; }

/* custom Editor.js blocks */
.cms-block { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fcfcfd; margin: 6px 0; }
.cms-block .cms-block-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.cms-block input, .cms-block select, .cms-block textarea { margin-bottom: 6px; font-size: .92rem; }
.cms-block .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cms-block .inline-row { display: flex; gap: 6px; align-items: center; }
.cms-block .inline-row input { margin-bottom: 0; }
.cms-block .rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.cms-block .rm:hover { color: var(--danger); }
.cms-block .add { border: 1px dashed #ced4da; background: #fff; color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: .85rem; }
.cms-block img.preview { max-width: 100%; max-height: 320px; border-radius: 6px; display: block; margin: 0 auto 8px; }
.cms-block .gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-bottom: 8px; }
.cms-block .gallery-thumbs div { position: relative; aspect-ratio: 1; background: #eee center/cover; border-radius: 4px; }
.cms-block .gallery-thumbs button { position: absolute; top: 2px; right: 2px; background: rgba(0, 0, 0, .6); color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }
.cms-block textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; min-height: 140px; background: #1e1e2a; color: #e9ecef; border-color: #1e1e2a; tab-size: 4; }
.cms-block .ce-rich { border: 1px solid #d0d5dd; border-radius: 6px; padding: 7px 10px; background: #fff; min-height: 36px; outline: none; margin-bottom: 6px; }
.cms-block .ce-rich:empty::before { content: attr(data-placeholder); color: #adb5bd; }
.cms-block .callout-info { border-left: 4px solid #1c7ed6; } .cms-block .callout-tip { border-left: 4px solid #2f9e44; }
.cms-block .callout-warning { border-left: 4px solid #f08c00; } .cms-block .callout-danger { border-left: 4px solid #e03131; }
.cms-block .callout-note { border-left: 4px solid #868e96; }

/* theme editor */
.theme-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.theme-form { max-height: calc(100vh - 140px); overflow-y: auto; padding-right: 4px; }
.preview-frame { position: sticky; top: 70px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.preview-frame .bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fafbfc; font-size: .85rem; }
.preview-frame iframe { width: 100%; height: calc(100vh - 190px); border: 0; display: block; background: #fff; }
.preview-frame.mobile iframe { width: 390px; max-width: 100%; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.color-row label { margin: 0; flex: 1; font-weight: 500; font-size: .86rem; }
.color-row input[type=text] { width: 92px; font-family: ui-monospace, monospace; font-size: .82rem; }
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.preset { border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; background: #fff; text-align: left; font: inherit; }
.preset:hover { border-color: var(--primary); }
.preset .swatches { display: flex; gap: 3px; margin-bottom: 4px; }
.preset .swatches span { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .08); }

/* sortable lists (menus, homepage) */
.sortable-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fff; margin-bottom: 8px; }
.sortable-item .handle { display: flex; flex-direction: column; gap: 2px; }
.sortable-item .handle button { border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; font-size: .7rem; padding: 0 5px; line-height: 1.4; }
.sortable-item .body { flex: 1; min-width: 0; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.bar-cell { position: relative; }
.bar-cell .bar { position: absolute; inset: 4px auto 4px 0; background: var(--primary-soft); border-radius: 3px; z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }

/* getting started */
.progress { height: 8px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: start; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); scroll-margin-top: 80px; }
.step:target { outline: 2px solid var(--primary); }
.step p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.step-mark { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: .9rem; background: #fff; }
.step.is-done .step-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.is-done, .step.is-skipped { box-shadow: none; background: #fafbfc; }
.step.is-done strong, .step.is-skipped strong { color: var(--muted); }
.step-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.step-actions .linkbtn { font-size: .82rem; color: var(--muted); }
.guide-cards .card { margin-bottom: 0; }
.guide-cards p { margin: 0; color: #394150; font-size: .9rem; }
.setup-card { border-left: 4px solid var(--primary); }
@media (max-width: 800px) { .step { grid-template-columns: 32px minmax(0, 1fr); } .step-actions { grid-column: 2; flex-direction: row; align-items: center; } }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(380px, 100%); }

@media (max-width: 1100px) {
  .editor-layout, .theme-layout { grid-template-columns: 1fr; }
  .theme-form { max-height: none; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar .menu-toggle, .side .side-close { display: inline-flex; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 18, 28, .45); }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .grid.two, .grid.three, .grid.split-2-1, .grid.split-3-2, .grid.split-side { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .topbar .who { gap: 10px; flex-wrap: wrap; }
  .page-head .btn { white-space: normal; }
  .table th, .table td { padding: 8px 10px; }
  .editor-main { padding: 18px; }
  .table { font-size: .88rem; }
  .table .hide-sm { display: none; }
}

/* New site: theme picker with mini previews */
.theme-pick { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.theme-pick legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.theme-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-card { position: relative; display: block; border: 2px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; font-weight: 400; background: #fff; }
.theme-card:hover { border-color: var(--primary); }
.theme-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-info { padding: 8px 2px 0; }
.theme-info .small { margin-top: 2px; }
.mock { background: var(--m-bg); color: var(--m-text); font-family: var(--m-bfont); border: 1px solid var(--m-border); border-radius: 6px; padding: 10px; height: 170px; overflow: hidden; font-size: 9px; line-height: 1.3; }
.mock-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--m-border); }
.mock-logo { font-family: var(--m-hfont); font-weight: 700; font-size: 12px; color: var(--m-primary); }
.mock-menu { display: flex; gap: 4px; }
.mock-menu i { display: block; width: 18px; height: 4px; border-radius: 2px; background: var(--m-muted); opacity: .5; }
.mh-centered .mock-head { flex-direction: column; gap: 5px; }
.mh-minimal .mock-logo { font-size: 10px; }
.mock-title { font-family: var(--m-hfont); font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.mh-centered .mock-title { text-align: center; }
.mock-ptitle { font-family: var(--m-hfont); font-weight: 700; }
.mock-meta { color: var(--m-muted); font-size: 8px; }
.mock-img { background: linear-gradient(135deg, var(--m-primary), var(--m-accent)); opacity: .75; border-radius: var(--m-radius); }
/* card_style: grid */
.mc-grid .mock-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mc-grid .mock-post { background: var(--m-surface); border: 1px solid var(--m-border); border-radius: var(--m-radius); padding: 4px; }
.mc-grid .mock-img { height: 36px; margin-bottom: 4px; }
/* card_style: list */
.mc-list .mock-post { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--m-border); }
.mc-list .mock-img { width: 34px; height: 24px; flex: none; }
/* card_style: minimal */
.mc-minimal .mock-post { padding: 4px 0; border-bottom: 1px solid var(--m-border); }
.mc-minimal .mock-post > div:last-child { display: flex; justify-content: space-between; gap: 6px; }
.mc-minimal .mock-img { display: none; }
@media (max-width: 560px) { .theme-cards { grid-template-columns: 1fr; } }

/* Theme editor: font picker, each option shown in its own font */
.font-picker { position: relative; }
.font-input { position: relative; }
.font-input input { padding-right: 34px; font-size: 1rem; }
.font-toggle { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; }
.font-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; max-height: 320px; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.font-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; padding: 6px 12px; cursor: pointer; }
.font-list li.active { background: var(--primary-soft); }
.font-list li.current .font-name::after { content: " ✓"; color: var(--primary); font-family: system-ui, sans-serif; }
.font-list .font-group { grid-column: 1 / -1; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 6px; font-family: system-ui, sans-serif; }
.font-list li:first-child .font-group { padding-top: 0; }
.font-list .font-name { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-list .font-sample { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.font-list .font-empty { display: block; color: var(--muted); font-size: .85rem; cursor: default; }
@media (max-width: 560px) { .font-list .font-sample { display: none; } }

/* Content calendar */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }
.cal-toolbar form { gap: 8px; }
.cal-toolbar select { width: auto; }
.cal-title { font-size: 1.05rem; margin-left: 6px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.cal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-week .cal-day { min-height: 320px; }
.cal-row .cal-day:last-child { border-right: 0; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .cal-date { color: #adb5bd; }
.cal-day.today .cal-date > span { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 8px; }
.cal-day.over, .cal-ideas.over { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: -3px; }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 600; color: var(--muted); }
.cal-wd { display: none; }
.cal-add { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; border-radius: 4px; opacity: 0; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-add:hover { background: var(--primary-soft); color: var(--primary); }
.cal-item { display: block; width: 100%; text-align: left; font: inherit; font-size: .8rem; line-height: 1.3; padding: 4px 6px; border-radius: 5px; border: 1px solid var(--border); border-left-width: 3px; background: #fff; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.cal-item:hover { text-decoration: none; box-shadow: var(--shadow); }
.cal-item[draggable="true"] { cursor: grab; }
.cal-item .badge { font-size: .65rem; padding: 0 5px; }
.cal-item.post.published { border-left-color: var(--ok); background: var(--ok-soft); }
.cal-item.post.scheduled { border-left-color: var(--primary); background: var(--primary-soft); }
.cal-item.entry { border-left-color: #adb5bd; border-style: dashed; border-left-style: solid; }
.cal-item.entry.st-planned { border-left-color: #7950f2; }
.cal-item.entry.st-writing, .cal-item.entry.st-draft { border-left-color: var(--warn); }
.cal-item.entry.st-review { border-left-color: var(--warn); background: var(--warn-soft); }
.cal-item.entry.st-done { border-left-color: var(--ok); opacity: .7; }
.cal-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-meta { display: block; color: var(--muted); font-size: .72rem; }
.cal-ideas { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 90px); overflow-y: auto; }
.cal-legend { padding: 8px 12px; margin: 0; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; vertical-align: middle; }
.cal-dot.published { background: var(--ok); } .cal-dot.scheduled { background: var(--primary); }
.cal-dot.planned { background: #7950f2; } .cal-dot.writing { background: var(--warn); }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } .cal-ideas { position: static; max-height: none; } }
@media (max-width: 800px) {
  .cal-head { display: none; }
  .cal-row { grid-template-columns: 1fr; }
  .cal-day, .cal-week .cal-day { min-height: 0; border-right: 0; }
  .cal-day.empty:not(.today), .cal-day.other { display: none; }
  .cal-wd { display: inline; }
  .cal-add { opacity: 1; }
}

/* AI */
.ai-preview { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; max-height: 55vh; overflow-y: auto; font-size: .92rem; min-height: 120px; }
.btn.ai { border-color: #d0bfff; background: #f8f0fc; color: #7048e8; }
.btn.ai:hover { background: #f3d9fa; }
.ai-card { border-top: 3px solid #b197fc; }
.ai-choices { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px; background: #f8f0fc; border-radius: 6px; }
.ai-choices .linkbtn { text-align: left; }
.ai-ideas { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.ai-idea { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 8px; border: 1px dashed #d0bfff; border-radius: 6px; background: #fcfaff; font-size: .85rem; margin-top: 8px; }
