:root {
  color-scheme: light;
  font-family: Inter, 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
  color: #171831;
  background: #f6f7fb;
  font-size: 14px;
  --ink: #171831;
  --muted: #62677d;
  --line: #e4e5ef;
  --accent: #5142df;
  --accent-dark: #3d30c2;
  --soft: #eeebff;
  --white: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { touch-action: manipulation; }
button:disabled { opacity: .58; cursor: wait; }
a { color: var(--accent-dark); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #7366f5; outline-offset: 2px; }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
small { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted, .field-note, .empty-note { color: var(--muted); font-size: 12px; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { min-height: 100dvh; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 16px; background: #f2f2fa; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 16px; font-weight: 740; margin: 0 7px 25px; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; font-size: 11px; font-weight: 500; letter-spacing: .12em; }
.brand-mark, .agent-symbol { line-height: 1; color: white; display: grid; place-items: center; background: var(--accent); box-shadow: 0 4px 12px #5142df32; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 22px; font-weight: 750; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; color: #454960; border-radius: 9px; font-weight: 560; }
.sidebar nav a:hover { background: #eae9f7; }
.sidebar nav a[aria-current] { background: #e5e0fe; color: var(--accent-dark); font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: 13px 12px 1px; border-top: 1px solid #e3e3ef; font-size: 12px; }
.sidebar-footer a { color: #575d74; }
.sidebar-footer a:hover { color: var(--accent); }
.workspace { min-width: 0; }
.topbar { height: 60px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #ffffffd9; }
#breadcrumb { font-size: 13px; font-weight: 650; color: #4f5369; }
.mode-select select { color: #5547b4; background: #f1efff; border-color: #e4ddff; font-size: 12px; font-weight: 650; }
.mode-select select[data-live=true] { background: #fff1db; color: #88540d; border-color: #f5dcae; }
.topbar-actions { display: flex; gap: 14px; align-items: center; }
.logout-button { border: 0; background: transparent; color: #7a758e; padding: 7px 0 7px 14px; border-left: 1px solid var(--line); font-size: 12px; }
.logout-button:hover { color: var(--accent); }
.agent-issue, .page-issue { padding: 10px 13px; border: 1px solid #eadcbf; border-radius: 8px; color: #7c4f13; background: #fff7e8; font-size: 13px; }
.agent-issue { margin: 12px 32px 0; }
.page-issue { margin-bottom: 12px; }
.agent-issue a, .page-issue a { margin-left: 6px; text-decoration: underline; }
.page { padding: 32px; max-width: 1560px; margin-inline: auto; }
.page-title { margin-bottom: 24px; }
.page-title h1 { font-size: clamp(23px, 2.2vw, 29px); letter-spacing: -.035em; line-height: 1.2; font-weight: 750; }
.page-title p { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.loading { margin: 36px; color: var(--muted); }

.button, .icon-button, .send, .text-button, .row-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button { min-height: 36px; padding: 7px 12px; font-weight: 650; border: 1px solid #dcd7fb; border-radius: 8px; background: white; color: var(--accent-dark); white-space: nowrap; }
.button:hover { background: #f7f5ff; border-color: #bfb4f6; }
.button.primary, .send { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover, .send:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.quiet { border-color: var(--line); background: #fff; color: #44495e; }
.button.danger { color: #9c303b; border-color: #f2d8dc; }
.icon-button { color: var(--muted); padding: 7px; border: 0; border-radius: 8px; background: transparent; }
.icon-button:hover { background: var(--soft); color: var(--accent-dark); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent-dark); font-weight: 650; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; min-width: 0; box-shadow: 0 2px 7px #14173505; }

.agent-page { min-height: 570px; height: calc(100dvh - 60px); display: flex; flex-direction: column; }
.agent-header { padding: 27px 32px 19px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--line); }
.agent-header .page-title { margin: 0; }
.agent-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.agent-actions select { width: min(30vw, 230px); min-width: 95px; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 24px 32px; scrollbar-color: #ccc9e8 transparent; }
.chat-scroll:has(.welcome) { display: grid; align-items: center; }
.welcome { width: min(780px, 100%); margin: 0 auto; padding: 16px 0 26px; }
.agent-symbol { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 16px; }
.welcome h2 { font-size: clamp(25px, 3.2vw, 37px); letter-spacing: -.05em; }
.welcome > p { color: var(--muted); margin: 9px 0 26px; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prompt { text-align: left; display: grid; gap: 8px; grid-template-columns: 1fr auto; background: white; border: 1px solid var(--line); padding: 17px; border-radius: 12px; color: var(--ink); }
.prompt:hover { border-color: #bdb2fb; background: #fdfcff; box-shadow: 0 4px 14px #6060ad0d; }
.prompt-icon, .card-icon, .confirmed-icon { display: inline-grid; place-items: center; background: var(--soft); color: var(--accent); width: 35px; height: 35px; border-radius: 9px; flex: 0 0 auto; }
.prompt-icon, .prompt strong { grid-column: 1 / -1; }
.prompt strong { font-size: 15px; }
.prompt > svg { grid-column: 2; color: var(--accent); align-self: center; }
.prompt small { line-height: 1.4; }
.recent { margin-top: 20px; display: grid; gap: 7px; }
.recent h3 { font-size: 13px; margin-bottom: 2px; }
.recent-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.recent-item:hover { background: #f7f5ff; }
.recent-item > span:first-of-type { flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.recent-item > svg { color: var(--accent); }
.composer-wrap { width: min(1024px, 100%); margin: auto auto 0; padding: 10px 32px 14px; }
.composer { display: flex; gap: 10px; align-items: center; border: 1px solid #d8d8e8; border-radius: 13px; padding: 8px; background: white; box-shadow: 0 5px 20px #3c346808; }
.composer:focus-within { border-color: #9b91ee; }
.composer textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 100px; padding: 8px 4px; resize: none; outline: none; border: 0; line-height: 22px; }
.composer textarea:focus-visible { outline: none; }
.tab-hint { display: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.composer:has(textarea:placeholder-shown) .tab-hint { display: inline; }
.tab-hint kbd { font: inherit; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: #f6f5fb; }
.send { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid; border-radius: 9px; }
.compose-foot { margin-top: 8px; text-align: center; color: var(--muted); font-size: 11px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; }
#attached, #upload-status { margin-bottom: 6px; }
#attached:empty { display: none; }
.bubble .attachment-list { margin-top: 6px; }
.attachment-chip { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; border: 1px solid #ddd6fa; border-radius: 8px; background: #f0ecff; color: var(--accent-dark); }
.attachment-chip a { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 4px; }
.attachment-chip a > span:last-child { overflow-wrap: anywhere; }
.attachment-thumb { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; position: relative; overflow: hidden; background: #e6dffd; border-radius: 6px; }
.attachment-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--white); }
.attachment-chip .icon-button { padding: 4px 7px; }
.message { display: flex; align-items: flex-start; gap: 10px; margin: 0 auto 20px; width: min(960px, 100%); }
.message.user { justify-content: flex-end; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 11px; }
.agent-avatar { background: var(--accent); color: white; }
.user-avatar { background: #e9e4ff; color: var(--accent); }
.bubble { max-width: calc(100% - 42px); border-radius: 10px; padding: 11px 13px; line-height: 1.6; overflow-wrap: anywhere; }
.user .bubble { color: #30266f; background: #e9e5ff; white-space: pre-wrap; }
.assistant .bubble { background: #f2f2f9; color: var(--ink); }
.assistant .bubble:has(> .inner-card), .assistant .bubble:has(> .confirmed) { padding: 0; background: transparent; width: min(590px, calc(100% - 42px)); }
.account-cards { display: grid; gap: 7px; margin-top: 8px; }
.account-card { display: flex; gap: 9px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink); }
.account-card:hover { border-color: #b7a9fa; }
.account-card small, .account-card strong { display: block; }
.account-card > span:nth-child(2) { flex: 1; padding-right: 8px; }
.account-card > svg { color: var(--accent); }

.inner-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 2px 7px #14173505; }
.card-header { display: flex; gap: 10px; align-items: center; min-width: 0; }
.card-header > div { flex: 1; min-width: 0; }
.card-header h3 { font-size: 16px; line-height: 1.3; }
.card-header p { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 3px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; min-width: 0; }
input:not([type=checkbox], [type=radio]), select, textarea { width: 100%; min-width: 0; border: 1px solid #dfe0ec; border-radius: 8px; padding: 8px 10px; background: white; font-weight: 450; min-height: 35px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #777b90; }
.fields { display: grid; gap: 10px; }
.generation-fields { grid-template-columns: 1.65fr .85fr .8fr .85fr; }
.check-field { display: flex; align-items: center; gap: 7px; width: fit-content; }
.check-field input, .mode input { accent-color: var(--accent); margin: 0; }
.card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.quote { margin-right: auto; color: var(--muted); font-size: 13px; }
.quote strong { font-size: 20px; color: var(--ink); }
.form-error { font-size: 12px; color: #9c303b; background: #fff2f4; padding: 7px 9px; border-radius: 6px; }
.generation-error { min-width: 0; max-width: 100%; }
.error-trigger { display: flex; gap: 8px; align-items: center; width: 100%; min-width: 0; padding: 0; background: transparent; border: 0; color: inherit; text-align: left; line-height: 1.6; }
.error-summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generation-error.compact { width: 220px; margin-top: 6px; padding: 4px 6px; }
.error-tooltip { position: fixed; z-index: 1000; width: max-content; max-width: min(480px, calc(100vw - 24px)); max-height: min(340px, calc(100dvh - 32px)); overflow: auto; overscroll-behavior: contain; padding: 13px 15px; border: 1px solid #e2dce8; border-radius: 9px; color: #612b37; background: #fffafb; box-shadow: 0 8px 30px #2b122b26; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.progress { position: relative; background: #eeeafa; border-radius: 20px; overflow: hidden; height: 6px; }
.progress i { position: absolute; height: 100%; width: 35%; border-radius: 20px; background: #8274ee; animation: progress 1.4s infinite ease-in-out; }
@keyframes progress { from { left: -35%; } to { left: 100%; } }
.media-preview { border: 1px solid var(--line); overflow: hidden; border-radius: 9px; }
.media-preview video { width: 100%; max-height: 250px; aspect-ratio: 16 / 9; display: block; background: #222136; }
.video-dialog { width: min(740px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; box-shadow: 0 16px 60px #17183140; }
.video-dialog[open] { display: grid; gap: 12px; }
.video-dialog::backdrop { background: #17183180; }
.video-dialog .media-preview video { max-height: min(58dvh, 520px); object-fit: contain; }
.video-dialog-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.video-dialog > .button { justify-self: end; }
.media-meta { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; font-size: 12px; color: var(--muted); }
.draft-media { display: flex; align-items: center; gap: 9px; background: #f8f8fc; border-radius: 8px; padding: 8px; }
.draft-media strong, .draft-media small { display: block; }
.field-heading { display: flex; justify-content: space-between; }
.mode { display: flex; padding: 3px; gap: 3px; border: 1px solid #e9e6f4; background: #f5f5fa; border-radius: 9px; margin: 0; min-width: 0; }
.mode label { flex: 1; display: flex; justify-content: center; align-items: center; gap: 4px; min-height: 30px; padding: 3px 6px; border-radius: 6px; color: #575b71; cursor: pointer; }
.mode label:has(input:checked) { background: #e4ddff; color: var(--accent-dark); font-weight: 700; }
.schedule-fields { grid-template-columns: 1fr 1fr; }
.confirmed { display: flex; align-items: center; gap: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.confirmed p { font-size: 12px; color: var(--muted); }
.confirmed div { flex: 1; }
.confirmed-icon { background: #e5f7e9; color: #167740; }

.accounts-page, .tasks-page { height: calc(100dvh - 60px); display: flex; flex-direction: column; overflow: hidden; }
.accounts-page > .page-title, .accounts-page > .page-issue, .tasks-page > .page-title { flex-shrink: 0; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; align-items: stretch; }
.account-panel, .account-layout > .account-detail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.account-panel > .toolbar, .account-detail > :not(.account-scroll) { flex-shrink: 0; }
.account-scroll, .record-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-color: #ccc9e8 transparent; }
.account-scroll thead, .record-scroll thead { position: sticky; top: 0; z-index: 1; }
.account-scroll td:nth-child(3) { white-space: nowrap; }
.account-panel .row-link > span { min-width: 0; overflow-wrap: anywhere; }
.list-progress { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 15px 12px; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; padding: 15px; }
.toolbar select { width: auto; max-width: 100%; }
.search { display: flex; flex: 1 1 172px; align-items: center; gap: 6px; border: 1px solid #dfe0ec; border-radius: 8px; padding-left: 10px; color: var(--muted); }
.search input { outline: none; padding-left: 1px; border: 0; }
.search:focus-within { outline: 2px solid #7366f5; }
.search input:focus-visible { outline: none; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: 13px; }
th, td { padding: 12px; border-bottom: 1px solid #eeeef5; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 15px; }
th { background: #f7f7fb; color: #55596f; white-space: nowrap; font-weight: 680; }
td small { display: block; margin-top: 2px; white-space: nowrap; }
td .badge { white-space: nowrap; }
td .platform { margin-right: 4px; }
tr:last-child td { border-bottom: 0; }
tr.selected-row td { background: #f1eeff; }
.row-link { text-align: left; border: 0; background: transparent; padding: 0; color: inherit; }
.row-link:hover strong { color: var(--accent-dark); }
.platform { width: 27px; height: 27px; background: #f0f0f8; color: #15161e; display: inline-grid; place-items: center; border-radius: 8px; font-size: 17px; font-weight: 800; vertical-align: middle; flex-shrink: 0; }
.platform.tiktok { color: white; background: #1a1b29; }
.platform.youtube { background: #ffe6e8; color: #d11f36; font-size: 13px; }
.platform.instagram { background: #ffe9f1; color: #aa126e; }
.badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 690; line-height: 1.4; white-space: nowrap; }
.badge span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.purple { background: #eeebff; color: #5137b7; }
.badge.blue { background: #e7effe; color: #2354a9; }
.badge.green { background: #e6f7eb; color: #136f39; }
.badge.red { background: #fcebec; color: #a53245; }
.badge.orange { background: #fff1db; color: #88540d; }
.badge.gray { background: #f0f0f7; color: #62667a; }
.account-detail, .task-detail { padding: 18px; }
.account-summary { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; }
.account-summary .platform { width: 39px; height: 39px; font-size: 22px; }
.account-summary h2 { font-size: 20px; }
.account-summary p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.account-meta { display: flex; gap: 12px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.account-meta strong { margin-left: 4px; color: var(--ink); }
.section-label { color: var(--accent-dark); font-weight: 700; padding: 14px 0 8px; }
.section-label span { display: inline-block; color: var(--accent-dark); background: var(--soft); border-radius: 15px; padding: 1px 6px; margin-left: 4px; font-size: 11px; }
.works { margin-top: 9px; }
.work-row { display: flex; align-items: center; gap: 9px; border-top: 1px solid #eeeef5; padding: 9px 0; }
.work-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.work-row strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.work-row small { display: block; margin-top: 3px; }
.thumbnail { display: inline-grid; position: relative; place-items: center; width: 58px; height: 39px; flex-shrink: 0; overflow: hidden; border-radius: 7px; background: #eae6f9; color: #7065ac; }
.thumbnail img { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; }
.empty { padding: 34px 12px; display: grid; justify-items: center; text-align: center; gap: 8px; color: var(--ink); }
.empty p { color: var(--muted); font-size: 12px; }
.tasks-layout { display: flex; flex: 1; min-height: 0; gap: 16px; align-items: stretch; position: relative; }
.task-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.task-panel > .tabs, .task-panel > .toolbar { flex-shrink: 0; }
.task-panel > .tabs { flex-wrap: nowrap; overscroll-behavior: contain; }
.task-detail { width: min(30%, 300px); min-width: 220px; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.tabs { display: flex; gap: 16px; padding: 0 15px; border-bottom: 1px solid var(--line); overflow: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #5d6279; padding: 13px 2px 11px; white-space: nowrap; }
.tabs button[aria-pressed=true] { border-bottom-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.task-work { display: flex; align-items: center; gap: 8px; min-width: 115px; }
.task-work strong { overflow-wrap: anywhere; }
.record-scroll .task-work { min-width: 240px; max-width: 420px; }
.record-scroll .task-work strong { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-title { display: flex; align-items: center; justify-content: space-between; }
.detail-title h2, .settings-card h2, .timezone-card h2 { font-size: 16px; }
.detail-work { margin: 12px 0; }
.details { display: grid; gap: 8px; font-size: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.details div { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 5px; align-items: baseline; }
.details dt { color: var(--muted); }
.break { overflow-wrap: anywhere; }
.timeline-title { margin-top: 14px; font-size: 13px; }
.timeline { padding: 10px 0 0 13px; list-style: none; font-size: 12px; }
.timeline li { position: relative; border-left: 1px solid #ddd8f5; padding: 0 0 11px 12px; }
.timeline li::before { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #8171ee; top: 4px; left: -4px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline small { display: block; margin-top: 2px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.agent-result-actions { margin-top: 12px; }

.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settings-card { padding: 17px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.storage-settings { margin-top: 14px; }
.storage-fields { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.storage-fields .field-note { grid-column: 1 / -1; }
.settings-card > p:not(.form-error), .timezone-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-card .official { align-self: flex-start; margin-bottom: 5px; font-size: 12px; white-space: normal; }
.settings-actions { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.clear-secret { justify-content: flex-start; font-size: 12px; }
.timezone-card { margin-top: 14px; padding: 15px 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timezone-card > div { flex: 1 1 200px; }
.timezone-card select { width: auto; }
.timezone-card h2 { margin-bottom: 3px; }
.toast { position: fixed; right: 24px; bottom: 21px; z-index: 5; background: #24213f; color: white; padding: 11px 14px; border-radius: 9px; box-shadow: 0 7px 18px #19152a24; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 181px minmax(0, 1fr); }
  .page, .chat-scroll { padding-left: 22px; padding-right: 22px; }
  .agent-header, .topbar, .composer-wrap { padding-left: 22px; padding-right: 22px; }
  th, td { padding: 10px 7px; }
  .tasks-layout:has(.task-detail:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) 230px; grid-template-rows: minmax(0, 1fr); }
  .task-detail { width: 100%; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 146px minmax(0, 1fr); }
  .sidebar { padding-left: 8px; padding-right: 8px; }
  .brand { font-size: 13px; margin-left: 3px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; font-size: 18px; }
  .sidebar nav a { padding-inline: 9px; gap: 7px; font-size: 13px; }
  .account-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tasks-layout:has(.task-detail:not([hidden])) { display: flex; }
  .task-detail { position: absolute; inset: 0 0 0 auto; width: min(360px, 100%); min-width: 0; z-index: 2; box-shadow: -8px 0 24px #1718311a; }
  .account-layout { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { min-height: auto; height: auto; z-index: 1; padding: 9px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 4px 8px; }
  .brand small { display: inline; margin-left: 5px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .sidebar nav a { min-height: 34px; padding: 5px 7px; gap: 4px; font-size: 12px; }
  .sidebar nav a svg { width: 15px; }
  .shell:has(.accounts-page, .tasks-page) .sidebar nav { flex-wrap: nowrap; overflow-x: auto; }
  .shell:has(.accounts-page, .tasks-page) .sidebar nav a { flex-shrink: 0; }
  .sidebar-footer { display: none; }
  .topbar { height: 40px; padding-inline: 13px; }
  .page { padding: 18px 12px; }
  .accounts-page, .tasks-page { padding-top: 12px; padding-bottom: 12px; }
  .accounts-page > .page-title, .tasks-page > .page-title { margin-bottom: 12px; }
  .accounts-page > .page-title p, .tasks-page > .page-title p { margin-top: 5px; font-size: 12px; }
  .account-layout { grid-template-rows: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; }
  .account-panel .toolbar { padding: 8px; gap: 6px; }
  .account-panel .search { flex-basis: 100%; }
  .task-panel > .toolbar { padding: 8px; gap: 6px; }
  .account-scroll th, .account-scroll td { padding: 8px; }
  .account-layout > .account-detail { padding: 12px; }
  .account-summary { padding-bottom: 8px; gap: 8px; }
  .account-summary h2 { font-size: 17px; }
  .account-summary p { margin-top: 3px; font-size: 11px; }
  .account-meta { gap: 6px; padding-bottom: 8px; font-size: 11px; }
  .account-detail .section-label { padding-top: 8px; padding-bottom: 5px; }
  .account-detail > .field-note { font-size: 11px; }
  .account-detail .works { margin-top: 5px; }
  .agent-page { min-height: 480px; height: calc(100dvh - 132px); }
  .agent-header, .chat-scroll, .composer-wrap { padding-left: 12px; padding-right: 12px; }
  .agent-header { padding-top: 14px; padding-bottom: 13px; }
  .agent-actions { flex-wrap: wrap; }
  .agent-header p { font-size: 12px; }
  .prompt-grid { gap: 6px; grid-template-columns: minmax(0, 1fr); }
  .prompt { padding: 8px 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 5px 8px; align-items: center; }
  .prompt-icon { grid-row: 1 / 3; grid-column: 1; width: 28px; height: 28px; }
  .prompt strong { grid-column: 2; font-size: 13px; }
  .prompt small { grid-column: 2; font-size: 11px; }
  .prompt > svg { grid-column: 3; grid-row: 1 / 3; }
  .generation-fields, .schedule-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .message { gap: 6px; }
  .avatar { flex-basis: 25px; height: 25px; border-radius: 8px; }
  .avatar svg { width: 15px; }
  .assistant .bubble:has(> .inner-card), .assistant .bubble:has(> .confirmed), .bubble { max-width: calc(100% - 31px); }
  .inner-card { padding: 11px; }
  .confirmed { flex-wrap: wrap; }
}

@media (max-width: 620px) and (max-height: 700px) {
  .accounts-page > .page-title p, .tasks-page > .page-title p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .progress i { animation: none; }
}

.image-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 16px 0; }
.image-result-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.image-preview-button { border: 1px solid var(--line); border-radius: 12px; background: #f5f4fa; padding: 0; cursor: zoom-in; overflow: hidden; width: 100%; }
.image-preview-button img { display: block; width: 100%; height: 230px; object-fit: contain; }
.image-result-item small { color: var(--muted); }
.image-placeholder { display: grid; place-content: center; gap: 12px; width: 100%; min-height: 180px; background: #f5f4fa; border-radius: 12px; color: var(--muted); text-align: center; }
.image-placeholder svg { margin: auto; }
.image-full-preview { display: block; width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 12px; background: #f5f4fa; }
.prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tabs { flex-wrap: wrap; }
@media (max-width: 620px) { .prompt-grid { grid-template-columns: minmax(0, 1fr); } .image-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.platform.facebook { color: #1877f2; background: #e8efff; font-weight: 750; font-size: 19px; }
.work-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
