:root {
  color-scheme: light;
  --ink: #172a3b; --muted: #667789; --line: #dfe5eb; --paper: #fff;
  --canvas: #f4f6f8; --accent: #246654; --soft: #e7f2ed;
  --danger: #a42d35; --radius: 16px;
  font: 15px/1.5 "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8abfac; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.18; letter-spacing: -1px; }
h2 { font-size: 20px; letter-spacing: -.4px; }
h3 { font-size: 16px; }
p + p { margin-top: 12px; }
small, .small { font-size: 12px; line-height: 1.6; }
small { display: block; color: var(--muted); margin-top: 5px; }
.muted { color: var(--muted); }
.strong { font-weight: 650; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.eyebrow { font-size: 10px; font-weight: 750; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; background: var(--paper); border-right: 1px solid var(--line); padding: 32px 22px; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 18px; font-weight: 750; line-height: 1.25; letter-spacing: -.5px; }
.brand:hover { text-decoration: none; }
.brand small { font-size: 11px; font-weight: 400; letter-spacing: 0; margin: 3px 0 0; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 42px; border-radius: 11px; background: var(--accent); color: white; font: 650 29px Georgia, serif; }
.sidebar nav { display: grid; gap: 6px; margin-top: 44px; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 550; }
.sidebar nav a:hover { background: var(--canvas); text-decoration: none; }
.sidebar nav a[aria-current=page] { color: var(--accent); background: var(--soft); }
.sidebar nav a span { font-size: 22px; line-height: 1; width: 24px; text-align: center; }
.sidebar-foot { margin-top: auto; padding-top: 30px; display: grid; gap: 16px; font-size: 11px; }
.workspace { margin-left: 224px; max-width: 1620px; padding: 0 38px 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 100px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.topbar .eyebrow { margin: 0 0 3px; font-size: 9px; }
.topbar p { font-size: 14px; font-weight: 650; }
.view { animation: enter .18s ease-out; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading .muted { margin-top: 12px; font-size: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 32px 0 18px; }
.section-heading a { font-size: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 16px; border-radius: 9px; font-size: 13px; font-weight: 650; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.button:hover { text-decoration: none; }
.primary { background: var(--accent); color: #fff; }
.primary:hover:enabled { background: #174d3f; }
.secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.secondary:hover:enabled { border-color: #adbcb6; background: #fafcfb; }
.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 24px; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 7px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.neutral { background: #ecf0f3; color: #5d6d7d; }
.good { background: var(--soft); color: var(--accent); }
.warning { background: #fff0d7; color: #8b6118; }
.bad { background: #fcebed; color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.metric { padding: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 32px; font-weight: 650; letter-spacing: -1px; margin: 9px 0 5px; }
.metric small { font-size: 10px; }
.connection-card { border: 1px solid #d7e8df; border-radius: var(--radius); padding: 22px 24px; background: #edf5f1; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.connection-card h3 { margin-bottom: 5px; }
.connection-card p { font-size: 13px; }
.connection-card .button { flex-shrink: 0; }
.notice { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; margin-bottom: 20px; overflow-wrap: anywhere; }
.notice.info { background: #edf3f8; border-color: #d9e4ee; color: #415e76; }
.notice.error { background: #fcebed; border-color: #f2ced3; color: var(--danger); }
.empty { grid-column: 1/-1; padding: 46px 20px; text-align: center; background: white; border: 1px dashed #ccd6de; border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.empty strong { display: block; font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(236px,1fr)); gap: 20px; }
.post-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; display: flex; flex-direction: column; }
.post-image { height: 204px; background: #e9edef; position: relative; overflow: hidden; display: grid; place-items: center; }
.post-image img, .post-image video { width: 100%; height: 100%; object-fit: contain; background: #e9edef; }
.post-image .badge { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.94); color: var(--ink); }
.preview-fallback { text-align: center; color: #7c8a95; font-size: 12px; padding: 20px; }
.preview-fallback span { display: block; font-size: 35px; color: #9aa8b1; margin-bottom: 6px; }
.post-content { padding: 18px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.post-title { font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.post-date { font-size: 11px; color: var(--muted); }
.post-price { font-size: 23px; font-weight: 650; letter-spacing: -.5px; }
.post-price small { display: inline; font-size: 10px; margin-left: 6px; font-weight: 400; letter-spacing: 0; }
.rule-summary { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 5px; }
.post-actions .button { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.post-actions a { font-size: 11px; }
.card-error { font-size: 12px; color: var(--danger); overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.search { flex: 1; min-width: 180px; }
.toolbar select { min-width: 156px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 28px 0 0; font-size: 12px; }
.pagination .button { min-height: 34px; padding: 7px 12px; }
.surface { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.surface > h2, .surface > h3 { margin-bottom: 20px; }
.surface .section-heading { margin: 0 0 10px; }
.settings-grid { display: grid; grid-template-columns: minmax(300px,1.2fr) minmax(280px,1fr); gap: 24px; align-items: start; }
.form-stack { display: grid; gap: 20px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: 12px; font-weight: 650; }
input:not([type=checkbox]):not([type=file]), select, textarea { display: block; width: 100%; background: #fff; color: var(--ink); border: 1px solid #d5dee5; border-radius: 8px; padding: 11px 12px; margin-top: 7px; font-size: 14px; font-weight: 400; min-width: 0; }
textarea { resize: vertical; line-height: 1.55; }
input[readonly], textarea[readonly], select:disabled { background: #f1f4f6; color: var(--muted); }
label small { font-weight: 400; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; flex-shrink: 0; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: #c7d2d8; position: relative; margin: 0; flex-shrink: 0; cursor: pointer; }
.toggle input:after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: transform .16s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked:after { transform: translateX(14px); }
.toggle input:disabled { opacity: .5; cursor: not-allowed; }
.status-lines { display: grid; gap: 12px; margin-bottom: 22px; font-size: 13px; }
.status-line { display: flex; justify-content: space-between; gap: 18px; }
.status-line span:first-child { color: var(--muted); }
.diagnostics { font-size: 12px; margin-top: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-error { color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.journal-list { display: grid; gap: 12px; }
.journal-entry { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.journal-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 10px; }
.journal-top strong { font-size: 14px; }
.journal-top time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.comment-fragment { font-size: 13px; color: #4a5e6e; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; background: var(--canvas); border-radius: 8px; margin-bottom: 14px; }
.journal-outcomes { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.journal-outcomes > div { display: flex; align-items: center; gap: 8px; }
.journal-details { margin-top: 12px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.journal-entry .button { margin-top: 12px; min-height: 33px; padding: 7px 10px; font-size: 11px; }
dialog { border: 0; border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 24px 80px #102b4250; max-height: 94dvh; }
dialog::backdrop { background: rgba(19,37,52,.47); backdrop-filter: blur(3px); }
.editor-dialog { width: min(1040px,calc(100vw - 48px)); }
.review-dialog { width: min(580px,calc(100vw - 36px)); }
.dialog-heading { display: flex; justify-content: space-between; gap: 18px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 2; }
.dialog-heading .eyebrow { margin-bottom: 4px; }
.editor-body { display: grid; grid-template-columns: 1.06fr 1fr; gap: 30px; padding: 26px; }
.rule-panel { padding-left: 28px; border-left: 1px solid var(--line); align-content: start; }
.upload-zone { border: 1.5px dashed #b9c9c0; border-radius: 12px; background: #f4f9f6; padding: 23px; text-align: center; font-size: 13px; }
.upload-zone.is-dragging { border-color: var(--accent); background: #e5f3eb; }
.upload-zone p { font-size: 12px; margin: 8px 0 15px; }
.upload-zone small { font-size: 10px; margin-top: 12px; }
.file-label { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; }
.file-label input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.asset-list { display: grid; gap: 10px; }
.asset-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.asset-thumb { width: 65px; height: 76px; flex-shrink: 0; border-radius: 6px; background: #ecf0f2; object-fit: contain; }
.asset-text { flex: 1; min-width: 0; font-size: 11px; }
.asset-text strong { font-size: 12px; display: block; overflow-wrap: anywhere; }
.asset-tools { display: flex; gap: 4px; }
.asset-tools button { border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 5px; width: 26px; height: 28px; font-size: 13px; }
.reply-preview { padding: 16px; border: 1px solid #cfe1d7; background: #eff7f2; border-radius: 12px; }
.reply-preview .eyebrow { font-size: 8px; color: var(--accent); }
.reply-preview p { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-footer { padding: 18px 26px; border-top: 1px solid var(--line); background: #fff; position: sticky; bottom: 0; z-index: 2; }
.dialog-footer .form-error { margin-bottom: 12px; }
.footer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.footer-actions > span { margin-right: auto; }
.review-body { padding: 24px 26px; display: grid; gap: 18px; }
.review-body .notice { margin: 0; }
.review-media { display: flex; gap: 10px; overflow: auto; }
.review-media img, .review-media video { height: 230px; max-width: 100%; object-fit: contain; border-radius: 8px; background: #e9edef; }
.toast { position: fixed; left: calc(50% + 112px); transform: translateX(-50%); bottom: 26px; z-index: 50; padding: 13px 20px; border-radius: 10px; background: #1c3543; color: white; font-size: 13px; box-shadow: 0 5px 25px #142a3a30; max-width: min(500px,90vw); text-align: center; }
.login-page { display: grid; grid-template-columns: minmax(0,1fr); place-items: center; min-height: 100dvh; background: #edf2ef; padding: 24px; }
.login-card { width: 400px; max-width: 100%; padding: 38px; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 55px #243e3210; }
.login-card .brand { margin-bottom: 36px; }
.login-card h1 { font-size: 27px; }
.login-card > .muted { font-size: 13px; margin: 14px 0 26px; }
.login-card > .small { margin: 24px 0 0; text-align: center; font-size: 11px; }
.login-card .button { margin-top: 4px; }
@keyframes enter { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width:1500px) { .post-image { height: 235px; } }
@media (max-width:1100px) {
  .sidebar { width: 196px; padding: 28px 16px; } .workspace { margin-left: 196px; padding: 0 25px 40px; }
  .metrics { gap: 10px; } .metric { padding: 18px; } .metric strong { font-size: 28px; }
  .settings-grid { grid-template-columns: minmax(0,1fr); } .toast { left: calc(50% + 98px); }
}
@media (max-width:760px) {
  h1 { font-size: 27px; } .sidebar { inset: auto 0 0; width: 100%; height: 68px; padding: 0; background: #fffffff5; border: 0; border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .sidebar .brand, .sidebar-foot { display: none; } .sidebar nav { display: grid; grid-template-columns: repeat(4,1fr); margin: 0; height: 100%; gap: 0; }
  .sidebar nav a { flex-direction: column; justify-content: center; gap: 4px; font-size: 10px; padding: 8px 2px; border-radius: 0; } .sidebar nav a span { font-size: 21px; }
  .workspace { margin: 0; padding: 0 18px 98px; } .topbar { min-height: 82px; margin-bottom: 26px; gap: 10px; } .topbar .badge { font-size: 9px; max-width: 154px; white-space: normal; }
  .page-heading { align-items: flex-start; margin-bottom: 23px; flex-wrap: wrap; gap: 17px; } .page-heading .muted { font-size: 13px; margin-top: 9px; } .page-heading .button { min-height: 39px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .metric { padding: 16px; } .metric strong { font-size: 29px; margin: 7px 0 2px; } .metric span { font-size: 11px; }
  .connection-card { align-items: flex-start; flex-direction: column; padding: 18px; gap: 14px; } .section-heading { margin-top: 27px; } .section-heading h2 { font-size: 18px; }
  .post-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; } .post-image { height: 178px; } .post-content { padding: 13px; gap: 9px; } .post-title { font-size: 13px; }
  .post-price { font-size: 20px; } .post-price small { display: block; margin: 2px 0 0; font-size: 9px; } .post-actions { align-items: flex-start; gap: 7px; flex-direction: column; } .post-actions .button { width: 100%; }
  .rule-summary { font-size: 10px; } .post-image .badge { left: 8px; top: 8px; font-size: 9px; } .toolbar { gap: 10px; } .toolbar .search { flex-basis: 100%; } .toolbar > label:not(.search) { flex: 1; }
  .toolbar > .button { font-size: 11px; white-space: normal; flex: 1; min-height: 44px; } .toolbar select { min-width: 0; margin-top: 0; font-size: 12px; min-height: 44px; }
  .pagination { gap: 14px; font-size: 11px; } .surface { padding: 20px; } .two-columns { gap: 12px; } .settings-grid .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .settings-grid .button { white-space: normal; }
  .journal-entry { padding: 16px; } .journal-top { flex-direction: column; gap: 6px; } .journal-outcomes { gap: 10px; } .journal-outcomes > div { font-size: 11px; } .journal-outcomes .badge { font-size: 9px; }
  .editor-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; } .editor-body { grid-template-columns: 1fr; gap: 25px; padding: 20px; }
  .asset-row { display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 9px 12px; }
  .asset-tools { grid-column: 2; justify-content: flex-end; }
  .asset-tools button { width: 44px; height: 44px; }
  .rule-panel { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); } .dialog-heading { padding: 17px 20px; } .dialog-heading h2 { font-size: 19px; } .dialog-footer { padding: 16px 20px; }
  .footer-actions { gap: 9px; } .footer-actions .button { flex: 1; font-size: 11px; white-space: normal; min-height: 41px; } .footer-actions > span { width: 100%; margin: 0; }
  .review-dialog { max-height: 90dvh; } .review-body { padding: 20px; } .review-media img, .review-media video { height: 190px; } .toast { left: 50%; bottom: 84px; font-size: 12px; }
  .login-card { padding: 28px; } .login-card h1 { font-size: 25px; } .status-line { gap: 10px; } .status-line span:last-child { text-align: right; }
}
@media (max-width:370px) {
  .post-grid { grid-template-columns: 1fr; } .post-image { height: 240px; } .post-actions { flex-direction: row; align-items: center; } .post-actions .button { width: auto; }
  .metrics { gap: 8px; } .metric { padding: 13px; } .two-columns { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion:reduce) { * { animation: none !important; transition: none !important; } }

.session-card { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
