@font-face {
  font-family: "DM Sans";
  src: url("/static/fonts/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f8fa;
  --white: #fff;
  --ink: #182638;
  --navy: #173653;
  --navy-hover: #102b44;
  --muted: #626e7d;
  --line: #dce1e7;
  --line-strong: #b4beca;
  --soft: #eef2f6;
  --green: #315d48;
  --green-soft: #edf4ef;
  --red: #933c35;
  --red-soft: #fcf1ef;
  --amber: #77562d;
  --amber-soft: #fbf6ec;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.6 "DM Sans", "Helvetica Neue", sans-serif; }
body.dialog-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
button, a { touch-action: manipulation; }
button { transition: background-color .14s, border-color .14s, color .14s; }
:focus-visible { outline: 3px solid #456f98; outline-offset: 3px; }
::selection { background: #d6e2ef; color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3.2vw, 36px); font-weight: 600; letter-spacing: -.045em; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
p { color: var(--muted); }
a { color: var(--navy); text-underline-offset: 4px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
label { display: block; color: var(--ink); font-size: 13px; font-weight: 600; margin: 19px 0 7px; }
input, textarea, select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 14px; }
textarea { resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #74808e; opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: #456f98; }
input[type="date"] { max-width: 250px; }
button { min-height: 44px; border-radius: 5px; border: 1px solid transparent; padding: 10px 16px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.button-primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.button-primary:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); }
.button-secondary { background: var(--white); color: var(--navy); border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { background: var(--soft); border-color: #7b8c9f; }
.button-text { background: transparent; color: var(--navy); padding: 9px 10px; }
.button-text:hover:not(:disabled) { background: var(--soft); }
.button-square { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; padding: 6px; background: var(--white); color: var(--navy); border-color: var(--line); font-size: 21px; font-weight: 400; }
.button-square:hover:not(:disabled) { background: var(--soft); border-color: var(--line-strong); }
.button-danger-text { background: transparent; color: var(--red); padding-left: 0; padding-right: 8px; }
.button-danger-text:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.button-wide { width: 100%; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: .095em; }
.small-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.small-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.skip-link { position: fixed; left: 12px; top: 10px; z-index: 100; background: var(--white); padding: 12px 18px; border: 2px solid var(--navy); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

.topbar { min-height: 80px; padding: 16px max(28px, calc((100% - 1304px) / 2)); background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-lockup, .topbar-actions, .session-actions { display: flex; align-items: center; }
.brand-lockup { gap: 10px; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 19px; font-weight: 500; letter-spacing: -.08em; padding-right: 2px; }
.wordmark { font-size: 25px; line-height: 1; font-weight: 600; letter-spacing: -.055em; }
.brand-divider { width: 1px; height: 22px; background: var(--line); margin: 0 9px; }
.product-name { font-size: 13px; color: var(--muted); }
.topbar-actions { gap: 25px; }
.agent-identity { font-size: 12px; color: var(--muted); white-space: nowrap; }
.session-actions { gap: 5px; }
.session-actions .button-text { font-size: 12px; }
.demo-note { text-align: right; max-width: 1360px; padding: 10px 28px 0; margin: 0 auto; color: var(--muted); font-size: 12px; letter-spacing: .015em; }
.workspace { max-width: 1360px; margin: 0 auto; padding: 0 28px; min-width: 0; outline: none; }
.session-check { padding: 90px 0; text-align: center; }
/* Only a new, five-second message floats over the page, in the bottom-right corner (left of an
   open Agent panel, placed by studio.js); history is opt-in under the bell. */
.notification-region { position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 32px)); z-index: 90; }
.notice { display: grid; grid-template-columns: 28px minmax(0, 1fr) 36px; align-items: start; gap: 12px; padding: 14px 8px 14px 16px; margin: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #17293e22; color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.notice p { color: inherit; margin: 0; padding-top: 3px; }
.notice-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; line-height: 1; }
.notice-icon::before { content: "✓"; }
.notice.is-error { border-color: #e1bdb7; }
.notice.is-error p { color: var(--red); }
.notice.is-error .notice-icon { background: var(--red-soft); color: var(--red); }
.notice.is-error .notice-icon::before { content: "!"; }
.notification-close { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--muted); font-size: 22px; font-weight: 400; line-height: 1; border-radius: 6px; }
.notification-close:hover { background: var(--soft); color: var(--navy); }
.notification-bell { position: relative; border: 0; background: transparent; }
.notification-count { position: absolute; right: 0; top: 0; min-width: 17px; padding: 1px 3px; border-radius: 9px; background: var(--navy); color: var(--white); font-size: 12px; line-height: 15px; text-align: center; }
/* Opens beside the bell (position set by studio.js); this is the fallback. */
.history-dialog { position: fixed; inset: auto auto 16px 220px; margin: 0; width: min(420px, calc(100% - 32px)); max-width: calc(100% - 32px); max-height: min(76dvh, 700px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 12px 40px #17293e26; }
.history-dialog::backdrop { background: #17293e14; }
.history-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: -8px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.history-actions button { min-height: 36px; padding: 0; font-size: 13px; }
.history-actions .history-clear { color: var(--red); }
.history-actions button:disabled { color: var(--muted); text-decoration: none; cursor: default; opacity: .6; }
.history-dot { width: 9px; height: 9px; margin-top: 11px; border-radius: 50%; background: transparent; }
.is-new > .history-dot { background: var(--navy); }
.is-new.is-failed > .history-dot, .is-new.is-error > .history-dot { background: var(--red); }
.history-when { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.history-remove { width: 36px; height: 36px; min-height: 36px; padding: 0; background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: 20px; font-weight: 400; line-height: 1; }
.history-remove:hover { background: var(--soft); color: var(--navy); }
.history-dialog .dialog-heading { top: -20px; }
.history-dialog .dialog-heading h2 { font-size: 21px; }
.history-intro { margin: 5px 0 18px; }
.history-dialog .uncertain-request { margin-bottom: 16px; }
.history-notice { display: grid; grid-template-columns: 9px minmax(0, 1fr) 36px; gap: 10px; padding: 8px 4px 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.history-notice + .history-notice { margin-top: 4px; }
.history-notice p { margin: 0; padding-top: 6px; }
.history-notice.is-new { background: var(--soft); }
.history-notice.is-error p { color: var(--red); }
.notice-history-list { margin-top: 16px; }
.login { padding: clamp(40px, 8vh, 100px) 0 80px; }
.login-card { width: 100%; max-width: 450px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 35px; }
.login-card h1 { font-size: 28px; margin: 12px 0; }
.login-card > p:not(.eyebrow):not(.small-note) { font-size: 14px; }
.login-card label { margin-top: 20px; }
.login-card .button-primary { width: 100%; display: flex; justify-content: space-between; margin-top: 25px; }
.login-card > .small-note { margin-top: 21px; font-size: 12px; }
.form-error { font-size: 13px; color: var(--red); background: var(--red-soft); padding: 12px; margin: 14px 0; border-radius: 4px; overflow-wrap: anywhere; }
.main-nav { display: flex; gap: 32px; border-bottom: 1px solid var(--line); padding-top: 1px; }
.main-nav a { display: flex; align-items: center; min-height: 58px; color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.main-nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.main-nav a:hover { color: var(--navy); }
.loading { font-size: 13px; padding: 18px 0 0; }
.load-error { padding: 50px 0 80px; }
.load-error p { margin: 12px 0 20px; max-width: 650px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 0 27px; }
.page-heading p { margin-top: 8px; font-size: 14px; }
.page-heading > button { flex-shrink: 0; }
.ideas-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.brief-panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.panel-heading { display: flex; align-items: center; gap: 12px; }
.panel-heading h2 { font-size: 19px; margin-top: 3px; }
.agent-symbol { display: inline-grid; place-items: center; width: 35px; height: 39px; color: var(--navy); border: 1px solid #c6d1dc; border-radius: 5px; font-size: 20px; font-weight: 500; flex-shrink: 0; }
.brief-panel label:first-child { margin-top: 24px; }
.brief-panel textarea { min-height: 100px; }
.brief-panel .button-primary { display: flex; justify-content: space-between; gap: 8px; margin-top: 23px; }
.brief-panel .button-secondary { margin-top: 9px; }
#generation-hint { margin-top: 13px; font-size: 12px; }
.topic-section { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.topic-section h3 { font-size: 14px; }
.topic-section > .small-note { margin-top: 6px; font-size: 12px; }
.topic-list { display: grid; gap: 7px; margin-top: 13px; }
.topic-choice { width: 100%; text-align: left; padding: 11px 12px; background: var(--white); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.topic-choice:hover:not(:disabled) { background: var(--soft); border-color: var(--line-strong); }
.topic-choice[aria-pressed="true"] { background: #eaf0f6; border-color: #67829b; color: var(--navy); }
.topic-empty { padding: 5px 0; }
#new-topics { text-align: left; font-size: 12px; margin: 6px 0 -9px -10px; }
.all-posts-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; flex-shrink: 0; }
.content-column { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin: 0 0 18px; }
.section-heading h2 { font-size: 19px; }
.section-heading p { margin-top: 5px; font-size: 12px; }
.section-heading .button-text { flex-shrink: 0; margin-top: -6px; }
.empty-state { padding: 31px 27px; background: var(--white); border: 1px dashed #ccd4de; border-radius: var(--radius); }
.empty-state h3 { font-size: 16px; font-weight: 500; }
.empty-state p { margin-top: 7px; font-size: 13px; max-width: 450px; }
.empty-state .button-text { margin: 12px 0 -10px -10px; }
.idea-list { display: grid; gap: 11px; }
.idea-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.idea-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.channel-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.idea-card h3 { overflow-wrap: anywhere; }
.idea-card > p { font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.idea-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.idea-actions .button-text { margin-left: -10px; }
.remove-idea { min-height: 44px; padding: 3px 7px; margin: -10px -7px -10px 0; font-size: 12px; color: var(--muted); background: transparent; font-weight: 400; }
.remove-idea:hover { color: var(--red); }
.posts-section { margin-top: 32px; }
.post-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.post-list:has(.empty-state) { background: transparent; border: 0; }
.post-row { display: block; width: 100%; text-align: left; color: var(--ink); padding: 18px 21px; background: var(--white); border-radius: 0; font-weight: 400; border-bottom: 1px solid var(--line); }
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: #f4f7fa; }
.post-row-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.post-row-heading strong { font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.post-preview { color: var(--muted); font-size: 12px; margin: 5px 0 10px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-row-meta { display: flex; flex-wrap: wrap; gap: 6px 15px; align-items: center; color: var(--muted); font-size: 12px; }
.status-badge { display: inline-flex; padding: 3px 8px; border-radius: 4px; color: #596576; background: var(--soft); font-size: 12px; line-height: 1.6; font-weight: 500; white-space: nowrap; }
.status-badge.is-ready { background: var(--green-soft); color: var(--green); }
.availability-note { display: flex; flex-wrap: wrap; gap: 3px 8px; margin-top: 21px; padding: 13px 16px; background: var(--amber-soft); border: 1px solid #e7d9c1; border-radius: 5px; font-size: 12px; color: var(--amber); }
.availability-note strong { font-weight: 600; }
.job-status { margin: 0; border: 1px solid #cbd6e2; border-radius: 6px; background: #f0f4f8; }
.job-row { padding: 9px 6px 9px 12px; display: grid; grid-template-columns: 9px minmax(0, 1fr) 36px; column-gap: 10px; row-gap: 2px; overflow-wrap: anywhere; }
.job-row.is-new { background: #e6edf4; }
.job-row > .history-dot { grid-column: 1; grid-row: 1; }
.job-row > .history-remove { grid-column: 3; grid-row: 1; }
.job-copy { grid-column: 2; grid-row: 1; padding-top: 5px; min-width: 0; }
.job-row + .job-row { border-top: 1px solid #dbe3ec; }
.job-row strong { font-size: 13px; font-weight: 500; }
.job-row p { font-size: 12px; margin-top: 2px; }
.job-row.is-failed p { color: var(--red); }
.job-row-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-left: -10px; min-width: 0; }
.job-row-actions button { font-size: 12px; }
.poll-paused { padding: 13px 15px; border-top: 1px solid #dbe3ec; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.poll-paused p { font-size: 12px; }
.poll-paused button { flex-shrink: 0; }
.uncertain-request { margin: 0; padding: 17px; background: var(--amber-soft); border: 1px solid #e7d9c1; border-radius: 6px; font-size: 12px; }
.uncertain-request strong { color: var(--amber); font-weight: 600; }
.uncertain-request p { margin-top: 4px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.week-brief-panel { background: var(--white); border: 1px solid var(--line); padding: 22px 25px; border-radius: var(--radius); margin-bottom: 26px; }
.week-brief-panel > div { display: flex; align-items: baseline; gap: 22px; }
.week-brief-panel h2 { font-size: 18px; white-space: nowrap; }
.week-brief-panel p { font-size: 12px; }
.week-brief-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 380px); gap: 24px; }
.week-brief-fields label { margin-top: 15px; }
.week-brief-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 16px; }
.calendar-toolbar, .week-navigation { display: flex; align-items: center; gap: 12px; }
.calendar-toolbar { justify-content: space-between; }
.week-navigation h2 { font-size: 19px; line-height: 1.4; font-weight: 500; text-align: center; }
.week-navigation .button-text { font-size: 12px; margin-left: 4px; }
.calendar-note { margin: 12px 0 18px; color: var(--muted); font-size: 12px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.calendar-day { min-width: 0; min-height: 280px; padding: 13px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.calendar-day:last-child { border-right: 0; }
.day-content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.calendar-day.is-today { background: #f3f6fa; }
.day-heading { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 0 14px; margin-bottom: 5px; }
.day-name { color: var(--muted); font-size: 12px; font-weight: 400; }
.day-number { display: grid; place-items: center; min-width: 31px; height: 31px; color: var(--ink); font-size: 18px; font-weight: 500; }
.is-today .day-number { background: var(--navy); color: var(--white); border-radius: 50%; }
.day-empty { font-size: 12px; text-align: center; color: #77818c; padding: 19px 0; }
.day-add { margin-top: auto; padding: 8px 4px; width: 100%; color: var(--muted); font-size: 12px; font-weight: 400; background: transparent; }
.day-add:hover { color: var(--navy); background: var(--soft); }
.calendar-post { width: 100%; padding: 11px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; text-align: left; font-weight: 400; margin: 5px 0; }
.calendar-post:hover { border-color: #8599ad; background: var(--soft); }
.calendar-post > strong { display: block; font-size: 12px; line-height: 1.45; font-weight: 600; margin: 6px 0 12px; overflow-wrap: anywhere; }
.calendar-post .channel-label { display: block; font-size: 12px; overflow-wrap: anywhere; }
.calendar-time { display: block; color: var(--navy); font-size: 12px; font-weight: 600; margin-top: 5px; }
.calendar-post .status-badge { font-size: 12px; padding: 2px 6px; }
.unscheduled-section { margin-top: 32px; }
.unscheduled-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.unscheduled-posts .post-row { border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.unscheduled-posts .post-row-heading { flex-wrap: wrap; gap: 8px; }
.unscheduled-posts .empty-state { grid-column: 1 / -1; padding: 22px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; margin-top: 50px; padding: 22px 0 26px; border-top: 1px solid var(--line); }

/* Native dialogs provide keyboard focus containment and Escape support. */
dialog { background: var(--white); color: var(--ink); border: 0; padding: 29px; box-shadow: 0 10px 55px #18263826; }
dialog::backdrop { background: #17293e66; }
.post-dialog { position: fixed; inset: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(600px, 100%); max-width: 100%; margin: 0; overflow-y: auto; border-left: 1px solid var(--line); }
.brand-dialog { max-width: min(520px, calc(100% - 32px)); width: 520px; max-height: calc(100dvh - 40px); border: 1px solid var(--line); border-radius: 9px; }
.dialog-heading { position: sticky; top: -29px; z-index: 6; display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 14px 0; margin-top: -14px; background: var(--white); }
.dialog-heading h2 { font-size: 25px; margin-top: 5px; letter-spacing: -.04em; }
.dialog-heading .button-square { background: transparent; border: 0; font-size: 27px; margin: -5px -7px 0 0; }
.dialog-intro { margin: 15px 0 22px; font-size: 13px; }
.editor-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.copy-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.copy-label label { margin: 0; }
.copy-label button { font-size: 12px; }
#post-content { font-size: 15px; line-height: 1.8; min-height: 280px; }
.field-help { margin-top: 7px; font-size: 12px; }
.label-optional { color: var(--muted); font-weight: 400; }
.platform-picker { margin-top: 19px; }
.platform-picker legend { color: var(--ink); font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.platform-chips label, .brief-panel .platform-chips label:first-child { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: 0; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 22px; cursor: pointer; font-size: 12px; font-weight: 500; }
.platform-chips input[type="checkbox"] { appearance: auto; display: inline-block; width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; padding: 0; margin: 0; accent-color: var(--navy); }
.platform-chips label:has(input:checked) { background: #eaf0f6; color: var(--navy); border-color: #67829b; }
.platform-chips label:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.planning-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
input[type="time"] { max-width: 180px; }
.editor-footer { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 21px; }
.editor-save-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.editor-footer > .small-note { margin-top: 10px; font-size: 12px; }
.editor-footer .button-danger-text { margin-top: 13px; font-size: 12px; }
#editor-message { padding: 10px 0 0; color: var(--navy); }
.editor-conflict { padding: 13px; border: 1px solid #e7d9c1; background: var(--amber-soft); border-radius: 5px; margin-top: 17px; }
.editor-conflict p { font-size: 12px; color: var(--amber); margin-bottom: 10px; }
.editor-conflict button { font-size: 12px; }
.post-row.has-image { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 16px; align-items: start; }
.post-row-body { display: block; min-width: 0; }
.post-thumbnail { display: block; width: 68px; height: 85px; object-fit: cover; border-radius: 5px; background: var(--soft); }
.post-image-status { color: var(--navy); }
.calendar-thumbnail { display: block; width: 100%; height: auto; max-height: 100px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; margin-bottom: 9px; background: var(--soft); }
.calendar-image-status { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.editor-images { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.images-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.images-heading h3 { font-size: 16px; }
.image-ai-label { font-size: 12px; color: var(--muted); padding: 3px 7px; background: var(--soft); border-radius: 4px; }
.image-status { margin: 8px 0 14px; }
.image-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.image-option { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; padding: 5px; min-width: 0; text-align: left; background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 7px; overflow: hidden; }
.image-option:hover:not(:disabled), .image-option[aria-pressed="true"] { border-color: #7b93aa; background: #f6f8fa; }
.image-option.is-selected { border-color: var(--navy); }
.image-option img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: 156px; object-fit: cover; border-radius: 3px; background: var(--soft); }
.image-option-label { display: flex; flex-direction: column; gap: 4px; padding: 8px 3px 4px; font-size: 12px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.image-option-selected { color: var(--green); font-size: 12px; font-weight: 600; }
.image-load-failed::before { content: 'Podgląd niedostępny'; display: grid; place-items: center; min-height: 80px; color: var(--muted); background: var(--soft); font-size: 12px; font-weight: 400; padding: 8px; }
.image-preview { margin: 16px 0 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.image-preview-photo { display: block; width: 100%; height: auto; max-height: 365px; object-fit: contain; background: #f0f2f5; }
.image-preview figcaption { padding: 12px 14px; }
.image-preview figcaption strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.image-preview figcaption p { font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.image-load-error { padding: 22px 16px; font-size: 12px; background: var(--amber-soft); color: var(--amber); }
.image-selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.image-selection-actions button { font-size: 12px; }
.image-download { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; font-weight: 500; }
.image-generation { margin-top: 14px; }
.image-generation details { color: var(--muted); font-size: 12px; }
.image-generation summary { cursor: pointer; width: fit-content; min-height: 44px; padding: 11px 0; }
.image-generation label { font-size: 12px; margin-top: 4px; }
.image-generation input { font-size: 13px; }
.image-generation-actions { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 3px 0 0 -10px; }
.image-generation-actions button { font-size: 12px; }
#image-action-help { color: var(--amber); }
#brand-save { margin-top: 25px; }
.noscript { padding: 24px; text-align: center; }

@media (min-width: 1500px) { .ideas-layout { gap: 40px; grid-template-columns: 310px minmax(0, 1fr); } }
@media (max-width: 1080px) {
  .ideas-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 25px; }
  .brief-panel { padding: 20px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .calendar-day { padding: 12px 7px; }
  .week-brief-panel > div { display: block; }
  .week-brief-panel > div p { margin-top: 6px; }
}
@media (max-width: 900px) {
  .product-name, .brand-divider { display: none; }
  .topbar-actions { gap: 15px; }
  .calendar { display: flex; flex-direction: column; }
  .calendar-day { min-height: 94px; display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 15px; align-items: center; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-day:last-child { border-bottom: 0; }
  .day-heading { align-items: flex-start; margin: 0; padding: 0; grid-column: 1; align-self: start; }
  .day-number { font-size: 18px; }
  .calendar-post { grid-column: 2; margin: 0; padding: 12px; }
  .calendar-post > strong { margin: 4px 0 7px; font-size: 13px; }
  .calendar-post .channel-label { font-size: 12px; }
  .day-empty { grid-column: 2; text-align: left; padding: 0; }
  .day-content { grid-column: 2; min-height: 64px; }
  .day-add { align-self: flex-start; width: auto; margin: 0; padding: 8px 0; font-size: 12px; }
  .unscheduled-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .topbar { min-height: 71px; gap: 12px; padding: 12px 20px; }
  .topbar-actions { gap: 8px; }
  .agent-identity { display: none; }
  .session-actions { gap: 0; }
  .session-actions .button-text { padding: 8px; font-size: 12px; }
  .brand-lockup { gap: 7px; }
  .brand-mark { width: 29px; height: 29px; font-size: 17px; }
  .wordmark { font-size: 23px; }
  .workspace { padding: 0 20px; }
  .demo-note { padding: 8px 20px 0; font-size: 12px; }
  .page-heading { padding: 25px 0 22px; gap: 17px; flex-wrap: wrap; }
  .page-heading p { font-size: 13px; }
  .page-heading > button { font-size: 12px; }
  .ideas-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .brief-panel { padding: 21px; }
  .brief-panel textarea { min-height: 100px; }
  .brief-panel label:first-child { margin-top: 19px; }
  .topic-section { margin-top: 20px; }
  .content-column { min-width: 0; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .idea-card { padding: 18px; }
  .posts-section { margin-top: 29px; }
  .history-dialog .dialog-heading { top: -20px; }
  .posts-section .section-heading { flex-wrap: wrap; gap: 6px; }
  .dialog-heading { top: -24px; }
  .poll-paused { align-items: flex-start; gap: 6px; padding: 12px 14px; }
  .job-row-actions { margin-left: -10px; }
  .calendar-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .week-navigation { flex-wrap: wrap; gap: 8px; }
  .week-navigation h2 { font-size: 16px; }
  .week-navigation .button-text { flex-basis: 100%; margin: -2px 0 -5px; padding-left: 0; text-align: left; }
  .week-brief-panel { padding: 19px; }
  .week-brief-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .planning-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .week-brief-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .calendar-day { grid-template-columns: 65px minmax(0, 1fr); gap: 8px 12px; padding: 14px; }
  .day-heading { align-self: start; }
  .day-name { font-size: 12px; }
  .day-add { grid-column: 2; grid-row: auto; justify-self: start; width: auto; min-height: 44px; padding: 7px 0; }
  .day-empty { padding: 6px 0 0; }
  .unscheduled-posts { grid-template-columns: 1fr; }
  .workspace-footer { margin-top: 35px; gap: 8px; flex-wrap: wrap; }
  .login { padding: 37px 0 60px; }
  .login-card { padding: 26px; }
  .login-card h1 { font-size: 25px; }
  .login-card .eyebrow { font-size: 12px; }
  dialog { padding: 24px 20px; }
  .brand-dialog { max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .editor-save-actions button { flex: 1 1 auto; }
  .post-row.has-image { grid-template-columns: 55px minmax(0, 1fr); gap: 12px; }
  .post-thumbnail { width: 55px; height: 69px; }
  .post-row.has-image .post-row-heading { flex-wrap: wrap; gap: 5px 10px; }
  .image-options { gap: 6px; }
  .image-option { padding: 3px; }
  .image-option-label { font-size: 12px; padding-left: 2px; padding-right: 2px; }
  .image-preview-photo { max-height: 330px; }
  .calendar-thumbnail { max-height: 110px; }
  input, textarea, select, .image-generation input { font-size: 16px; }
}
@media (max-width: 400px) { .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; } .brand-mark { width: 26px; height: 26px; font-size: 15px; } .wordmark { font-size: 21px; } }
/* Phone (the menu becomes a bottom bar at 760px): messages just above it, the panel under the top bar. */
@media (max-width: 760px) {
  .notification-region { left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); width: auto; }
  .history-dialog { inset: 64px 8px auto 8px; width: auto; max-width: none; max-height: calc(100dvh - 148px); padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
