@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;450;500;550;600;650&display=swap');

:root {
  --primary: #7774fa;
  --primary-hover: #6561e9;
  --ink: #45464d;
  --muted: #929299;
  --line: #f0f0f3;
  --workspace-bg: #fcfaf8;
  --sidebar: clamp(190px, 18.3vw, 244px);
  --list: clamp(250px, 20.8vw, 300px);
  --topbar: 68px;
  --font: 'Be Vietnam Pro', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.65 var(--font);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button,
a {
  transition: color .16s, background .16s;
}

button:disabled {
  opacity: .45;
  cursor: wait;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -.5px;
}

h2 {
  font-size: 14px;
  font-weight: 550;
}

h3 {
  font-size: 12px;
  font-weight: 500;
}

small {
  font-size: 12px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

input,
textarea,
select {
  min-width: 0;
}

.skip {
  position: fixed;
  top: -60px;
  left: 15px;
  background: #fff;
  padding: 10px;
  z-index: 20;
}

.skip:focus {
  top: 8px;
}

.app-shell {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 38px;
  background: #f6f6f7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 25px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 550;
  color: #66666d;
}

.connect-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  border-radius: 24px;
  color: #fff;
  background: var(--primary);
  margin: 37px 0 28px;
  font-size: 12px;
}

.connect-button:hover {
  background: var(--primary-hover);
}

.connect-button>span {
  display: flex;
}

.connect-button svg {
  width: 14px;
  height: 14px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  width: 100%;
  padding: 10px 16px;
  color: #727278;
  text-align: left;
  font-size: 12px;
  font-weight: 400;
  border-radius: 5px;
}

.nav-item svg {
  width: 15px;
  height: 15px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item:hover {
  background: #ededf1;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 35px;
}

.main-shell {
  flex: 1;
  min-width: 0;
  background: #fff;
}

.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 28px 0 20px;
  gap: 20px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #909098;
  flex: 1;
  max-width: 340px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #e8e8ee;
  border-radius: 8px;
  background: #fafafd;
}

.global-search>span {
  display: flex;
}

.global-search svg {
  width: 14px;
  height: 14px;
}

.global-search input {
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  width: 100%;
  font-size: 12px;
}

.global-search input::placeholder {
  color: #9999a1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.desktop .topbar {
  padding-right: 12px;
  user-select: none;
}

.mode-pill {
  color: #8d8d98;
  font-size: 12px;
  padding: 3px 7px;
  border: 1px solid #efeff3;
  border-radius: 4px;
}

.mode-pill.live {
  color: #5e8976;
}

.icon-button {
  width: 33px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #96969e;
  border-radius: 5px;
  flex-shrink: 0;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.icon-button:hover {
  color: var(--primary);
  background: #f8f7ff;
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  position: relative;
  font-size: 12px;
  font-weight: 500;
  background: #e7dfed;
  color: #8f6b9b;
}

.avatar.c0 {
  background: #eddfdb;
  color: #9c7167;
}

.avatar.c1 {
  background: #dfe6eb;
  color: #678094;
}

.avatar.c2 {
  background: #e1e8dc;
  color: #778b62;
}

.avatar.c3 {
  background: #eee6d6;
  color: #a28a59;
}

.avatar.c4 {
  background: #e4ddef;
  color: #886ca5;
}

.avatar.self {
  background: #dfded8;
  color: #79756a;
}

.avatar.small {
  width: 29px;
  height: 29px;
  font-size: 12px;
  margin-left: 12px;
}

.platform-mini {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  background: #527ad1;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
}

.platform-mini svg {
  width: 10px;
  height: 10px;
}

.platform-mini.tiktok {
  background: #4b4b53;
}

.platform-mini.zalo {
  background: #3686d3;
}

main {
  outline: none;
}

.inbox-page {
  height: calc(100dvh - var(--topbar));
}

.inbox-body {
  display: flex;
  height: 100%;
}

.conversation-list {
  width: var(--list);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.list-controls {
  height: 47px;
  flex-shrink: 0;
  padding: 8px 19px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.list-controls select {
  border: 0;
  background: #fff;
  font-size: 12px;
  color: #909098;
  padding: 4px 2px;
  max-width: 160px;
  cursor: pointer;
}

.list-count {
  margin-left: auto;
  color: #ababaf;
  font-size: 12px;
}

.conversation-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ebebef transparent;
}

.conversation {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  padding: 20px 19px 20px 17px;
  min-height: 88px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid #f6f6f8;
  position: relative;
}

.conversation:hover {
  background: #fcfbff;
}

.conversation.selected {
  border-left-color: var(--primary);
  background: #fbfaff;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.conversation strong {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation time {
  font-size: 12px;
  color: #a4a4aa;
  white-space: nowrap;
}

.conversation p {
  font-size: 12px;
  color: #96969e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  padding-right: 15px;
}

.unread {
  position: absolute;
  right: 19px;
  bottom: 22px;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  border-radius: 8px;
}

.list-empty {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-tabs {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  gap: 20px;
  flex-shrink: 0;
  position: relative;
}

.chat-tab-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
}

.tab {
  height: 36px;
  padding: 0;
  border-bottom: 1px solid transparent;
  color: #929299;
  font-size: 12px;
  white-space: nowrap;
}

.tab.active {
  color: #515159;
  border-color: #76767c;
}

.chat-actions {
  display: flex;
  position: absolute;
  right: 19px;
  gap: 1px;
}

.chat-actions .icon-button {
  width: 25px;
  color: #b3b3bc;
}

.chat-actions svg {
  width: 12px;
  height: 12px;
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 38px 20px;
  scrollbar-width: thin;
  scrollbar-color: #efeff2 transparent;
}

.message {
  margin-bottom: 30px;
  display: flex;
}

.message-wrap {
  width: fit-content;
  min-width: 0;
  max-width: min(76%, 580px);
}

.message-sender {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
  font-size: 12px;
  color: #66666d;
}

.message-sender .avatar {
  width: 29px;
  height: 29px;
  font-size: 12px;
}

.bubble {
  margin-left: 0;
  padding: 16px 19px 11px;
  background: #f5f5f6;
  color: #797980;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble time {
  display: block;
  text-align: right;
  font-size: 12px;
  margin-top: 7px;
  line-height: 1.5;
  color: #a3a3ab;
}

.message.outgoing {
  justify-content: flex-end;
  margin-top: 30px;
}

.message.outgoing .bubble {
  background: var(--primary);
  color: #fff;
}

.message.outgoing time {
  color: #eeedff;
}

.message.outgoing time span {
  margin-left: 3px;
}

.selected-comment .bubble {
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

.reply-target {
  font-size: 12px;
  color: #7774bd;
  padding: 6px 0;
}

.composer {
  display: flex;
  align-items: center;
  border: 1px solid #ededf1;
  border-radius: 24px;
  min-height: 43px;
  margin: 18px 38px 40px;
  padding: 3px 5px 3px 17px;
  gap: 8px;
  flex-shrink: 0;
}

.composer textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: 0;
  outline-offset: 1px;
  background: transparent;
  min-height: 25px;
  max-height: 100px;
  padding: 3px 0;
  font-size: 12px;
  line-height: 1.8;
}

.composer textarea::placeholder {
  color: #a5a5ab;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer .button {
  min-height: 29px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
}

.composer .button svg {
  width: 11px;
  height: 11px;
}

.composer .icon-button {
  width: 26px;
  height: 28px;
}

.composer .icon-button svg {
  width: 13px;
  height: 13px;
}

.back-mobile {
  display: none;
}

.queue-status {
  margin: 0 38px;
  padding: 8px 12px;
  color: #9b855e;
  background: #faf8f2;
  font-size: 12px;
  border-radius: 4px;
}

.load-more {
  text-align: center;
  padding-bottom: 20px;
}

.text-button {
  font-size: 12px;
  color: var(--primary);
  padding: 3px 5px;
}

.loading {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 40px 15px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 50px 25px;
  margin: auto;
}

.empty>span {
  display: inline-flex;
  color: #b2afca;
  margin-bottom: 15px;
}

.empty>span svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.2;
}

.empty h2 {
  color: #97939f;
  font-size: 12px;
  font-weight: 400;
}

.empty p {
  font-size: 12px;
  margin-bottom: 16px;
}

.content-page {
  height: calc(100dvh - var(--topbar));
  overflow-y: auto;
  background: #fff;
  scrollbar-gutter: stable;
}

.app-shell ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.app-shell ::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell ::-webkit-scrollbar-thumb {
  background: rgba(113, 113, 122, .26);
  border-radius: 999px;
}

.app-shell ::-webkit-scrollbar-thumb:hover {
  background: rgba(113, 113, 122, .46);
}

.app-shell ::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 35px 42px 30px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.content-inner {
  padding: 0 42px 40px;
  max-width: 1150px;
}

.competitor-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.competitor-sources,
.competitor-feed {
  border: 1px solid #e6e4eb;
  border-radius: 10px;
  min-width: 0;
}

.competitor-sources {
  position: sticky;
  top: 12px;
  padding: 12px;
}

.competitor-sources h2,
.competitor-feed h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.competitor-sources h2 {
  padding: 8px 10px 12px;
}

.competitor-sources #add-competitor,
.competitor-sources #competitor-links {
  margin-top: 10px;
}

.competitor-link-table {
  overflow: auto;
  margin-bottom: 14px;
}

.competitor-link-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.competitor-link-table th,
.competitor-link-table td {
  padding: 8px;
  border-bottom: 1px solid #e6e4eb;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.competitor-channel {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  text-align: left;
  border-radius: 7px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.competitor-channel>span {
  font-weight: 600;
}

.competitor-channel:hover,
.competitor-channel[aria-pressed="true"] {
  background: #eeecff;
  color: #4940aa;
}

.competitor-channel small,
.competitor-feed-heading>span,
.competitor-post time {
  font-size: 12px;
  color: #626073;
}

.competitor-channel small.needs-attention {
  color: #8d4e16;
}

.competitor-help {
  margin: 10px;
  color: #626073;
  font-size: 13px;
}

.competitor-help summary {
  cursor: pointer;
}

.competitor-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
}

.competitor-post {
  border-top: 1px solid #eae8ef;
  padding: 18px 20px;
}

.competitor-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
}

.competitor-post time {
  margin-left: auto;
}

.competitor-new {
  background: #eeecff;
  color: #4940aa;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 99px;
}

.competitor-post p {
  margin: 10px 0 12px;
  color: #343240;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.competitor-post .button {
  display: inline-flex;
}

.competitor-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.competitor-images[data-multiple="true"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.competitor-images button {
  display: block;
  overflow: hidden;
  border: 1px solid #e6e4eb;
  border-radius: 8px;
  background: #f7f6fa;
}

.competitor-images img {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.competitor-images[data-multiple="true"] img {
  aspect-ratio: 1.4;
  object-fit: cover;
}

.competitor-empty {
  padding: 0 20px 20px;
  color: #626073;
}

@media(max-width:850px) {
  .competitor-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .competitor-sources {
    position: static;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  padding: 8px 14px;
  border: 1px solid #e8e8ee;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.button svg {
  width: 14px;
  height: 14px;
}

.button:hover {
  background: #f8f8fb;
}

.button.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.button.primary:hover {
  background: var(--primary-hover);
}

.button.danger {
  color: #bb6671;
}

.panel {
  padding: 23px 25px;
  border: 1px solid #ededf1;
  border-radius: 7px;
  background: #fff;
  margin-bottom: 21px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.subtle {
  color: #aaa8b1;
  font-size: 12px;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.connection-card:last-child {
  padding-bottom: 5px;
}

.service-logo {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 7px;
  background: #f2f0fb;
  color: #8b83bd;
  font-size: 17px;
  font-weight: 550;
}

.service-logo.zalo {
  background: #eef5fb;
  color: #5d91bc;
  font-size: 12px;
}

.connection-info {
  flex: 1;
  min-width: 150px;
}

.connection-info strong {
  font-size: 12px;
  font-weight: 500;
}

.connection-info p {
  color: #a09ba7;
  font-size: 12px;
  margin-top: 4px;
}

.documents-list {
  border-top: 1px solid var(--line);
}

.document-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 23px 3px;
  border-bottom: 1px solid var(--line);
}

.document-row>div {
  flex: 1;
  min-width: 0;
}

.document-row p {
  font-size: 12px;
  color: #a29dab;
  margin-top: 5px;
}

.document-icon {
  color: #a49bb7;
  display: flex;
}

.document-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.3;
}

.settings-form {
  max-width: 780px;
}

.settings-form .panel h2 {
  margin-bottom: 20px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}

.form-field input,
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
  border: 1px solid #e5e3eb;
  border-radius: 5px;
  padding: 10px 12px;
  background: #fff;
  font-size: 12px;
}

.form-field textarea {
  min-height: 165px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #b0aab9;
}

.form-field small {
  display: block;
  font-size: 12px;
  color: #a19aaa;
  margin-top: 8px;
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7e3ef;
  padding: 10px 16px;
  border-radius: 5px;
  margin: 0 !important;
}

.radio-option:has(input:checked) {
  border-color: #b7b1ef;
  background: #fbfaff;
}

.radio-option input {
  width: auto;
  accent-color: var(--primary);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
}

.check-row input {
  margin-top: 5px;
  accent-color: var(--primary);
}

.check-row small {
  display: block;
  font-size: 12px;
  color: #a39baa;
  margin-top: 3px;
}

.advanced summary {
  font-size: 12px;
  cursor: pointer;
}

.advanced[open] summary {
  margin-bottom: 20px;
}

.settings-save {
  display: flex;
  justify-content: flex-end;
}

.notice {
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 1px solid #eee8d8;
  background: #fcfaf5;
  border-radius: 5px;
  color: #9d865d;
  font-size: 12px;
}

.notice svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 5px;
}

.section-intro {
  color: #9b93a5;
  font-size: 12px;
  line-height: 1.9;
}

dialog {
  border: 1px solid #e9e6ef;
  border-radius: 10px;
  width: min(470px, 92vw);
  max-height: 90dvh;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 20px 80px #24203320;
}

dialog::backdrop {
  background: #27233838;
}

.modal-body {
  padding: 26px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 8px;
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 500;
}

.modal-body>p {
  font-size: 12px;
  color: #9a93a3;
  margin: 0 0 23px;
  line-height: 1.9;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.form-error {
  color: #af5b6b;
  background: #fff5f6;
  font-size: 12px;
  padding: 12px;
  border-radius: 5px;
  margin-top: 15px;
}

.qr {
  display: block;
  width: 230px;
  height: 230px;
  object-fit: contain;
  margin: 20px auto;
}

#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 10px);
  max-width: min(90vw, 600px);
  border-radius: 6px;
  padding: 11px 17px;
  color: #fff;
  background: #4d4858;
  font-size: 12px;
  box-shadow: 0 5px 20px #31253f15;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spinner {
  width: 12px;
  height: 12px;
  border: 1px solid #ffffff70;
  border-top-color: #fff;
  display: inline-block;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width:1600px) {
  :root {
    --sidebar: 260px;
    --list: 320px;
  }

  .chat-scroll {
    padding-left: 48px;
    padding-right: 48px;
  }

  .composer {
    margin-left: 48px;
    margin-right: 48px;
  }

  .conversation {
    min-height: 98px;
  }

  .conversation strong {
    font-size: 12px;
  }

  .conversation p {
    font-size: 12px;
  }

  .bubble {
    font-size: 13px;
  }
}

@media (max-width:1100px) {
  :root {
    --sidebar: 180px;
    --list: 250px;
    --topbar: 62px;
  }

  .sidebar {
    padding-left: 17px;
    padding-right: 17px;
  }

  .brand {
    font-size: 12px;
  }

  .nav-item {
    padding-left: 10px;
    gap: 12px;
  }

  .chat-tabs {
    justify-content: flex-start;
    padding-left: 27px;
  }

  .chat-tab-items {
    gap: 25px;
  }

  .tab {
    font-size: 12px;
  }

  .chat-actions {
    right: 10px;
  }

  .chat-scroll {
    padding: 18px 27px;
  }

  .message-wrap {
    max-width: 85%;
  }

  .bubble {
    padding: 13px 15px 10px;
    font-size: 12px;
  }

  .composer {
    margin: 15px 27px 30px;
  }

  .page-heading {
    padding: 28px;
  }

  .content-inner {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width:800px) {
  :root {
    --sidebar: 72px;
  }

  .sidebar {
    padding: 22px 10px 25px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand>span:last-child,
  .connect-button,
  .nav-item>span,
  .sidebar-bottom {
    display: none;
  }

  .sidebar nav {
    margin-top: 42px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px 0;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .topbar {
    padding: 0 20px;
  }

  .top-actions {
    gap: 5px;
  }

  .avatar.small {
    margin-left: 4px;
  }
}

@media (max-width:650px) {
  :root {
    --topbar: 58px;
  }

  .app-shell {
    height: 100dvh;
    padding-bottom: 59px;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 59px;
    padding: 0 10px;
    background: #fafafa;
    border-top: 1px solid var(--line);
    z-index: 5;
  }

  .brand {
    display: none;
  }

  .sidebar nav {
    display: flex;
    justify-content: space-around;
    margin: 0;
    height: 59px;
  }

  .nav-item {
    width: 55px;
    min-height: 44px;
  }

  .inbox-page {
    height: calc(100dvh - var(--topbar) - 59px);
  }

  .content-page {
    height: calc(100dvh - var(--topbar) - 59px);
  }

  .conversation-list {
    width: 100%;
    border-right: 0;
  }

  .conversation {
    min-height: 88px;
    padding: 20px;
  }

  .conversation strong {
    font-size: 12px;
  }

  .conversation p {
    font-size: 12px;
  }

  .chat {
    display: none;
  }

  .inbox-body.chat-open .conversation-list {
    display: none;
  }

  .inbox-body.chat-open .chat {
    display: flex;
  }

  .chat-tabs {
    min-height: 60px;
    padding-left: 8px;
    gap: 8px;
  }

  .chat-tab-items {
    gap: 22px;
  }

  .back-mobile {
    display: inline-flex;
  }

  .chat-actions {
    display: none;
  }

  .chat-scroll {
    padding: 15px 20px;
  }

  .message-wrap {
    max-width: 88%;
  }

  .message {
    margin-bottom: 25px;
  }

  .bubble {
    font-size: 12px;
  }

  .composer {
    margin: 10px 15px 20px;
  }

  .composer textarea {
    font-size: 12px;
  }

  .page-heading {
    padding: 25px 20px;
    flex-wrap: wrap;
  }

  .content-inner {
    padding: 0 20px 25px;
  }

  .panel {
    padding: 20px;
  }

  .connection-card {
    gap: 10px;
  }

  .connection-info {
    min-width: 120px;
  }

  .global-search {
    max-width: 210px;
  }

  .global-search input {
    font-size: 12px;
  }

  .topbar {
    gap: 10px;
    padding: 0 15px;
  }

  #help {
    display: none;
  }

  .mode-pill {
    font-size: 12px;
  }

  .document-row {
    gap: 12px;
  }
}

@media (prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Desktop reading sizes */
.brand {
  font-size: 14px;
}

.connect-button,
.nav-item {
  font-size: 14px;
}

.global-search input {
  font-size: 14px;
}

.conversation strong {
  font-size: 14px;
}

.conversation p,
.conversation time {
  font-size: 12px;
}

.message-sender {
  font-size: 14px;
}

.bubble {
  font-size: 15px;
  line-height: 1.8;
}

.bubble time {
  font-size: 12px;
}

.composer textarea {
  font-size: 14px;
}

.composer .button {
  font-size: 12px;
}

.form-field input,
.form-field textarea,
.form-field select {
  font-size: 14px;
}

.form-field label,
.button,
.tab {
  font-size: 13px;
}

@media(max-width:650px) {
  .bubble {
    font-size: 15px;
  }

  .global-search input {
    font-size: 14px;
  }
}

/* One icon family, readable platform identity, and real profile images. */
.ui-icon {
  stroke-width: 1.75;
  vertical-align: middle;
}

.icon-button svg,
.nav-item svg {
  width: 18px;
  height: 18px;
}

.avatar {
  overflow: visible;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.conversation {
  min-height: 112px;
  gap: 13px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.conversation>.avatar {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.conversation-channel {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  min-width: 0;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: #62616c;
  white-space: nowrap;
}

.platform-badge svg {
  width: 18px;
  height: 18px;
}

.platform-badge.facebook svg {
  color: #276dd5;
}

.platform-badge.zalo svg {
  color: #0879da;
}

.platform-badge.tiktok svg {
  color: #24242c;
}

.channel-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: #96929e;
  min-width: 0;
}

.conversation p {
  margin-top: 5px;
}

.message-sender .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

/* Photos stay in the message and open in a dedicated viewer. */
.media-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.media-frame {
  margin: 0;
  max-width: 100%;
  min-width: 150px;
  border-radius: 7px;
  overflow: hidden;
  background: #eeedf3;
}

.media-open {
  display: block;
  padding: 0;
  max-width: 100%;
  cursor: zoom-in;
}

.media-image {
  display: block;
  max-width: 100%;
  max-height: 330px;
  min-width: 140px;
  object-fit: contain;
  border-radius: 7px;
}

.media-image:not([src]) {
  width: 230px;
  height: 160px;
  background: #e9e7ef;
}

.media-error {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-direction: column;
  min-height: 140px;
  padding: 18px;
  color: #8b8599;
  font-size: 12px;
}

.media-frame.failed .media-open {
  display: none;
}

.media-frame.failed .media-error {
  display: flex;
}

.file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  font-size: 12px;
}

.message-text {
  display: block;
}

.composer:has(.attachment-preview) {
  flex-wrap: wrap;
  border-radius: 12px;
  padding-top: 9px;
}

.attachment-preview {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 4px 9px;
  font-size: 12px;
  color: #898391;
  min-width: 0;
}

.attachment-preview>img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.attachment-preview>span {
  flex: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.attachment-preview.uploading {
  color: var(--primary);
}

.composer-toolbar .icon-button {
  width: 32px;
  height: 32px;
}

.composer-toolbar .icon-button svg {
  width: 18px;
  height: 18px;
}

dialog.image-dialog {
  width: max-content;
  max-width: 94vw;
  max-height: 94dvh;
}

.image-dialog .modal-body {
  padding: 14px;
}

.image-dialog .modal-header {
  margin: 0 0 10px;
}

.image-dialog .modal-header h2 {
  font-size: 14px;
}

.image-dialog .modal-body>p:empty {
  display: none;
}

.image-lightbox {
  display: block;
  margin-inline: auto;
  max-width: 88vw;
  max-height: 79dvh;
  object-fit: contain;
  border-radius: 5px;
}

.post-photo-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  width: min(920px, 88vw);
  gap: 18px;
}

.post-photo-detail .image-lightbox {
  width: auto;
  max-width: 100%;
}

.post-photo-detail section {
  max-height: 79dvh;
  overflow: auto;
  padding: 12px 0 0 16px;
  border-inline-start: 1px solid var(--line);
}

.post-photo-detail time {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.post-photo-detail p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0;
}

@media(max-width:650px) {
  .post-photo-detail {
    grid-template-columns: minmax(0, 1fr)
  }

  .post-photo-detail section {
    border-inline-start: 0;
    padding: 0;
    max-height: none
  }

  .post-photo-detail .image-lightbox {
    max-height: 58dvh
  }
}

.image-hidden {
  visibility: hidden;
}

/* Comment workspace: post context, nested discussion, and an inline reply. */
.inbox-page.comments-page {
  display: flex;
  flex-direction: column;
}

.comments-page .inbox-body {
  flex: 1;
  height: auto;
  min-height: 0;
}

.comment-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.comment-navigation button {
  padding: 10px 2px;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  cursor: pointer;
}

.comment-navigation button[aria-current="page"] {
  border-bottom-color: currentColor;
  font-weight: 600;
}

.unified-comments-toolbar {
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  min-height: 48px
}

.unified-comments-toolbar>strong {
  font-size: 15px;
  font-weight: 550
}

.unified-comments-toolbar>span {
  font-size: 11px;
  color: #827a95
}

.unified-comments-toolbar>div {
  display: flex;
  gap: 14px;
  margin-left: auto
}

.unified-comments-toolbar button {
  padding: 5px 0;
  font-size: 12px
}

.comment-ai-status {
  font-size: 10px;
  color: #6752b8;
  background: #f1edff;
  padding: 2px 7px;
  border-radius: 4px
}

.comment-ai-status[data-state="failed"] {
  background: #fff0eb;
  color: #b65d35
}

.comment-ai-status[data-state="skipped"] {
  background: #f3f3f6;
  color: #898493
}

#comment-ai-filter {
  max-width: 160px;
  font-size: 11px
}

.comment-saved-ai-reply {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 2px solid #dcd3ff;
  background: #faf8ff;
  border-radius: 4px
}

.comment-saved-ai-reply strong {
  font-size: 11px;
  color: #6752b8
}

.comment-saved-ai-reply p {
  margin: 4px 0;
  font-size: 13px
}

.comments-page .conversation-list {
  width: 340px;
}

.list-title {
  font-size: 13px;
  color: #62606a;
  font-weight: 500;
}

.comments-page .list-controls select {
  margin-left: auto;
  max-width: 155px;
}

.post-row {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 20px 17px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
}

.post-row:hover {
  background: #fcfbfe;
}

.post-row.selected {
  border-left-color: var(--primary);
  background: #f8f7ff;
}

.post-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 58px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #aaa3b7;
  background: #f0edf6;
}

.post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-thumb>svg {
  width: 22px;
  height: 22px;
}

.post-row-body {
  min-width: 0;
  flex: 1;
}

.post-account {
  display: block;
  font-size: 12px;
  color: #93909b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.post-caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
}

.post-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 12px;
  color: #aaa4b0;
}

.post-row-meta .platform-badge svg {
  width: 16px;
  height: 16px;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 32px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.comments-header h2 {
  font-size: 15px;
  font-weight: 500;
}

.comments-header>#reload-chat {
  margin-left: auto;
}

.comments-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px 32px 40px;
  scrollbar-width: thin;
  scrollbar-color: #ebe7f2 transparent;
}

.post-context {
  border: 1px solid #ece9f1;
  border-radius: 8px;
  padding: 17px 19px;
  background: #fff;
}

.post-context-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #a39aa9;
}

.post-context-head strong {
  font-size: 13px;
  font-weight: 500;
  color: #76707e;
}

.post-context-head>span:last-child {
  margin-left: auto;
}

.post-context-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 13px;
}

.post-context-content>p {
  font-size: 14px;
  line-height: 1.8;
  color: #716a7a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-context-image {
  width: 72px;
  height: 82px;
  flex-shrink: 0;
  border-radius: 5px;
}

.comments-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 23px 0 10px;
  border-bottom: 1px solid var(--line);
}

.comment-filter-tabs {
  display: flex;
  gap: 27px;
}

.comments-toolbar .tab {
  height: 42px;
  font-size: 13px;
}

.comments-toolbar select {
  font-size: 12px;
  color: #9991a3;
  border: 0;
  background: #fff;
  padding: 6px 0;
  cursor: pointer;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}

.comment-avatar .avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.comment-body {
  min-width: 0;
  flex: 1;
}

.comment-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  line-height: 1.6;
  margin-bottom: 8px;
}

.comment-heading strong {
  font-size: 14px;
  font-weight: 550;
  color: #57505f;
}

.comment-heading time {
  font-size: 12px;
  color: #a9a0b1;
  margin-left: auto;
}

.own-label {
  font-size: 11px;
  color: #8b7dc0;
  padding: 1px 5px;
  background: #f5f1fd;
  border-radius: 4px;
}

.comment-text {
  font-size: 15px;
  line-height: 1.85;
  color: #756c7d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 19px;
  margin-top: 10px;
}

.comment-reply {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 0;
  color: #8a7bb1;
}

.comment-reply svg,
.comment-likes svg {
  width: 14px;
  height: 14px;
}

.comment-likes {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #b0a5b4;
}

.comment-composer {
  margin-top: 15px;
  border: 1px solid #ded7ed;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fdfcff;
}

.reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #a094ae;
}

.reply-context strong {
  font-weight: 500;
  color: #80718f;
}

.reply-context .icon-button {
  height: 24px;
  width: 24px;
}

.reply-context .icon-button svg {
  width: 14px;
  height: 14px;
}

.comment-composer textarea {
  display: block;
  min-height: 76px;
  width: 100%;
  border: 0;
  background: transparent;
  resize: vertical;
  font-size: 14px;
  padding: 9px 0;
  outline-offset: 1px;
}

.comment-composer textarea::placeholder {
  color: #b4a9be;
}

.comment-composer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  padding-top: 7px;
}

.comment-composer-actions .button {
  font-size: 12px;
}

.comment-replies {
  margin-top: 17px;
  border-left: 1px solid #ece6f3;
  padding-left: 18px;
}

.comment-replies .comment-item {
  padding: 15px 0;
  border-bottom: 0;
}

.comment-replies .avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.comment-replies .comment-heading time {
  font-size: 12px;
}

.comment-replies .comment-text {
  font-size: 14px;
}

.comments-stream>.comment-item:last-child {
  border-bottom: 0;
}

.comments-stream {
  display: grid;
  gap: 12px;
}

.comments-stream>.comment-item {
  padding: 17px;
  border: 1px solid #e5e3ed;
  border-radius: 10px;
  background: #fff;
}

.comments-stream>.comment-item:last-child {
  border-bottom: 1px solid #e5e3ed;
}

.comments-stream>.selected-comment {
  border-color: #9d8fe5;
  box-shadow: 0 0 0 2px #eeeaff;
}

.comments-stream .comment-heading strong {
  color: #34313e;
  font-weight: 600;
}

.comments-stream .comment-text {
  color: #45414f;
  line-height: 1.65;
  margin: 0;
}

.comments-stream .comment-heading time {
  color: #77717f;
}

.comments-stream .comment-reply {
  font-size: 13px;
  color: #6350b0;
}

.comments-stream .comment-replies {
  margin-top: 12px;
}

.comment-replies>summary {
  cursor: pointer;
  padding: 5px 0;
  color: #625779;
  font-size: 13px;
}

.comment-replies .own-comment {
  background: #f6f4fc;
  border-radius: 7px;
  padding: 12px;
  margin-top: 8px;
}

.comments-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding-top: 6px;
}

.comment-filter-tabs {
  gap: 18px;
  flex-wrap: wrap;
}

.post-context-content>p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media(max-width:1150px) {
  .comments-page .conversation-list {
    width: 290px;
  }

  .comments-scroll {
    padding: 20px 24px 30px;
  }

  .post-row-meta {
    flex-wrap: wrap;
    gap: 5px 12px;
  }

  .comment-heading time {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media(max-width:650px) {
  .comments-page .conversation-list {
    width: 100%;
  }

  .comments-header {
    padding: 10px 17px;
    height: 58px;
  }

  .comments-scroll {
    padding: 16px 18px 25px;
  }

  .post-context {
    padding: 13px;
  }

  .post-context-head {
    gap: 7px;
  }

  .post-context-head>span:last-child {
    margin-left: 0;
  }

  .comment-item {
    gap: 9px;
  }

  .comment-replies {
    padding-left: 10px;
    margin-left: -22px;
  }

  .comment-composer-actions .button {
    padding: 7px 10px;
  }

  .media-image {
    max-height: 260px;
  }
}

/* Draft editor */
dialog.design-dialog {
  width: min(1080px, 95vw);
}

.design-dialog .modal-body>p:empty {
  display: none;
}

.design-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
}

.design-preview {
  align-self: start;
  padding: 14px;
  border-radius: 12px;
  background: #f4f3f7;
}

.design-preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}

.design-preview-label span {
  color: #716a7c;
  font-variant-numeric: tabular-nums;
}

#draft-artboard {
  overflow: hidden;
  background: #172421;
  aspect-ratio: 1;
}

#draft-artboard canvas {
  display: block;
  width: 100%;
  height: auto;
}

#draft-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-size: 13px;
}

.design-controls {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.design-controls .form-field {
  margin: 0;
  min-width: 0;
}

.design-controls .button {
  justify-self: start;
}

.design-assets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.design-assets input {
  width: 100%;
  min-width: 0;
}

@media(max-width:740px) {
  .design-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .design-dialog .modal-body {
    padding: 16px;
  }
}

.design-layer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.design-layer-tools .button {
  font-size: 12px;
}

.design-layer-tools .button[aria-pressed="true"] {
  border-color: #6f64e7;
  color: #5146ba;
}

.design-photo-tools {
  border: 1px solid #e9e6ef;
  border-radius: 8px;
  padding: 10px 12px;
}

.design-photo-tools summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.design-photo-tools fieldset {
  border: 0;
  min-width: 0;
  padding: 10px 0 0;
  margin: 0;
}

.design-photo-tools fieldset:disabled {
  opacity: .55;
}

/* Application workspaces */
.sidebar {
  background: #f8f8fc;
  border-right: 1px solid #eeedf3;
}

.sidebar nav {
  margin-top: 24px;
}

.nav-group+.nav-group {
  margin-top: 16px;
}

.nav-group-label {
  display: block;
  margin: 0 10px 5px;
  font-size: 11px;
  font-weight: 650;
  color: #716c80;
}

.nav-item {
  min-height: 39px;
  padding: 8px 10px;
  gap: 9px;
  border-radius: 8px;
}

.nav-item.active {
  background: #eae7ff;
  color: #493bb4;
  font-weight: 650;
}

.global-search[hidden] {
  display: none;
}

.top-actions {
  margin-left: auto;
}

.list-status-tabs {
  display: flex;
  gap: 4px;
  padding: 0 10px 10px;
}

.list-status-tabs .tab {
  flex: 1;
  min-width: 0;
  padding: 5px 4px;
  white-space: nowrap;
}

.chat-tab-items strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.knowledge-filters .tab.active,
.list-status-tabs .tab.active {
  background: #eeebff;
  color: #493bb4;
  border-radius: 7px;
}

.competitor-manage {
  margin: 12px 0 0;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.competitor-manage summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.competitor-manage .button {
  width: 100%;
}

.post-layout,
.connections-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.post-layout .panel,
.connections-layout .panel {
  margin: 0;
  min-width: 0;
}

.post-layout .panel h2 {
  margin: 0 0 16px;
}

.post-media-preview {
  position: sticky;
  top: 14px;
}

#post-preview:empty::after {
  content: 'Chọn ảnh hoặc video để xem trước.';
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 16px;
  border: 1px dashed #ddd9ea;
  border-radius: 8px;
  color: #716c80;
  text-align: center;
}

.connections-layout> :nth-child(n+3) {
  grid-column: 1/-1;
}

#settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  max-width: 1050px;
  align-items: start;
}

#settings-form .panel {
  margin: 0;
}

.settings-ai {
  grid-area: 1/1/span 2/2;
}

.settings-retention {
  grid-area: 1/2/2/3;
}

#settings-form .settings-save {
  grid-column: 1/-1;
}

@media(max-width:900px) {
  .nav-group-label {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }
}

@media(max-width:740px) {

  .post-layout,
  .connections-layout,
  #settings-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-ai,
  .settings-retention {
    grid-area: auto;
  }

  .post-media-preview {
    position: static;
  }
}

@media(max-width:600px) {
  .sidebar nav {
    margin-top: 0;
    gap: 2px;
  }

  .nav-group {
    display: contents;
  }

  .nav-item {
    width: auto;
    flex: 1;
    max-width: 54px;
  }
}

@media(min-width:801px) and (max-width:900px) {
  .nav-group-label {
    display: block;
  }

  .nav-item {
    justify-content: flex-start;
  }
}

@media(max-width:650px) {
  .sidebar nav {
    margin: 0;
  }

  .nav-group {
    display: contents;
  }

  .nav-item {
    flex: 1;
    width: auto;
  }
}

/* SaaS content studio */
:root {
  --primary: #6554dc;
  --primary-hover: #5341c6;
  --ink: #282b3b;
  --muted: #787d90;
  --line: #e9eaf1;
}

.content-page {
  background: #f7f8fc;
}

.page-heading {
  padding: 30px 34px 24px;
}

.page-heading h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.7px;
}

.content-inner {
  padding: 0 34px 36px;
  max-width: 1600px;
}

.panel {
  border: 1px solid #e6e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 12px #20244003;
}

.button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 550;
}

.button.primary {
  box-shadow: 0 3px 8px #6554dc1c;
}

input:not([type=range]):not([type=checkbox]):not([type=radio]),
select,
textarea {
  border-color: #dfe2ed;
  border-radius: 8px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #a99df64d;
  outline-offset: 1px;
}

.global-search input:not([type=range]):not([type=checkbox]):not([type=radio]) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none
}

.global-search:focus-within {
  border-color: #a99df6;
  box-shadow: 0 0 0 2px #a99df624
}

.composer textarea,
.comment-composer textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none
}

.composer textarea:focus,
.comment-composer textarea:focus {
  outline: 0
}

.composer:focus-within,
.comment-composer:focus-within {
  border-color: #a99df6
}

input[type=file]::file-selector-button {
  border: 0;
  border-radius: 5px;
  background: #f0eefb;
  padding: 6px 10px;
  color: #5648a5;
  margin-right: 10px;
  cursor: pointer;
}

.post-layout {
  grid-template-columns: minmax(320px, 1fr) minmax(300px, .95fr);
  gap: 24px;
}

.post-fields {
  padding: 26px;
}

.post-fields h2,
.post-media-preview h2 {
  font-size: 15px;
  font-weight: 650;
}

.post-fields #post-content {
  min-height: 210px;
  resize: vertical;
  line-height: 1.8;
}

.post-caption-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.post-caption-heading label {
  margin: 0;
}

.post-caption-heading .icon-button {
  color: var(--primary);
  background: #f0edff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.post-caption-heading .icon-button[aria-expanded="true"] {
  background: #e5dfff;
}

.post-caption-assistant {
  padding: 13px;
  margin: 0 0 12px;
  border: 1px solid #e4dff8;
  border-radius: 10px;
  background: #faf9ff;
}

.post-caption-assistant[hidden] {
  display: none;
}

.post-caption-assistant label {
  font-size: 12px;
  margin-bottom: 7px;
}

.post-caption-assistant textarea {
  width: 100%;
  min-height: 86px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.post-caption-ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.post-caption-ai-actions [role="status"] {
  flex: 1 1 160px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.post-caption-ai-actions .button {
  min-height: 34px;
  font-size: 12px;
  white-space: nowrap;
}

.post-caption-ai-actions svg {
  width: 15px;
  height: 15px;
}

.post-fields .settings-save {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.post-fields #publish-post {
  min-width: 130px;
}

.post-media-preview {
  padding: 24px;
}

#post-preview:empty::after {
  min-height: 300px;
  border-radius: 10px;
  background: #fafbfe;
  color: #8a8fa0;
}

#post-preview .media-image {
  max-height: 560px;
  object-fit: contain;
  border-radius: 10px;
}

.competitor-layout {
  display: block;
}

.competitor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0
}

.competitor-toolbar-left select {
  width: 210px;
  max-width: 100%;
  min-height: 34px;
  font-size: 12px
}

.competitor-toolbar-left .competitor-window {
  font-size: 11px;
  color: #8a8fa0;
  margin: 0;
  white-space: nowrap
}

dialog.competitor-channels-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: 80vh;
  padding: 22px;
  border: 1px solid #e7e7ef;
  border-radius: 12px;
  background: #fff;
  color: #1e2433
}

.competitor-channels-dialog::backdrop {
  background: #17152b38
}

.competitor-channels-dialog>header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px
}

.competitor-channels-dialog h2 {
  font-size: 16px;
  font-weight: 550;
  margin: 0
}

.competitor-manage-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px
}

.competitor-channels-dialog .competitor-channel-row {
  padding: 5px 0
}

.competitor-scan-row { border-top: 1px solid var(--line); padding: 6px 0; }
.competitor-scan-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; }
.competitor-scan-actions .text-button { white-space: nowrap; }
.competitor-scan-status { margin: 0 0 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.competitor-scan-status:empty, #competitor-refresh-warning[hidden] { display: none; }
@media (max-width: 550px) {
  .competitor-scan-row .competitor-channel-row { flex-wrap: wrap; }
}

.competitor-warning-count {
  font-size: 10px;
  color: #a16d30;
  background: #fff3dd;
  padding: 1px 5px;
  border-radius: 4px
}

@media(max-width:850px) {
  .competitor-toolbar-left {
    gap: 8px
  }

  .competitor-toolbar-left select {
    width: 160px
  }

  .competitor-toolbar-left .competitor-window {
    display: none
  }

  .competitor-feed-heading {
    flex-wrap: wrap
  }
}

.competitor-sources {
  background: #fff;
  border-color: #e6e8f0;
  border-radius: 12px;
  padding: 12px;
}

.competitor-sources h2 {
  font-size: 13px;
  color: #71768a;
  padding-bottom: 16px;
}

.competitor-channel {
  padding: 11px;
  margin-bottom: 4px;
}

.competitor-channel>span {
  font-size: 13px;
}

.competitor-channel small {
  font-size: 11px;
}

.competitor-feed {
  border: 0;
  background: transparent;
}

.competitor-feed-heading {
  padding: 2px 0 18px;
}

.competitor-feed-heading h2 {
  font-size: 16px;
}

.competitor-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.competitor-post {
  border: 1px solid #e4e7f0;
  border-radius: 12px;
  background: #fff;
  padding: 18px;
  min-width: 0;
  box-shadow: 0 3px 10px #20244003;
}

.competitor-post-meta {
  gap: 6px;
}

.competitor-post-meta strong {
  font-size: 13px;
}

.competitor-post time {
  flex-basis: 100%;
  margin: 0;
  font-size: 11px;
}

.competitor-post p {
  font-size: 13px;
  line-height: 1.75;
  max-height: 165px;
  overflow: auto;
}

.competitor-images img {
  max-height: 300px;
}

.competitor-post-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid #eff0f5;
}

.competitor-post-actions .button {
  font-size: 12px;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

dialog.design-dialog {
  width: min(1320px, 96vw);
  max-height: 94dvh;
  border-radius: 16px;
  background: #f6f7fb;
}

.design-dialog .modal-body {
  padding: 0;
}

.design-dialog .modal-header {
  padding: 18px 24px;
  margin: 0;
  border-bottom: 1px solid #e3e5ee;
  background: #fff;
}

.design-dialog .modal-header h2 {
  font-size: 18px;
  font-weight: 650;
}

.design-workspace {
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 0;
}

.design-preview {
  padding: 24px;
  border-radius: 0;
  background: #eef0f6;
  position: sticky;
  top: 0;
}

.design-preview-label {
  margin-bottom: 18px;
  color: #60677c;
}

.design-preview-label strong {
  color: #34394d;
}

#draft-artboard {
  max-width: 660px;
  margin: auto;
  box-shadow: 0 8px 30px #1720361c;
  border-radius: 3px;
}

.design-controls {
  padding: 18px;
  gap: 14px;
  background: #f9fafd;
  border-left: 1px solid #e3e5ee;
}

.draft-control-section {
  background: #fff;
  border: 1px solid #e4e7f0;
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.draft-control-section h3,
.draft-control-section summary {
  font-size: 13px;
  font-weight: 650;
  color: #34394d;
  cursor: pointer;
}

.draft-control-section:not([open]) {
  display: block;
}

.draft-section-body {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.design-controls .form-field label {
  font-size: 12px;
  font-weight: 550;
}

.design-controls textarea {
  font-size: 13px;
  line-height: 1.7;
}

#draft-generate {
  width: 100%;
  justify-content: center;
  color: #5d4ac8;
  background: #f0edff;
  border-color: #d9d2ff;
}

.design-layer-tools {
  justify-content: center;
  margin-top: 16px;
}

.design-layer-tools .button {
  background: #fff;
  border-color: #dfe2ed;
}

.design-controls .design-layer-tools {
  justify-content: flex-start;
}

.draft-submit {
  position: sticky;
  bottom: -18px;
  padding: 14px 0;
  background: #f9fafd;
  border-top: 1px solid #e3e5ee;
}

.draft-submit .button {
  width: 100%;
  justify-content: center;
}

.design-photo-tools fieldset {
  padding-top: 14px;
}

@media(min-width:1600px) {
  .competitor-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media(max-width:1150px) {
  .competitor-post-grid {
    grid-template-columns: 1fr;
  }

  .design-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

@media(max-width:850px) {
  .post-layout {
    grid-template-columns: 1fr;
  }

  .design-workspace {
    grid-template-columns: 1fr;
  }

  .design-preview {
    position: static;
  }

  .design-controls {
    border-left: 0;
  }
}

@media(max-width:740px) {
  .competitor-layout {
    grid-template-columns: 1fr;
  }

  .competitor-sources {
    position: static;
  }

  .page-heading {
    padding: 24px 20px;
  }

  .content-inner {
    padding: 0 20px 28px;
  }
}

/* Focused draft editor */
.design-dialog .design-workspace {
  height: min(790px, calc(94dvh - 73px));
  min-height: 420px;
}

.design-dialog .design-preview {
  position: static;
  min-height: 0;
  overflow: auto;
}

.design-dialog #draft-artboard {
  width: min(100%, calc(94dvh - 245px));
}

.design-dialog .design-controls {
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.draft-editor-tabs {
  display: flex;
  flex: none;
  padding: 12px 16px 0;
  background: #fff;
  border-bottom: 1px solid #e3e5ee;
  gap: 6px;
}

.draft-editor-tabs button {
  flex: 1;
  min-height: 42px;
  color: #777d90;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
}

.draft-editor-tabs button[aria-selected="true"] {
  color: #604bcc;
  border-color: #705bdf;
}

.draft-editor-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.draft-editor-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.draft-editor-panel[hidden] {
  display: none;
}

.draft-editor-panel .draft-control-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.draft-editor-panel #draft-caption {
  min-height: 220px;
}

.design-dialog .design-preview {
  padding: 20px;
  background: #f3f3f7;
}

.design-dialog .design-preview-label {
  font-size: 12px;
  margin-bottom: 12px;
}

.design-dialog .design-preview-label strong {
  font-weight: 500;
}

.design-dialog .draft-editor-scroll {
  padding: 18px 20px;
}

.design-dialog .design-controls label {
  font-size: 13px;
  color: #454351;
}

.design-dialog .design-controls textarea {
  font-size: 14px;
  line-height: 1.6;
}

.design-dialog .design-layer-tools {
  margin-top: 12px;
  gap: 6px;
}

.design-dialog .design-layer-tools .button {
  padding: 7px 12px;
  font-size: 12px;
}

.design-dialog .draft-submit {
  padding: 12px 20px;
}

.design-dialog .draft-editor-panel {
  gap: 14px;
}

.design-dialog .draft-editor-panel .form-field {
  margin-bottom: 12px;
}

.design-dialog .draft-editor-panel #draft-caption {
  min-height: 180px;
}

.design-dialog .draft-editor-panel .draft-export {
  border: 0;
  padding: 0;
}

.design-dialog .draft-product-options {
  padding-top: 12px;
}

.design-dialog .draft-product-options summary {
  font-size: 13px;
  color: #53505f;
}

.design-dialog .draft-product-options .design-assets {
  gap: 10px;
}

.design-dialog .draft-editor-panel>.design-assets {
  grid-template-columns: 1fr;
  gap: 10px;
}

.design-dialog .draft-editor-panel input[type="file"] {
  font-size: 12px;
  padding: 9px;
}

.draft-colors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-colors button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ccc9d5;
}

.draft-colors button[aria-pressed="true"] {
  outline: 2px solid #7762df;
  outline-offset: 2px;
}

.draft-colors input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
}

.design-dialog .draft-editor-panel .draft-background-field {
  margin-bottom: 4px;
}

.draft-editor-panel .design-assets {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.draft-editor-panel .draft-control-section:not([open]) {
  display: block;
}

.draft-editor-panel .draft-export {
  border-top: 1px solid #e4e7f0;
  padding-top: 18px;
}

.draft-product-options {
  border-top: 1px solid #e4e7f0;
  padding-top: 14px;
}

.draft-product-options summary {
  cursor: pointer;
  color: #777d90;
  font-size: 12px;
}

.draft-product-options .form-field {
  margin-top: 12px;
}

.design-controls .draft-submit {
  position: static;
  flex: none;
  bottom: auto;
  padding: 16px 20px;
  margin: 0;
  background: #fff;
}

@media(max-width:850px) {
  .design-dialog .design-workspace {
    height: auto;
    min-height: 0;
  }

  .design-dialog #draft-artboard {
    width: min(100%, 420px);
  }

  .draft-editor-scroll {
    max-height: 480px;
  }

  .design-dialog .design-controls {
    overflow: visible;
  }
}

/* Competitor reading feed */
.competitor-post-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 780px;
  margin-inline: auto;
}

.competitor-post-grid .competitor-post {
  width: 100%;
  padding: 22px;
  box-shadow: 0 2px 7px #20244003;
}

.competitor-feed-heading {
  max-width: 780px;
  margin-inline: auto;
}

.competitor-post-meta {
  align-items: center;
}

.competitor-post-meta strong {
  font-size: 14px;
}

.competitor-post time {
  font-size: 12px;
}

.competitor-post p {
  max-height: none;
  overflow: visible;
  font-size: 14px;
  line-height: 1.8;
}

.competitor-caption p {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.competitor-caption.expanded p {
  display: block;
  overflow: visible;
}

.competitor-expand {
  padding: 0 0 8px;
  font-size: 12px;
}

.competitor-images {
  gap: 10px;
  margin: 16px 0;
}

.competitor-images img {
  max-height: 490px;
  background: #f6f7fa;
}

.competitor-images[data-multiple="true"] img {
  aspect-ratio: 1;
  object-fit: contain;
}

.competitor-post-actions {
  justify-content: space-between;
  align-items: center;
}

.competitor-post-actions .button {
  flex: 0 1 auto;
  min-width: 130px;
  font-size: 13px;
  padding-inline: 18px;
}

.competitor-post-actions .primary {
  margin-left: auto;
}

.competitor-missing-content {
  padding: 16px;
  border-radius: 8px;
  background: #f7f8fb;
  color: #858b9d;
}

@media(max-width:650px) {
  .competitor-post-grid .competitor-post {
    padding: 16px;
  }

  .competitor-post-actions .button {
    flex: 1;
    min-width: 0;
    padding-inline: 10px;
  }
}

.design-dialog #draft-artboard {
  aspect-ratio: auto;
}

.design-dialog #draft-artboard canvas {
  height: auto;
}

.competitor-view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.competitor-view-controls select {
  padding: 6px 9px;
  width: auto;
  font-size: 12px;
}

.competitor-view-controls .button {
  font-size: 12px;
  min-height: 32px;
}

.compact-feed .competitor-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  align-items: stretch;
}

.compact-feed .competitor-feed-heading {
  max-width: none;
}

.compact-feed .competitor-post {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.compact-feed .competitor-caption p {
  -webkit-line-clamp: 3;
  font-size: 13px;
}

.compact-feed .competitor-caption.expanded p {
  display: block;
}

.compact-feed .competitor-images {
  display: flex;
  overflow: auto;
}

.compact-feed .competitor-images button {
  flex: 0 0 100%;
}

.compact-feed .competitor-images img {
  height: 230px;
  max-height: 230px;
  aspect-ratio: auto;
  object-fit: contain;
}

.compact-feed .competitor-post-actions {
  margin-top: auto;
}

.compact-feed .competitor-caption,
.compact-feed .competitor-missing-content {
  min-height: 76px;
}

.compact-feed .competitor-expand {
  padding-bottom: 0;
}

.compact-feed .media-image {
  max-height: 230px;
}

@media(min-width:1700px) {
  .compact-feed .competitor-post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media(max-width:740px) {
  .competitor-feed-heading {
    flex-wrap: wrap;
  }

  .compact-feed .competitor-post-grid {
    grid-template-columns: 1fr;
  }
}

.competitor-channel-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.competitor-channel-row .competitor-channel {
  flex: 1;
  min-width: 0;
}

.competitor-remove {
  flex-shrink: 0;
  width: 28px;
  height: 30px;
}

.competitor-remove:hover {
  color: #b44747;
  background: #fff0f0;
}

.competitor-page>.content-inner {
  max-width: none;
  padding: 0 28px 36px
}

.competitor-page>.page-heading {
  padding-left: 28px;
  padding-right: 28px
}

.competitor-page .compact-feed .competitor-post-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 20px;
  align-items: start
}

.competitor-page .compact-feed .competitor-post {
  padding: 20px
}

.competitor-page .competitor-post-meta strong {
  font-size: 15px;
  line-height: 1.5
}

.competitor-page .competitor-post time {
  font-size: 12px;
  color: #767184
}

.competitor-page .compact-feed .competitor-caption {
  min-height: 0
}

.competitor-page .compact-feed .competitor-caption p {
  font-size: 14px;
  line-height: 1.8;
  -webkit-line-clamp: 5
}

.competitor-page .compact-feed .competitor-images img {
  height: 310px;
  max-height: 310px
}

.competitor-page .compact-feed .media-image {
  width: 100%;
  height: 310px;
  max-height: 310px;
  object-fit: contain;
  background: #151519;
  border-radius: 8px
}

.competitor-page .competitor-feed-heading {
  padding-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap
}

.competitor-more {
  display: flex;
  justify-content: center;
  padding: 24px 0
}

@media(max-width:740px) {
  .competitor-page>.content-inner {
    padding: 0 16px 24px
  }

  .competitor-page>.page-heading {
    padding-left: 16px;
    padding-right: 16px
  }

  .competitor-page .compact-feed .competitor-post {
    padding: 16px
  }

  .competitor-page .compact-feed .competitor-images img,
  .competitor-page .compact-feed .media-image {
    height: 280px;
    max-height: 280px
  }
}

.draft-recreate {
  border: 1px solid #d8dce6;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.draft-recreate summary {
  cursor: pointer;
  font-weight: 600;
}

.draft-recreate p,
.draft-recreate small {
  font-size: 12px;
  line-height: 1.55;
}

.draft-recreate small {
  display: block;
  color: #626879;
  margin: 10px 0;
}

.draft-recreate .form-field {
  margin-top: 12px;
}

.draft-recreate>.button {
  margin-top: 10px;
}

.draft-mask-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
  background: #e6e9ed;
  margin: 12px 0;
}

.draft-mask-canvas:focus-visible {
  outline: 2px solid #7774fa;
  outline-offset: 3px;
}

.draft-generated-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 6px;
  margin: 10px 0;
}

/* Compact image editor */
dialog.design-dialog {
  width: min(1120px, 96vw);
  border-radius: 12px;
}

.design-dialog .modal-header {
  padding: 16px 20px;
}

.design-dialog .modal-header h2 {
  font-size: 16px;
  font-weight: 550;
}

.design-dialog .design-workspace {
  grid-template-columns: minmax(0, 1fr) 340px;
  height: min(760px, calc(94dvh - 65px));
  min-height: 0;
}

.design-dialog .design-preview {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
}

.design-dialog .design-preview-label {
  margin: 0;
}

.draft-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.design-dialog #draft-artboard {
  flex: none;
  max-height: none;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}

.design-dialog .design-preview>.design-layer-tools {
  justify-content: center;
  margin: 0;
  gap: 6px;
}

.design-dialog #draft-status {
  margin: 0;
  min-height: 0;
  text-align: center;
  font-size: 12px;
}

.design-dialog #draft-status:empty {
  display: none;
}

.design-dialog .design-controls {
  background: #fff;
  overflow: hidden;
  border-left: 1px solid #e3e5ee;
}

.design-dialog .draft-editor-tabs {
  padding: 0 16px;
  gap: 0;
}

.design-dialog .draft-editor-tabs button {
  min-height: 48px;
  font-size: 12px;
  font-weight: 500;
}

.design-dialog .draft-editor-scroll {
  padding: 20px;
  max-height: none;
}

.design-dialog .draft-editor-panel {
  gap: 16px;
}

.design-dialog .draft-submit {
  padding: 16px 20px;
  border-top: 1px solid #ececf1;
}

.design-dialog .draft-submit .button {
  min-height: 38px;
  box-shadow: none;
}

.draft-recreate {
  border: 0;
  padding: 0;
  margin: 0;
}

.draft-recreate [hidden] {
  display: none !important;
}

.image-prompt-box {
  border: 1px solid #e0e0e9;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.image-prompt-box:focus-within {
  border-color: #9389d8;
  box-shadow: 0 0 0 2px #7774fa0c;
}

.design-dialog .image-ai-settings textarea {
  min-height: 68px;
}

.image-ai-settings>.form-field {
  margin-top: 12px;
}

.image-quick-prompts {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
}

.image-quick-prompts button {
  flex: 1;
  min-height: 28px;
  padding: 4px 5px;
  border: 1px solid #e9e8ef;
  border-radius: 5px;
  color: #777482;
  font-size: 10px;
  white-space: nowrap;
}

.image-quick-prompts button[aria-pressed="true"] {
  color: #6554cb;
  background: #f2f0ff;
  border-color: #cec6f4;
}

.image-prompt-box select {
  width: 100%;
  margin-bottom: 12px;
  padding: 7px 8px;
  border: 1px solid #e3e3eb;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
}

.draft-recreate .image-ai-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.draft-recreate .image-ai-actions>.button {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none;
}

.draft-recreate [data-recreate="status"] {
  margin: 10px 0 0;
  color: #777785;
}

.draft-recreate [data-recreate="status"]:empty {
  display: none;
}

.draft-recreate [data-recreate="result"] {
  margin-top: 16px;
}

.draft-recreate [data-recreate="result"] .button {
  width: 100%;
  justify-content: center;
}

.image-ai-settings {
  margin-top: 16px;
}

.image-ai-settings>summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  color: #82818d;
}

.image-ai-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.image-ai-options>label:first-child {
  display: grid;
  gap: 6px;
}

.image-ai-options select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e3e3eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.image-reference-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px !important;
}

.image-subject-tools {
  margin: 16px 0;
  padding: 12px 0;
  border-block: 1px solid #ececf1;
}

.image-subject-tools summary {
  font-size: 12px;
  font-weight: 400;
  color: #777d90;
}

.image-subject-tools .check-row {
  margin-top: 12px;
}

.image-subject-tools .form-field {
  display: block;
  margin-top: 12px;
}

.image-connection-state {
  color: #777d90;
  font-size: 11px;
}

.image-ai-advanced summary {
  cursor: pointer;
  font-size: 12px;
  color: #777d90;
}

.image-ai-advanced .form-field {
  margin-top: 14px;
}

.settings-image-ai>p {
  color: #777d90;
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.settings-image-ai a {
  color: #6655c5;
}

@media(min-width:651px) and (max-width:850px) {
  .design-dialog .design-workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .design-dialog .design-preview {
    padding: 16px;
    gap: 12px;
  }

  .design-dialog .draft-editor-scroll {
    padding: 16px;
  }

  .design-dialog .draft-submit {
    padding: 16px;
  }
}

@media(max-width:650px) {
  .design-dialog .design-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 35%) minmax(0, 1fr);
  }

  .design-dialog .design-preview {
    padding: 10px 16px;
    gap: 6px;
  }

  .design-dialog .design-preview>.design-layer-tools {
    display: none;
  }

  .design-dialog .design-controls {
    border-left: 0;
    border-top: 1px solid #e3e5ee;
  }

  .design-dialog .draft-editor-scroll {
    padding: 16px;
  }
}

.post-targets {
  border: 0;
  padding: 0;
  min-width: 0;
}

.post-targets legend {
  margin-bottom: 8px;
}

.post-targets .check-row {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.post-targets .check-row input {
  width: auto;
  margin: 0;
}

.post-result-row {
  display: block;
  margin-top: 6px;
}

.post-layout {
  gap: 14px;
  max-width: 1120px;
  margin-inline: auto;
}

.post-layout .post-fields,
.post-layout .post-media-preview {
  padding: 18px;
}

.post-fields .form-field {
  margin-bottom: 12px;
}

.post-fields #post-content {
  min-height: 118px;
  line-height: 1.55;
}

.post-targets {
  position: relative;
}

.post-target-picker>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.post-target-picker>summary::-webkit-details-marker {
  display: none;
}

#post-target-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-target-popover {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px #211b4020;
  padding: 12px;
}

.post-target-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.post-target-filters input,
.post-target-filters select {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.post-target-list {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
}

.post-target-list .check-row {
  padding: 8px;
  border-radius: 6px;
}

.post-target-list .check-row:hover {
  background: #f7f6fb;
}

.post-target-list .check-row[hidden] {
  display: none;
}

.post-target-list .check-row>span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.post-target-list .check-row>span>span {
  overflow-wrap: anywhere;
}

.post-target-list small {
  display: block;
  color: #777482;
  margin-top: 2px;
  font-size: 11px;
}

.post-target-list .ui-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.post-target-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

@media(max-width:600px) {
  .post-target-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

#post-tiktok {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#post-tiktok .check-row+.check-row {
  margin-top: 6px;
}

.post-media-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post-media-toolbar input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}

.post-media-toolbar input::file-selector-button {
  margin-right: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: #eeecfa;
  color: #5546af;
  cursor: pointer;
}

.post-media-toolbar button {
  flex: none;
}

#post-preview:empty::after {
  min-height: 140px;
  content: 'Chưa chọn ảnh hoặc video';
  font-size: 12px;
}

#post-preview .media-image {
  max-height: 380px;
}

.post-publish-bar {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.post-publish-bar #post-result {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.post-publish-bar button {
  flex: none;
}

.auto-comments-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.auto-comments-toolbar>span {
  margin-inline-end: auto;
  font-size: 12px;
  color: #777482;
}

.auto-comments-toolbar select {
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #e4e3eb;
  border-radius: 6px;
  background: #fff;
}

.auto-comments-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.auto-comments-entry:last-child {
  border-bottom: 0;
}

.auto-comments-entry header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #777482;
}

.auto-comments-entry header strong {
  color: var(--ink);
}

.auto-comments-entry header time {
  margin-inline-start: auto;
}

.auto-comment-status {
  background: #f1effa;
  color: #5847a5;
  padding: 2px 6px;
  border-radius: 4px;
}

.auto-comments-entry p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}

.auto-comments-reply {
  display: flex;
  gap: 8px;
  align-items: baseline;
  background: #f8f7fc;
  border-radius: 6px;
  padding: 0 10px;
}

.auto-comments-reply strong {
  font-size: 11px;
}

#auto-comments-entries>p {
  margin-top: 14px;
}

/* News: one input row, compact sources and a single article list. */
.news-page .page-heading {
  max-width: 1040px;
  margin: 0 auto 22px;
}

.news-layout {
  display: grid;
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.news-refresh {
  color: var(--muted);
}

.news-form {
  display: grid;
  gap: 8px;
}

.news-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.news-add-row input {
  flex: 1;
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
}

.news-add-row input::placeholder {
  color: var(--muted);
}

.news-add-row .button {
  height: 42px;
  min-height: 42px;
  padding: 0 18px;
  box-shadow: none;
  border-radius: 9px;
  font-size: 12px;
  flex-shrink: 0;
}

.news-form-meta {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  color: var(--muted);
}

.news-form-meta>small {
  font-size: 11px;
}

.news-options {
  position: relative;
  font-size: 11px;
}

.news-options summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.news-options summary::-webkit-details-marker {
  display: none;
}

.news-options summary::after {
  content: '⌄';
  margin-left: 5px;
}

.news-options[open] summary {
  color: var(--primary);
}

.news-options>div {
  position: absolute;
  z-index: 5;
  right: 0;
  top: 26px;
  width: 280px;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px #22223010;
  color: var(--ink);
}

.news-options select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

#news-help {
  color: var(--muted);
  font-size: 11px;
}

#news-status {
  font-size: 12px;
  margin-top: 3px;
}

#news-status:empty {
  display: none;
}

.news-sources {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.news-sources>summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 12px;
  color: var(--ink);
}

#news-source-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f4f4f7;
  color: var(--muted);
  font-size: 10px;
}

#news-sources {
  padding: 0 14px;
}

#news-sources:empty {
  padding: 0;
}

.news-source {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.news-source>div:first-child {
  min-width: 0;
}

.news-source strong {
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.news-source small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.news-source-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.news-source-actions .text-button {
  font-size: 11px;
}

.news-source-actions [data-news-remove] {
  color: var(--muted);
}

.news-feed-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.news-feed-heading small {
  font-size: 11px;
}

.news-article {
  position: relative;
  padding: 15px 60px 15px 0;
  border-bottom: 1px solid var(--line);
}

.news-article>small:first-of-type {
  color: var(--muted);
  font-size: 11px;
}

.news-article::after {
  content: '';
  display: block;
  clear: both;
}

.news-thumb {
  float: right;
  width: 76px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 0 8px 12px;
}

.news-article h2 {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.news-article h2 button {
  text-align: left;
  padding: 0;
  font: inherit;
}

.news-article h2 button:hover {
  color: var(--primary);
}

.news-empty {
  padding: 24px 0;
  color: var(--muted);
  font-size: 12px;
}

#news-reader {
  width: min(740px, calc(100vw - 32px));
  max-height: 85vh;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
}

.news-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

#news-reader-close {
  padding: 0 4px;
  font-size: 24px;
  line-height: 1;
}

#news-reader-title {
  margin: 16px 0 20px;
  font-size: 20px;
  line-height: 1.5;
}

#news-reader-body {
  line-height: 1.9;
  overflow-wrap: anywhere;
}

#news-reader-body p {
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.news-reader-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 24px;
}

.news-article p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.news-content-note {
  position: absolute;
  top: 17px;
  right: 0;
  color: var(--muted);
  font-size: 10px;
  background: #f5f5f8;
  border-radius: 4px;
  padding: 1px 6px;
}

.news-article .text-button {
  padding: 7px 0 0;
  font-size: 11px;
}

@media(max-width:650px) {
  .news-form-meta {
    gap: 8px
  }

  .news-form-meta>small {
    max-width: 220px
  }

  .news-source {
    align-items: start;
    flex-direction: column;
    gap: 2px
  }

  .news-source-actions {
    margin-left: -5px
  }

  .news-feed-heading {
    align-items: start
  }

  .news-feed-heading small {
    max-width: 150px;
    text-align: right
  }

  .news-article {
    padding-right: 0
  }

  .news-content-note {
    position: static;
    display: inline-block;
    margin-top: 6px
  }
}

/* Messaging: content-sized bubbles and a composer that stays outside the scroll area. */
.inbox-page:not(.comments-page) .chat {
  min-height: 0;
  background: #fafafd;
}

.inbox-page:not(.comments-page) .chat-tabs {
  min-height: 68px;
  padding: 12px 90px 12px 24px;
  justify-content: flex-start;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.inbox-page:not(.comments-page) .chat-tab-items {
  min-width: 0;
  gap: 11px;
  justify-content: flex-start;
}

.chat-contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-contact strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

.chat-contact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.inbox-page:not(.comments-page) .chat-scroll {
  padding: 24px;
  scroll-padding-bottom: 16px;
}

.inbox-page:not(.comments-page) .message {
  margin: 0 0 14px;
}

.inbox-page:not(.comments-page) .message-sender {
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.inbox-page:not(.comments-page) .message-sender .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.inbox-page:not(.comments-page) .bubble {
  min-width: 64px;
  padding: 10px 13px 7px;
  border-radius: 14px;
  background: #eeeff4;
  color: #36394b;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
}

.inbox-page:not(.comments-page) .message-text {
  white-space: pre-wrap;
}

.inbox-page:not(.comments-page) .bubble time {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  color: #83899a;
}

.inbox-page:not(.comments-page) .message.outgoing .bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.inbox-page:not(.comments-page) .message:not(.outgoing) .bubble {
  border-bottom-left-radius: 4px;
}

.inbox-page:not(.comments-page) .message.outgoing time {
  color: #eeebff;
}

.inbox-page:not(.comments-page) .media-attachments {
  max-width: 320px;
  margin-bottom: 6px;
}

.inbox-page:not(.comments-page) .media-image {
  max-height: 300px;
}

.inbox-page:not(.comments-page) .composer {
  margin: 0 20px 18px;
  min-height: 52px;
  padding: 8px 9px 8px 15px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 14px #27234b06;
  align-items: flex-end;
}

.inbox-page:not(.comments-page) .composer textarea {
  flex: 1 1 0;
  width: auto;
  min-height: 34px;
  max-height: 144px;
  padding: 6px 0;
  line-height: 22px;
  overflow-y: auto;
}

.inbox-page:not(.comments-page) .composer-toolbar {
  flex-shrink: 0;
  gap: 3px;
}

.inbox-page:not(.comments-page) .composer .button {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 11px;
}

.inbox-page:not(.comments-page) .composer .button svg {
  width: 14px;
  height: 14px;
}

.inbox-page:not(.comments-page) .queue-status {
  margin: 8px 24px 0;
}

@media(max-width:650px) {
  .inbox-page:not(.comments-page) .chat-tabs {
    padding: 10px 16px 10px 8px;
    min-height: 62px;
    gap: 6px;
  }

  .inbox-page:not(.comments-page) .chat-scroll {
    padding: 16px 12px;
  }

  .inbox-page:not(.comments-page) .composer {
    margin: 0 10px 10px;
    padding-left: 12px;
    gap: 4px;
  }

  .inbox-page:not(.comments-page) .composer-toolbar .icon-button {
    width: 28px;
  }

  .inbox-page:not(.comments-page) .composer .button {
    padding: 6px 10px;
  }
}

/* AI comment operations */
.comments-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f7f8fc;
}

.comment-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 18px;
  flex-shrink: 0;
}

.comment-ai-header h1 {
  font-size: 23px;
  font-weight: 650;
}

.comment-ai-header p {
  color: #7a8092;
  font-size: 13px;
  margin-top: 4px;
}

.comment-ai-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.comment-workspace-tabs {
  display: flex;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid #e2e5ef;
  background: #fff;
  flex-shrink: 0;
}

.comment-workspace-tabs button {
  padding: 13px 0;
  border-bottom: 2px solid transparent;
  color: #7b8092;
}

.comment-workspace-tabs button[aria-selected="true"] {
  color: #6451ce;
  border-color: #6451ce;
  font-weight: 600;
}

.comments-page .inbox-body {
  flex: 1;
  min-height: 0;
  height: auto;
}

.comments-page.show-ai-activity .inbox-body {
  display: none;
}

#comment-activity {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px 28px;
}

#comment-activity[hidden] {
  display: none;
}

.comment-ai-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.comment-ai-overview button {
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 16px;
  border: 1px solid #e3e6ef;
  background: #fff;
  border-radius: 10px;
}

.comment-ai-overview span {
  font-size: 12px;
  color: #7b8193;
}

.comment-ai-overview strong {
  font-size: 25px;
  font-weight: 650;
}

.comment-ai-overview button[aria-pressed="true"] {
  border-color: #a496ec;
  background: #f3f0ff;
}

.comment-activity-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 14px;
}

.comment-activity-heading h2 {
  font-size: 16px;
}

.comment-activity-heading>span {
  color: #858b9b;
  font-size: 12px;
}

.comment-activity-heading .button {
  margin-left: auto;
}

.comment-activity-list {
  display: grid;
  gap: 12px;
}

.comment-activity-card {
  border: 1px solid #e2e5ee;
  border-radius: 12px;
  background: #fff;
  padding: 18px 20px;
}

.comment-activity-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.comment-activity-card time {
  margin-left: auto;
  color: #858b9b;
  font-size: 12px;
}

.comment-activity-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.comment-activity-content small {
  color: #858b9b;
  font-size: 11px;
}

.comment-activity-content p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.7;
}

.comment-activity-answer {
  border-left: 2px solid #d8d0fb;
  padding-left: 18px;
}

.comment-activity-card footer {
  border-top: 1px solid #f0f1f6;
  padding-top: 10px;
}

@media(max-width:850px) {
  .comment-ai-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-ai-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media(max-width:650px) {

  .comment-ai-header,
  #comment-activity {
    padding: 16px;
  }

  .comment-ai-header p {
    display: none;
  }

  .comment-activity-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .comment-activity-heading>span {
    display: none;
  }

  .comment-ai-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact comment workspace */
.comment-ai-header {
  padding: 16px 24px 10px;
  background: #fff;
  gap: 12px;
}

.comment-ai-header h1 {
  font-size: 21px;
}

.comment-workspace-tabs {
  padding: 0 24px;
  gap: 20px;
}

#comment-activity {
  padding: 16px 24px;
}

.comment-ai-overview {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comment-ai-overview button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 8px;
}

.comment-ai-overview strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.comment-ai-overview span {
  color: #55576b;
}

.comment-activity-heading {
  margin: 16px 0 10px;
  flex-wrap: wrap;
}

.comment-activity-card {
  padding: 13px 16px;
}

.comment-activity-content {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 12px 0;
}

.comment-activity-content .comment-activity-answer {
  background: #f6f4fc;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
}

@media(max-width:650px) {

  .comment-ai-header,
  #comment-activity {
    padding: 12px 16px;
  }

  .comment-workspace-tabs {
    padding: 0 0 0 10px;
  }

  .comment-activity-content {
    grid-template-columns: 1fr;
  }
}

/* Shared workspace surfaces and controls */
:root {
  --primary: #202124;
  --primary-hover: #36373a;
  --ink: #202124;
  --muted: #696b70;
  --line: #e5e5e7;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
}

.app-shell .sidebar {
  background: #fafafa;
  border-color: var(--line);
}

.brand {
  color: #18191b;
  font-weight: 650;
}

.nav-group-label {
  color: var(--muted);
  font-weight: 500;
}

.nav-item {
  color: #46474b;
  border-radius: 6px;
}

.nav-item.active,
.nav-item.active:hover {
  color: white;
  background: #17181a;
}

.nav-item.active svg {
  color: inherit;
}

.topbar {
  background: white;
  border-color: var(--line);
}

.connect-button {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

.connect-button:hover {
  background: #eeeeef;
}

.content-page,
.comments-page {
  background: #fff;
}

.panel,
.content-page .trend-feed,
.comment-activity-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 3px #18181808;
}

.page-heading h1,
.comments-page h1 {
  color: #17181a;
  font-weight: 600;
  letter-spacing: -.035em;
}

.button {
  border-radius: 6px;
}

.button.primary {
  box-shadow: 0 1px 3px #17181a18;
}

.connection-card {
  padding: 14px;
  border: 1px dashed #d8d8da;
  border-radius: 8px;
  margin-top: 8px;
}

.connection-card:last-child {
  padding-bottom: 14px;
}

.post-row.selected,
.comment-activity-content .comment-activity-answer,
.auto-comments-reply,
.comment-replies .own-comment {
  background: #f5f5f6;
}

.trends-page .trend-tabs {
  background: #f3f3f4;
  border-color: var(--line);
}

.trends-page .trend-tabs button[aria-selected=true] {
  color: var(--ink);
}

@media (min-width: 961px) {
  .app-shell .sidebar {
    width: clamp(184px, 16vw, 218px);
    padding-inline: 14px;
  }

  .nav-item {
    min-height: 35px;
  }
}

#workspace-location {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap
}

.topbar .top-actions {
  margin-left: auto
}

.sidebar nav {
  overflow-y: auto;
  min-height: 0
}

.overview {
  display: grid;
  gap: 16px
}

.overview-stats,
.overview-lists {
  display: grid;
  gap: 12px
}

.overview-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.overview-lists {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start
}

.overview-stats button,
.overview-list,
.calendar-shell {
  min-width: 0;
  padding: 16px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px
}

.overview-stats button:hover {
  border-color: #aaa
}

.overview-stats button span,
.overview-list header,
.calendar-shell header {
  display: flex;
  align-items: center;
  gap: 10px
}

.overview-stats svg {
  box-sizing: content-box;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px
}

.overview-stats strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  font-weight: 500
}

.overview-list {
  background: #fafafa;
  min-height: 180px
}

.overview-list header {
  justify-content: space-between;
  margin-bottom: 12px
}

.overview-list div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  margin-top: 5px
}

.overview-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.calendar-shell {
  padding: 0;
  overflow: hidden
}

.calendar-shell header {
  padding: 14px;
  flex-wrap: wrap
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr))
}

.month-grid>b,
.plan-day {
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px
}

.month-grid>b {
  text-align: center;
  background: #fafafa;
  font-size: 12px
}

.plan-day {
  min-height: 95px
}

.plan-day.outside {
  background: #fafafa;
  color: #aaa
}

.day-number {
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: 50%
}

.day-number:hover {
  background: #eee
}

.day-number[aria-current=date] {
  background: #171717;
  color: white
}

.plan-entry {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  border: 1px solid #dedee2;
  border-radius: 5px;
  margin-top: 4px;
  font-size: 12px
}

.connections-layout>.panel:last-child,
.documents-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  align-content: start;
  gap: 10px
}

.connections-layout>.panel:last-child>.panel-heading,
.documents-list>.empty {
  grid-column: 1/-1
}

.connections-layout>.panel:last-child .connection-card {
  flex-direction: column;
  text-align: center;
  justify-content: center;
  min-height: 130px
}

.connections-layout>.panel:last-child .connection-info {
  flex: 0
}

.documents-list .document-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px
}

@media(max-width:740px) {
  #workspace-location {
    display: none
  }

  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .overview-lists {
    grid-template-columns: 1fr
  }

  .plan-day {
    padding: 2px;
    min-height: 60px
  }

  .workspace-page .content-inner {
    padding-inline: 10px
  }
}

.ai-endpoints {
  border-block: 1px solid var(--line);
  padding: 10px 0;
  margin: 12px 0
}

.ai-endpoints summary {
  cursor: pointer;
  font-weight: 550;
  color: #345b81
}

.ai-endpoints[open] summary {
  margin-bottom: 12px
}

.comment-activity-content .comment-activity-answer {
  background: #edf5ff;
  color: #294969
}

#chat .outgoing .bubble {
  background: #e4efff;
  color: #1d406b
}

#chat .outgoing .bubble time {
  color: #516987
}

.documents-list .document-row,
.connections-layout .panel,
.post-layout .panel {
  background: white
}

.competitor-page .compact-feed .competitor-post {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff
}

.workspace-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 18px 0 0;
  padding: 9px;
  background: white;
  border: 1px solid #e6e6e6;
  border-radius: 7px;
  text-align: left;
  font-size: 12px
}

.workspace-switch span {
  display: inline-flex
}

.workspace-switch span:last-child {
  margin-left: auto;
  color: #777
}

.workspace-switch svg {
  width: 14px;
  height: 14px
}

.sidebar .brand {
  color: #181818
}

.overview-list .activity-line {
  display: flex;
  align-items: center;
  gap: 10px
}

.activity-line section {
  min-width: 0
}

.activity-line small {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden
}

.channel-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 940px
}

.channel-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 14px;
  min-height: 180px;
  text-align: center;
  border: 1px dashed #d9d9df;
  border-radius: 8px;
  background: white
}

.channel-tile p {
  color: #696970;
  font-size: 12px;
  overflow-wrap: anywhere
}

.channel-tile .button {
  margin-top: 6px
}

.channel-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #141414;
  color: white
}

.channel-symbol.facebook,
.channel-symbol.zalo {
  background: #1675ee
}

.channel-keys {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  max-width: 940px
}

.channel-keys summary {
  cursor: pointer;
  font-weight: 550
}

.plan-entry {
  padding: 4px 6px;
  background: white;
  box-shadow: 0 1px 3px #00000009
}

.plan-entry b,
.plan-entry span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis
}

.plan-entry svg {
  width: 11px;
  height: 11px;
  vertical-align: middle;
  margin-right: 4px;
  color: #398a70
}

.plan-entry.scheduled-entry {
  border-color: #ead6cc;
  border-left: 2.5px solid #b44318;
  background: #fffaf7
}

.plan-entry.scheduled-entry b {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap
}

.plan-platform-dot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0
}

.plan-platform-dot svg {
  width: 12px;
  height: 12px;
  margin-right: 0
}

.scheduled-entry-clock {
  font-variant-numeric: tabular-nums;
  color: #9a3412;
  flex-shrink: 0
}

.plan-badge,
.overview-plan-badge {
  display: inline-block;
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #b44318;
  background: #faece5;
  flex-shrink: 0
}

.overview-plan-day button.overview-scheduled-btn {
  grid-template-columns: 48px minmax(0, 1fr) auto
}

.calendar-shell header {
  flex-wrap: wrap
}

.calendar-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #626972
}

.calendar-status.is-error {
  color: #b42318
}

.calendar-status .subtle-jump {
  padding: 4px 8px;
  font-size: 12px;
  height: auto
}

.published-view-controls .calendar-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 5px
}

.calendar-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b44318;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1
}

.scheduled-modal-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #faece5;
  color: #b44318;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px
}

.scheduled-modal-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px
}

.scheduled-modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  font-size: 13px
}

.scheduled-modal-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

.scheduled-modal-caption {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 240px;
  overflow: auto;
  font-size: 14px
}

.scheduled-modal-media {
  margin-top: 12px
}

.scheduled-modal-media img,
.scheduled-modal-media video {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block
}

@media(min-width:961px) {
  .app-shell {
    padding: 8px;
    gap: 4px;
    background: #fafafa
  }

  .app-shell .sidebar {
    width: clamp(175px, 16vw, 214px);
    padding: 16px 10px;
    background: #fafafa;
    border: 1px solid #e6e6e6;
    border-radius: 10px
  }

  .main-shell {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden
  }

  .main-shell .topbar {
    height: 50px
  }

  .app-shell {
    --topbar: 50px
  }

  .sidebar .nav-item {
    min-height: 32px;
    padding: 6px 9px
  }

  .sidebar .nav-group-label {
    font-size: 11px;
    font-weight: 400
  }

  .workspace-page>.page-heading {
    padding: 22px 22px 14px
  }

  .workspace-page>.content-inner {
    padding-inline: 22px
  }

  .overview {
    gap: 12px
  }

  .overview-stats,
  .overview-lists {
    gap: 10px
  }
}

@media(max-width:960px) {
  .workspace-switch {
    display: none
  }
}

@media(max-width:650px) {
  .channel-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px
  }
}

.overview-list .activity-title {
  font-weight: 400;
}

.post-fields .editor-heading,
.preview-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line)
}

.preview-heading span {
  display: inline-flex;
  color: #65749a
}

.preview-byline {
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere
}

#preview-caption {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
  margin: 10px 0
}

#preview-caption:empty {
  display: none
}

.post-fields .post-media-toolbar {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin: 14px 0 0
}

.post-fields #post-content {
  min-height: 155px
}

.post-layout .post-media-preview {
  background: #fafafa
}

.post-media-preview #post-preview {
  margin-top: 12px
}

.comment-activity-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: white
}

.comment-activity-list .comment-activity-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 18px
}

.comment-activity-card+.comment-activity-card {
  border-top: 1px solid var(--line)
}

.comment-activity-card header strong {
  font-weight: 500
}

.comment-activity-card .entry-open {
  width: 28px;
  height: 28px
}

.comment-activity-content p {
  font-weight: 400
}

.comment-activity-content .comment-activity-answer {
  color: #30463f;
  background: #f2f7f4
}

@media(max-width:740px) {
  .comment-activity-card .comment-activity-content {
    grid-template-columns: 1fr;
    gap: 9px
  }

  .post-layout .post-media-preview {
    position: static
  }
}

/* Publishing desk */
#post-form {
  max-width: 1240px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px
}

#post-form .post-fields {
  border: 0;
  box-shadow: none;
  padding: 0
}

#post-form .post-caption-heading {
  margin-top: 20px
}

#post-form #post-caption-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 10px;
  background: #f1f1f1;
  color: #353535;
  font-size: 12px
}

#post-form #post-caption-ai[aria-expanded=true] {
  background: #dedede
}

#post-form .post-caption-assistant {
  background: #fafafa;
  border-color: #ddd
}

#post-form #post-content {
  min-height: 205px;
  padding: 16px;
  font-size: 15px;
  border-color: #dadada
}

#post-form .post-media-toolbar {
  padding: 12px 0;
  border: 0
}

#post-form input::file-selector-button {
  background: #ececec;
  color: #333
}

#post-form .post-media-preview {
  border: 1px solid #e6e6e6;
  background: #f7f7f7;
  padding: 18px
}

#post-form .preview-heading {
  border: 0;
  font-size: 13px;
  color: #484848
}

#post-form .preview-heading span {
  color: #555
}

.preview-sheet {
  background: white;
  border: 1px solid #dedede;
  border-radius: 9px;
  overflow: hidden
}

.preview-sheet .preview-byline,
.preview-sheet #preview-caption {
  margin: 14px 16px
}

.preview-sheet #post-preview:empty::after {
  min-height: 155px;
  background: #fafafa;
  border: 0;
  border-top: 1px solid #eee;
  border-radius: 0;
  color: #737373
}

#post-form :is(input, textarea, summary, select):focus-visible {
  outline: 2px solid #777;
  outline-offset: 2px;
  box-shadow: none
}

#post-form .post-target-list .check-row:hover {
  background: #f4f4f4
}

#post-form .post-publish-bar {
  margin-top: 8px
}

#post-form .post-publish-bar button {
  margin-left: auto
}

/* Comment review */
.comments-page .comment-workspace-tabs button[aria-selected=true] {
  border-color: #222;
  color: #171717
}

.comments-page .comment-ai-overview button[aria-pressed=true] {
  background: #292929;
  border-color: #292929;
  color: white
}

.comments-page .comment-ai-overview button[aria-pressed=true] span {
  color: white
}

.comments-page .comment-ai-status {
  background: #efefef;
  color: #515151
}

.comments-page .comment-ai-status[data-state=sent] {
  background: #eaf4ef;
  color: #376452
}

.comments-page .comment-ai-status[data-state=failed] {
  background: #fff0eb;
  color: #994321
}

.comments-page .list-status-tabs .tab.active,
.comments-page .post-row.selected {
  background: #f0f0f0;
  color: #222
}

.comments-page .comment-activity-content .comment-activity-answer {
  background: transparent;
  color: inherit;
  padding: 0
}

.activity-columns {
  display: none
}

@media(min-width:961px) {

  .activity-columns,
  .comment-activity-list .comment-activity-card {
    display: grid;
    grid-template-columns: minmax(150px, .85fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 20px;
    align-items: start;
    padding: 14px 16px
  }

  .activity-columns {
    background: #f6f6f6;
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    color: #646464;
    font-size: 12px;
    padding-block: 9px
  }

  .activity-columns+.comment-activity-list {
    border-radius: 0 0 8px 8px;
    border-top: 0
  }

  .comment-activity-list .comment-activity-content {
    display: contents
  }

  .comment-activity-content small {
    display: none
  }

  .comment-activity-card .comment-activity-content p {
    margin: 0
  }

  .comment-activity-list .comment-activity-card header {
    gap: 5px 8px
  }

  .comment-activity-card header time {
    order: 2;
    flex-basis: 100%;
    margin: 0
  }

  .comment-activity-list .comment-activity-card:hover {
    background: #fafafa
  }
}

@media(max-width:740px) {
  #post-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px
  }
}

.publish-page #post-form {
  max-width: 1120px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px
}

.publish-page #post-form .post-fields {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: white
}

.publish-page #post-form .post-caption-heading {
  margin-top: 14px
}

.caption-editor {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden
}

.caption-editor:focus-within {
  border-color: #888
}

.publish-page #post-form #post-content {
  display: block;
  width: 100%;
  min-height: 160px;
  border: 0;
  border-radius: 0;
  background: white
}

.publish-page #post-form #post-content:focus-visible {
  outline-offset: -3px
}

.publish-page #post-form .post-media-toolbar {
  padding: 8px 10px;
  margin: 0;
  border-top: 1px solid #eee;
  background: #fafafa
}

.publish-page .post-media-toolbar>svg,
.preview-avatar svg {
  width: 15px;
  height: 15px;
  color: #595959
}

.publish-page #post-form .post-media-preview {
  padding: 14px
}

.publish-page #post-form .preview-heading {
  margin: 0 0 12px;
  padding: 0
}

.preview-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px
}

.preview-identity>div {
  min-width: 0
}

.preview-identity .preview-byline {
  margin: 0
}

.preview-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: #f0f0f0
}

#preview-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px
}

.publish-page .preview-sheet #post-preview:empty::after {
  min-height: 88px
}

.publish-page .post-publish-bar {
  padding-bottom: 0
}

@media(max-width:740px) {
  .publish-page #post-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px
  }

  .publish-page #post-form .post-fields {
    padding: 13px
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.knowledge-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar));
  min-width: 0;
  overflow: hidden;
  padding-bottom: 0;
  background: #fff;
}

.knowledge-page>.page-heading,
.knowledge-page>.content-inner {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.knowledge-page>.page-heading {
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  background: #fff;
}

.knowledge-page .knowledge-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  background: var(--workspace-bg);
  overflow: hidden;
}

.knowledge-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}

.knowledge-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.knowledge-summary {
  font-size: 12px;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.knowledge-search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  min-width: 240px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.knowledge-search-box:focus-within {
  border-color: #e03313;
  box-shadow: 0 0 0 2px #e0331318;
}

.knowledge-search-box>span {
  display: flex;
  color: #8c8c96;
}

.knowledge-search-box svg {
  width: 14px;
  height: 14px;
}

.knowledge-search-box input:not([type=range]) {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  flex: 1;
  font-size: 12px;
  box-shadow: none;
  outline: none;
}

.knowledge-search-box .icon-button {
  width: 22px;
  height: 22px;
  padding: 0;
}

.knowledge-page .knowledge-filters {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 0;
  background: #f7f5f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.knowledge-page .knowledge-filters .tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  color: #56565e;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.knowledge-page .knowledge-filters .tab.active {
  background: #e03313;
  color: #fff;
}

.knowledge-filters .tab span {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.knowledge-filters .tab.active span {
  background: rgba(255, 255, 255, .24);
  color: #fff;
}

.knowledge-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: var(--workspace-bg);
  overflow: hidden;
}

.knowledge-list-pane {
  border-right: 1px solid var(--line);
  background: var(--workspace-bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.knowledge-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.knowledge-card-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: background .12s, border-color .12s;
}

.knowledge-card-item:hover {
  background: #f7f5f3;
}

.knowledge-card-item.is-selected {
  background: #fff5f2;
  border-left-color: #e03313;
}

.knowledge-card-item .document-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f7f5f3;
  border: 0;
  color: #555;
  flex-shrink: 0;
}

.knowledge-card-item.is-selected .document-icon {
  background: #fff1ee;
  border: 0;
  color: #e03313;
}

.knowledge-card-item .document-icon svg {
  width: 15px;
  height: 15px;
}

.knowledge-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.knowledge-entry-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.knowledge-entry-preview {
  font-size: 12px;
  color: #666872;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-entry-meta {
  font-size: 11px;
  color: #8b8d97;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.knowledge-detail-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--workspace-bg);
}

.knowledge-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.knowledge-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}

.knowledge-detail-badges,
.knowledge-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.knowledge-kind-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff1ee;
  color: #b42318;
  font-size: 11px;
  font-weight: 600;
}

.knowledge-detail-date {
  font-size: 12px;
  color: #777983;
}

.knowledge-detail-actions .button {
  min-height: 30px;
  padding: 5px 10px;
}

.knowledge-title-field {
  display: block;
  padding: 16px 24px 6px;
}

.knowledge-title-field input:not([type=range]) {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  outline: none;
}

.knowledge-title-field input:not([type=range]):hover {
  background: transparent;
}

.knowledge-title-field input:not([type=range]):focus {
  background: transparent;
  box-shadow: inset 0 -1.5px 0 #e03313;
  outline: none;
}

.knowledge-content-field {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 4px 24px 16px;
}

.knowledge-content-field textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  outline: none;
}

.knowledge-content-field textarea:focus {
  background: transparent;
  border: 0;
  outline: none;
}

.knowledge-detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: #6b7280;
}

.knowledge-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  gap: 8px;
}

.knowledge-detail-empty>span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff1ee;
  color: #e03313;
}

.knowledge-detail-empty p {
  max-width: 360px;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 6px;
}

.knowledge-list>.empty {
  min-height: 180px;
}

@media(max-width:960px) {
  .knowledge-page>.page-heading {
    padding: 12px 18px;
  }

  .knowledge-page .knowledge-workspace {
    padding: 0 18px 18px;
  }

  .knowledge-toolbar {
    padding: 10px 0;
  }

  .knowledge-split {
    grid-template-columns: minmax(230px, 35%) minmax(0, 1fr);
  }

  .knowledge-search-box {
    min-width: 0;
  }
}

#main[data-page=inbox] .conversation-list {
  background: #fafafa;
  border-right: 1px solid var(--line)
}

#main[data-page=inbox] .list-controls {
  padding-inline: 14px;
  gap: 8px
}

#main[data-page=inbox] .list-status-tabs {
  margin: 0 10px 8px;
  background: #eee;
  border-radius: 7px;
  padding: 3px
}

#main[data-page=inbox] .list-status-tabs .tab {
  border: 0;
  color: #565656
}

#main[data-page=inbox] .list-status-tabs .tab.active {
  background: white;
  color: #242424;
  box-shadow: 0 1px 3px #0002
}

#main[data-page=inbox] .conversation {
  border: 1px solid transparent;
  border-radius: 8px;
  width: calc(100% - 16px);
  margin: 3px 8px;
  padding: 10px 9px;
  min-height: 72px;
  gap: 10px
}

#main[data-page=inbox] .conversation.selected {
  background: #eeeeef;
  border-color: #e3e3e4;
  box-shadow: none
}

#main[data-page=inbox] .conversation-title strong {
  color: #252525
}

#main[data-page=inbox] .conversation-channel {
  margin-top: 0
}

#main[data-page=inbox] .channel-name {
  color: #68686d;
  font-size: 11px
}

#main[data-page=inbox] .conversation p {
  margin-top: 2px;
  color: #57575c
}

#main[data-page=inbox] .conversation time {
  color: #727278;
  font-size: 11px
}

#main[data-page=inbox] .chat-scroll {
  background: #fafafa
}

#main[data-page=inbox] .chat-contact small {
  display: flex;
  align-items: center;
  gap: 8px
}

#main[data-page=inbox] .chat-contact small>span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis
}

#main[data-page=inbox] .chat-contact small .platform-badge {
  flex-shrink: 0
}

#main[data-page=inbox] #chat .bubble {
  background: #eee;
  color: #272727
}

#main[data-page=inbox] #chat .outgoing .bubble {
  background: #303030;
  color: white
}

#main[data-page=inbox] #chat .outgoing .bubble time {
  color: #ddd
}

#main[data-page=inbox] .composer {
  border-color: #ddd;
  border-radius: 9px;
  box-shadow: none
}

#main[data-page=inbox] .composer:focus-within {
  border-color: #888
}

#main[data-page=inbox] .composer .ai-button {
  color: #555;
  background: #f3f3f3
}

.overview-list {
  min-height: 0;
}

.overview-list .activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 3px 0 0;
  background: none;
  border: 0;
}

.activity-meta .platform-badge {
  flex-shrink: 0;
}

.activity-title {
  display: block;
  overflow-wrap: anywhere;
}

/* Dashboard */
.overview .dashboard-analytics {
  background: #fff;
  padding: 0;
  overflow: hidden
}

.dashboard-analytics header {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap
}

.dashboard-analytics header h2 {
  font-size: 15px
}

.dashboard-analytics form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px
}

.dashboard-analytics form select {
  max-width: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  background: white;
  font-size: 12px
}

.dashboard-analytics form .button {
  min-height: 29px;
  padding: 5px 7px
}

.dashboard-platforms {
  display: flex;
  gap: 4px
}

.dashboard-platforms button[aria-pressed=true] {
  background: #202124;
  color: #fff;
  border-color: #202124
}

.dashboard-analytics select[hidden] {
  display: none
}

.dashboard-analytics form svg {
  width: 14px;
  height: 14px
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0
}

.overview-list .dashboard-metrics>div {
  padding: 18px;
  margin: 0;
  border: 0;
  border-radius: 0
}

.overview-list .dashboard-metrics>div+div {
  border-left: 1px solid var(--line)
}

.dashboard-metrics dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #525252;
  font-size: 12px;
  line-height: 1.3
}

.dashboard-metrics dt svg {
  width: 15px;
  height: 15px
}

.dashboard-metrics dd {
  margin: 7px 0 0;
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere
}

.dashboard-analytics #dashboard-metrics-status {
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  background: #fafafa;
  font-size: 11px
}

.dashboard-analytics #dashboard-metrics-status:empty {
  display: none
}

.overview .overview-stats button {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.overview .overview-stats strong {
  margin: 0;
  font-size: 20px
}

.overview .overview-stats svg {
  padding: 0;
  border: 0;
  width: 15px;
  height: 15px
}

.overview .overview-stats button span {
  gap: 6px;
  font-size: 12px
}

@media(max-width:520px) {
  .dashboard-analytics header {
    padding: 10px
  }

  .dashboard-analytics form select {
    max-width: 135px
  }

  .overview-list .dashboard-metrics>div {
    padding: 10px 6px
  }

  .dashboard-metrics dt {
    align-items: flex-start;
    gap: 4px;
    font-size: 11px
  }

  .dashboard-metrics dt svg {
    width: 12px;
    height: 12px
  }

  .overview .overview-stats button {
    padding: 8px
  }
}

.dashboard-chart {
  border-top: 1px solid var(--line);
  padding: 12px 18px 9px
}

.dashboard-chart[hidden] {
  display: none
}

.dashboard-chart header {
  padding: 0 0 9px;
  border: 0
}

.dashboard-chart h3 {
  font-size: 13px;
  font-weight: 600
}

#dashboard-chart-metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 3px 6px;
  font-size: 12px
}

#dashboard-chart-bars {
  display: flex;
  align-items: stretch;
  gap: clamp(2px, 1vw, 10px);
  height: 115px;
  background: repeating-linear-gradient(to top, #ededed 0 1px, transparent 1px 25%)
}

.dashboard-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
  min-width: 0;
  border-radius: 3px
}

.dashboard-bar:hover,
.dashboard-bar:focus-visible {
  background: #ebeff5
}

.dashboard-bar i {
  width: 100%;
  max-width: 62px;
  height: max(2px, var(--bar-size));
  background: #46618e;
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: dashboard-bar-in .36s ease-out both
}

#dashboard-chart-dates {
  margin-top: 4px;
  color: #666;
  font-size: 11px
}

@keyframes dashboard-bar-in {
  from {
    transform: scaleY(.02);
    opacity: .45
  }

  to {
    transform: scaleY(1);
    opacity: 1
  }
}

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

.dashboard-analytics-page {
  background: #fafafa;
}

.dashboard-analytics-page>.page-heading {
  max-width: none;
  margin: 0;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dashboard-analytics-page>.dash-overview {
  max-width: none;
  margin: 0;
  padding: 14px 28px 32px;
  gap: 14px;
}

.dash-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.dash-filters-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.dash-filters-row select {
  height: 30px;
  padding: 0 20px 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  color: var(--ink);
  max-width: 155px;
  min-width: 0;
  flex: 0 1 auto;
}

.dash-filters-row select:focus {
  outline: none;
  border-color: #a1a1aa;
}

#dashboard-metrics-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #71717a;
  margin-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

.dash-warn-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: help;
}

.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.dash-topbar-actions .button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  background: #fff;
}

@media(max-width:1060px) {
  .dash-topbar,
  .dash-filters-row {
    flex-wrap: wrap;
  }
}

.dash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.dash-kpi-cell {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dash-kpi-cell+.dash-kpi-cell {
  border-left: 1px solid var(--line);
}

.dash-kpi-cell dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #71717a;
}

.dash-kpi-cell dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.dash-kpi-cell dd strong {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #18181b;
}

.dash-kpi-sub {
  display: inline-block;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafafa;
  font-size: 11px;
  color: #52525b;
}

.dash-kpi-sub:empty {
  display: none;
}

.dash-delta {
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dash-delta.is-up {
  background: #dcfce7;
  color: #15803d;
}

.dash-delta.is-down {
  background: #fee2e2;
  color: #b91c1c;
}

.dash-delta.is-flat {
  background: #f4f4f5;
  color: #52525b;
}

.dash-best-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.dash-best-link svg {
  width: 14px;
  height: 14px;
  color: #71717a;
}

.dash-best-link:hover strong {
  color: #e03313;
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-card-head h3 {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
  margin: 0;
}

.dash-card-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #71717a;
}

.dash-card-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-card-head-right select {
  height: 29px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.dash-card-stat {
  text-align: right;
  line-height: 1.15;
}

.dash-card-stat strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #18181b;
  font-variant-numeric: tabular-nums;
}

.dash-card-stat span {
  font-size: 11px;
  color: #71717a;
}

.dash-avg-label {
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
}

.dash-svg-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.dash-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.dash-axis-row {
  display: grid;
  grid-template-columns: repeat(var(--dash-cols, 2), minmax(0, 1fr));
  align-items: center;
  margin-top: 2px;
}

.dash-axis-plat {
  display: flex;
  justify-content: center;
}

.dash-plat-ico {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-plat-ico svg {
  width: 14px;
  height: 14px;
}

.dash-plat-ico.is-facebook {
  color: #1877f2;
}

.dash-plat-ico.is-tiktok {
  color: #111;
}

.dash-plat-ico.is-youtube {
  color: #dc2626;
}

.dash-plat-fallback {
  font-size: 10px;
  font-weight: 700;
  color: #52525b;
}

.dash-tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: #18181b;
  color: #fff;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  min-width: 135px;
  max-width: 240px;
}

.dash-tip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: #f4f4f5;
}

.dash-tip>div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-tip>div i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  flex-shrink: 0;
}

.dash-tip>div b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.dash-line-guide {
  stroke: #d4d4d8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.dash-chart-empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #8b8d97;
  font-size: 12px;
  padding: 16px;
}

.dash-eng-body {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: center;
}

.dash-eng-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.dash-eng-toggle,
.dash-eng-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 7px;
  min-width: 0;
}

.dash-eng-toggle {
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}

.dash-eng-toggle:hover {
  background: #f8f8fb;
  border-color: var(--line);
}

.dash-eng-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #52525b;
}

.dash-eng-top input {
  accent-color: var(--series-color, #e03313);
  margin: 0;
  cursor: pointer;
}

.dash-eng-val {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 19px;
}

.dash-eng-val svg,
.dash-eng-label svg {
  width: 13px;
  height: 13px;
  color: var(--series-color, #71717a);
}

.dash-eng-val strong,
.dash-eng-er {
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
  font-variant-numeric: tabular-nums;
}

.dash-eng-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #52525b;
}

.dash-eng-er {
  color: #15803d;
  padding-left: 18px;
}

/* Heatmap */
.hm-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #71717a;
}

.hm-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.hm-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hm-row,
.hm-axis {
  display: grid;
  grid-template-columns: 28px repeat(24, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
}

.hm-day {
  font-size: 10px;
  color: #71717a;
}

.hm-cell {
  aspect-ratio: 1 / .92;
  border-radius: 2px;
  min-height: 13px;
  transition: transform .1s;
}

.hm-cell:hover {
  outline: 1.5px solid #18181b;
}

.lvl-0 {
  background: #f3f4f6;
}

.lvl-1 {
  background: #dcfce7;
}

.lvl-2 {
  background: #86efac;
}

.lvl-3 {
  background: #22c55e;
}

.lvl-4 {
  background: #15803d;
}

.hm-axis {
  margin-top: 3px;
}

.hm-axis span {
  font-size: 10px;
  color: #8b8d97;
  grid-column: span 3;
}

.hm-axis span:first-child {
  grid-column: span 1;
}

.hm-best {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11px;
  color: #71717a;
}

.hm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
  color: #18181b;
  font-size: 11px;
}

/* Content Format Breakdown */
.dash-format-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dash-format-row.is-best {
  border-color: #f0b5a8;
  background: #fff7f5;
}

.dash-format-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dash-format-ico {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #f4f4f5;
  display: grid;
  place-items: center;
  color: #52525b;
  flex-shrink: 0;
}

.dash-format-row.is-best .dash-format-ico {
  background: #fde8e3;
  color: #e03313;
}

.dash-format-ico svg {
  width: 14px;
  height: 14px;
}

.dash-format-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.dash-best-pill {
  padding: 1px 6px;
  border-radius: 4px;
  background: #fee2dc;
  color: #b42318;
  font-size: 10px;
  font-weight: 700;
}

.dash-format-info small {
  display: block;
  font-size: 11px;
  color: #71717a;
}

.dash-format-info small .is-up {
  color: #15803d;
}

.dash-format-info small .is-down {
  color: #71717a;
}

.dash-format-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.dash-format-track {
  flex: 1;
  height: 6px;
  background: #f1f1f4;
  border-radius: 99px;
  overflow: hidden;
}

.dash-format-track i {
  display: block;
  height: 100%;
  background: #9ca3af;
  border-radius: 99px;
}

.dash-format-row.is-best .dash-format-track i {
  background: #e03313;
}

.dash-format-meter strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* Tables */
.dash-table-card {
  padding: 0;
  overflow: hidden;
}

.dash-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
}

.dash-table th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #71717a;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  white-space: nowrap;
}

.dash-table th:first-child,
.dash-table td:first-child {
  text-align: left;
}

.dash-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f2f2f5;
  color: #18181b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dash-table tbody tr:last-child td {
  border-bottom: 0;
}

.dash-table tbody tr.dash-row-click {
  cursor: pointer;
}

.dash-table tbody tr.dash-row-click:hover td {
  background: #fafafa;
}

.dash-td-entity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dash-td-entity small {
  display: block;
  font-size: 11px;
  color: #71717a;
  font-weight: 400;
}

.dash-td-post {
  min-width: 0;
  white-space: normal;
}

.dash-td-post strong {
  display: block;
  font-weight: 600;
  color: #18181b;
}

.dash-er-pill {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}

.dash-text-up {
  color: #15803d;
  font-weight: 500;
}

.dash-text-down {
  color: #b91c1c;
}

.dash-chevron {
  width: 24px;
  color: #9ca3af;
  font-size: 14px;
}

.dash-legend-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 11px;
  color: #52525b;
  margin-top: 4px;
}

.dash-legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dash-legend-inline i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.dash-insight-box {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #f2f2f5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #52525b;
}

.dash-insight-box.is-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dash-insight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-modal-thumb {
  margin-bottom: 10px;
}

.dash-modal-thumb img {
  max-height: 220px;
  width: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.dash-modal-caption {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.dash-modal-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dash-modal-metrics div {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafafa;
}

.dash-modal-metrics dt {
  font-size: 11px;
  color: #71717a;
}

.dash-modal-metrics dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media(max-width:1040px) {
  .dash-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-kpi-cell:nth-child(4) {
    border-left: 0;
  }

  .dash-kpi-cell:nth-child(n+4) {
    border-top: 1px solid var(--line);
  }

  .dash-eng-body {
    grid-template-columns: 1fr;
  }
}

@media(max-width:840px) {
  .dashboard-analytics-page>.page-heading {
    padding: 12px 16px;
  }

  .dashboard-analytics-page>.dash-overview {
    padding: 12px 16px 24px;
  }

  .dash-grid-2 {
    grid-template-columns: 1fr;
  }

  .dash-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-cell {
    border-left: 0 !important;
    border-top: 1px solid var(--line);
  }

  .dash-kpi-cell:first-child {
    border-top: 0;
  }

  .dash-eng-toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.overview .overview-plans {
  background: white;
  padding: 14px 16px
}

.overview-plans h2 {
  display: flex;
  align-items: center;
  gap: 8px
}

.overview-plans h2 svg {
  height: 15px;
  width: 15px;
  color: #5e6570
}

.overview-plans header>span {
  font-size: 11px;
  color: #535960;
  background: #f1f2f3;
  padding: 1px 7px;
  border-radius: 10px
}

.overview-plan-timeline,
.overview-plan-timeline ul {
  margin: 0;
  padding: 0;
  list-style: none
}

.overview-plan-day {
  padding: 9px 0;
  border-top: 1px solid var(--line)
}

.overview-plan-day:last-child {
  padding-bottom: 0
}

.overview-plan-day h3 {
  font-size: 11px;
  color: #626972;
  margin: 0 0 3px
}

.overview-plan-day button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 4px;
  border-radius: 6px
}

.overview-plan-day button:hover {
  background: #f4f5f7
}

.overview-plan-day time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #546480
}

.overview-plan-day button span {
  overflow-wrap: anywhere
}

.overview-plans>p {
  font-size: 13px
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(235px, .8fr) minmax(0, 1.65fr);
  gap: 14px;
  align-items: start
}

.schedule-compose {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff
}

.schedule-compose header,
.schedule-compose footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px
}

.schedule-compose header {
  min-height: 30px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line)
}

.schedule-compose h2 {
  font-size: 15px
}

.schedule-compose textarea {
  width: 100%;
  resize: vertical
}

.schedule-compose footer {
  justify-content: flex-end;
  flex-wrap: wrap
}

.schedule-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #cfcfd3;
  border-radius: 7px;
  color: #444;
  cursor: pointer;
  margin-bottom: 12px
}

.schedule-upload:hover,
.schedule-upload:focus-within {
  background: #f5f5f5;
  border-color: #666
}

.schedule-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer
}

.schedule-attachment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px
}

.schedule-attachment[hidden] {
  display: none
}

.schedule-media {
  grid-column: 1/-1
}

.schedule-media img,
.schedule-media video {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 7px;
  background: #f4f4f4
}

.schedule-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px
}

.schedule-status {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px
}

.schedule-status:empty {
  display: none
}

.schedule-layout .calendar-shell header {
  justify-content: flex-start
}

@media(max-width:940px) {
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr)
  }
}

#modal:has(#reviewed-comment-form) .modal-body {
  padding: 0
}

#modal:has(#reviewed-comment-form) .modal-body>p:empty {
  display: none
}

#reviewed-comment-form {
  display: flex;
  flex-direction: column;
  max-height: calc(90dvh - 58px)
}

.reviewed-fields {
  min-height: 0;
  overflow: auto;
  padding: 15px 18px
}

.reviewed-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px
}

.reviewed-pickers .form-field {
  margin: 0
}

.reviewed-details {
  padding: 7px 0;
  color: #555;
  font-size: 12px
}

.reviewed-details summary {
  cursor: pointer
}

.reviewed-details summary svg {
  width: 14px;
  height: 14px;
  vertical-align: middle
}

#reviewed-source {
  padding: 8px 0;
  overflow-wrap: anywhere
}

#reviewed-source a {
  text-decoration: underline
}

.reviewed-fields .reviewed-editor {
  margin: 10px 0 0
}

.reviewed-fields textarea {
  resize: vertical
}

.reviewed-ai {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px
}

.reviewed-ai input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px
}

.reviewed-ai button {
  flex: none
}

.reviewed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #fafafa;
  border-top: 1px solid var(--line)
}

.reviewed-footer .check-row {
  margin: 0;
  font-size: 12px
}

#reviewed-sender,
#reviewed-warning {
  font-size: 12px;
  color: #656565
}

#reviewed-warning:not(:empty) {
  margin-top: 8px;
  color: #8a4429
}

#reviewed-comment-form :is(input, select, textarea):focus-visible {
  outline: 2px solid #777;
  outline-offset: 1px;
  box-shadow: none
}

@media(max-width:540px) {
  .reviewed-pickers {
    grid-template-columns: 1fr
  }

  .reviewed-footer {
    flex-wrap: wrap
  }

  .reviewed-footer .primary {
    margin-left: auto
  }
}

.comment-ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: pointer
}

.comment-ai-toggle input {
  appearance: none;
  position: relative;
  width: 34px;
  height: 19px;
  margin: 0;
  border: 1px solid #aaa;
  border-radius: 14px;
  background: #e6e6e6;
  cursor: inherit
}

.comment-ai-toggle input::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #0003;
  transition: transform .15s ease
}

.comment-ai-toggle input:checked {
  background: #252525;
  border-color: #252525
}

.comment-ai-toggle input:checked::before {
  transform: translateX(15px)
}

.comment-ai-toggle input:disabled {
  opacity: .5;
  cursor: default
}

@media(prefers-reduced-motion:reduce) {
  .comment-ai-toggle input::before {
    transition: none
  }
}

.schedule-compose .form-field {
  margin-bottom: 10px
}

.schedule-compose .schedule-caption textarea {
  min-height: 84px
}

.schedule-compose .schedule-upload {
  justify-content: flex-start;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 12px;
  background: #fafafa
}

.schedule-compose .schedule-upload svg {
  width: 15px;
  height: 15px;
  color: #555
}

.schedule-layout .plan-day .day-number {
  max-width: 100%
}

@media(max-width:940px) {
  .schedule-layout .calendar-shell {
    grid-row: 1
  }

  .schedule-layout .calendar-shell header {
    padding: 9px;
    gap: 6px
  }

  .schedule-layout .calendar-shell header .button {
    min-height: 30px;
    padding: 4px 8px
  }

  .schedule-layout .plan-day {
    min-height: 54px
  }

  .schedule-layout .plan-entry {
    padding: 2px 3px;
    font-size: 10px
  }

  .schedule-layout .plan-entry svg {
    display: none
  }
}

.connection-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  max-width: 1120px
}

.connection-provider {
  min-width: 0
}

.connection-provider>h2 {
  margin: 0 0 9px;
  font-size: 14px
}

.connection-group {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 9px
}

.connection-group header {
  display: flex;
  align-items: center;
  gap: 8px
}

.connection-group .connection-info {
  min-width: 0
}

.connection-group h3,
.connection-accounts li>span:last-child {
  overflow-wrap: anywhere
}

.connection-group h3 {
  font-size: 14px
}

.connection-accounts {
  list-style: none;
  padding: 0;
  margin: 10px 0 0
}

.connection-accounts li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--line)
}

.connection-accounts .platform-badge {
  flex-shrink: 0
}

.zalo-connection footer {
  display: flex;
  gap: 6px;
  margin-top: 10px
}

.connection-workspace>.notice {
  grid-column: 1/-1
}

@media(max-width:740px) {
  .connection-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px
  }
}

.schedule-compose footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  gap: 8px;
}

.reviewed-editor-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px
}

.reviewed-editor-heading label {
  margin: 0
}

#reviewed-ai-toggle {
  min-height: 28px;
  padding: 3px 7px;
  gap: 5px;
  font-size: 11px
}

#reviewed-ai-toggle svg {
  width: 13px;
  height: 13px
}

#reviewed-comment-form #reviewed-text {
  min-height: 88px;
  height: auto;
  padding: 9px 10px
}

.reviewed-ai[hidden] {
  display: none
}

.reviewed-footer .primary {
  white-space: nowrap
}

.competitor-page .competitor-feed-heading {
  padding: 5px 7px;
  gap: 7px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa
}

.competitor-page .competitor-view-controls {
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px
}

.competitor-view-controls #competitor-channel-filter {
  width: clamp(110px, 14vw, 160px);
  max-width: 100%
}

.competitor-page .competitor-view-controls select,
.competitor-page #competitor-manage-open {
  min-height: 32px
}

.window-controls {
  display: none
}

.desktop .window-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  border-left: 1px solid var(--line);
  padding-left: 8px
}

.window-controls button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--muted)
}

.window-controls button:hover {
  background: #eee;
  color: #222
}

.window-controls #window-close:hover {
  background: #fceff0;
  color: #a82938
}

.window-controls svg {
  width: 14px;
  height: 14px
}

.competitor-result-count {
  font-size: 11px;
  color: #616161;
  white-space: nowrap
}

.competitor-page #competitor-manage-open svg {
  width: 14px;
  height: 14px
}

.competitor-page .compact-feed .competitor-post-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  align-items: stretch
}

.competitor-page .compact-feed .competitor-post {
  padding: 13px
}

.competitor-page .competitor-post-meta {
  display: flex;
  align-items: center;
  gap: 9px
}

.competitor-source-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  background: #202020;
  color: white
}

.competitor-source-icon.facebook {
  background: #1970d6
}

.competitor-source-icon svg {
  width: 15px;
  height: 15px
}

.competitor-origin {
  display: grid;
  min-width: 0;
  flex: 1
}

.competitor-page .competitor-origin strong {
  font-size: 13px;
  overflow-wrap: anywhere
}

.competitor-page .competitor-origin time {
  margin: 0;
  font-size: 11px;
  color: #656565
}

.competitor-page .competitor-new {
  color: #2d694f;
  background: #edf6ef
}

.competitor-page .compact-feed .competitor-caption p {
  font-size: 13px;
  line-height: 1.6;
  -webkit-line-clamp: 4
}

.competitor-page .compact-feed .competitor-images img,
.competitor-page .compact-feed .media-image {
  height: clamp(160px, 23vw, 250px);
  max-height: 250px
}

.competitor-page .competitor-post-actions .button {
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px
}

.competitor-page .competitor-post-grid>.competitor-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px
}


.brand .brand-mark {
  width: 30px;
  height: 24px;
  object-fit: contain;
  flex: none
}

.preview-sheet #post-preview .media-image {
  display: block;
  margin-inline: auto;
  max-width: 100%
}

.competitor-source-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 2px;
  border-radius: 6px;
  background: #efefef
}

.competitor-source-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 5px;
  color: #535353;
  font-size: 12px
}

.competitor-source-tabs button[aria-pressed=true] {
  background: #242424;
  color: white
}

.competitor-source-tabs button span {
  font-variant-numeric: tabular-nums;
  opacity: .8
}

.published-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.published-heading>#open-post-composer {
  margin-inline-end: 28px;
  white-space: nowrap
}

.published-toolbar,
.published-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px
}

.published-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0
}

.published-toolbar select {
  min-width: 0;
  max-width: 100%
}

.published-toolbar svg,
.published-meta svg {
  width: 15px;
  height: 15px;
  flex: none
}

.published-pagination {
  justify-content: flex-end;
  margin-top: 14px
}

#published-status:empty {
  display: none
}

#published-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px
}

.published-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff
}

.published-card:hover {
  background: #fafafa;
  border-color: #bcbcc0
}

.published-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #515866;
  font-size: 12px
}

.published-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px
}

.published-preview>span {
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere
}

.published-preview img {
  flex: none;
  width: 70px;
  height: 62px;
  object-fit: cover;
  border-radius: 5px
}

.published-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  font-size: 12px;
  color: #515866
}

.published-metrics dd {
  margin: 3px 0 0;
  font-size: 17px;
  color: #202124
}

.published-caption {
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.published-timeline {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse
}

.published-timeline :is(th, td) {
  padding: 6px 3px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere
}

#post-composer-dialog {
  width: min(1120px, 94vw);
  padding: 18px
}

#post-composer-dialog #post-form {
  padding: 0
}

.published-history-chart {
  margin: 12px 0
}

.published-history-chart figcaption {
  color: #515866;
  font-size: 12px;
  margin-bottom: 6px
}

.published-history-chart>div {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 80px;
  border-bottom: 1px solid var(--line)
}

.published-history-chart span {
  height: var(--height);
  flex: 1;
  max-width: 35px;
  border-radius: 4px 4px 0 0;
  background: #4276a1
}

.published-history-chart span:is(:focus, :hover) {
  background: #21547e
}

#post-form :is(#post-tiktok, #post-youtube, #tiktok-direct, #tiktok-video-settings) {
  min-width: 0;
  display: grid;
  gap: 10px
}

#post-form :is(#post-tiktok, #post-youtube, #tiktok-direct, #tiktok-video-settings)[hidden] {
  display: none
}

#post-form #tiktok-place-search {
  display: grid;
  gap: 8px;
  margin: 0
}

#post-form #tiktok-place-search label {
  margin: 0
}

.tiktok-place-query {
  display: flex;
  align-items: stretch;
  gap: 8px
}

.tiktok-place-query input {
  min-width: 0;
  flex: 1
}

#post-composer-dialog #tiktok-place-search :is(input, select, .button) {
  min-height: 38px;
  border-radius: 6px;
  margin: 0
}

#post-composer-dialog #tiktok-place-search :is(input, select) {
  padding: 8px 11px
}

#post-composer-dialog #tiktok-find-place {
  flex: none;
  padding: 0 16px;
  border-color: #dedede
}

#tiktok-place-status {
  font-size: 12px;
  color: #71717a
}

#tiktok-place-status:empty {
  display: none
}

.published-meta>span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.published-preview>.published-video-placeholder {
  display: grid;
  place-items: center;
  flex: none;
  width: 70px;
  height: 62px;
  border-radius: 5px;
  background: #eee;
  color: #4a4a4a
}

.published-pagination:has(#published-prev:disabled):has(#published-next:disabled) {
  display: none
}

.publish-page {
  --publish-orange: #b74012;
  --publish-accent: #f5d0bc;
  --publish-surface: #fff6ee;
  background: #faf8f6
}

.publish-page .published-heading {
  border-bottom: 1px solid #ede3da;
  margin-bottom: 14px;
  background: #fffdfb
}

.publish-page .published-heading .page-heading {
  padding-block: 16px
}

.publish-page #open-post-composer,
.publish-page #post-form .button.primary {
  background: var(--publish-orange);
  border-color: var(--publish-orange);
  color: #fff
}

.publish-page #open-post-composer:hover,
.publish-page #post-form .button.primary:not(:disabled):hover {
  background: #9f350e;
  border-color: #9f350e
}

.publish-page :is(button, select, input, textarea):focus-visible {
  outline: 2px solid var(--publish-orange);
  outline-offset: 2px
}

.publish-page .published-toolbar {
  gap: 8px;
  margin-bottom: 12px
}

.publish-page .published-toolbar select {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #e6d8ce;
  border-radius: 6px;
  background: #fff;
  color: #36251b
}

.publish-page .published-toolbar .button {
  color: var(--publish-orange);
  border-color: #e6d8ce;
  min-height: 34px
}

.publish-page #published-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 10px
}

.publish-page .published-card {
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
  border-color: #eadfd6;
  border-radius: 8px;
  padding: 11px;
  color: #32251d
}

.publish-page .published-card:hover {
  background: #fffaf6;
  border-color: var(--publish-accent)
}

.publish-page .published-meta {
  color: #625448
}

.publish-page .published-meta svg {
  color: var(--publish-orange)
}

.publish-page .published-preview {
  min-height: 62px;
  font-size: 13px;
  line-height: 1.45
}

.publish-page .published-preview img,
.publish-page .published-video-placeholder {
  width: 76px;
  height: 66px
}

.publish-page .published-video-placeholder {
  color: var(--publish-orange);
  background: var(--publish-surface)
}

.publish-page .published-card .published-metrics {
  gap: 6px 9px;
  color: #65564a;
  font-variant-numeric: tabular-nums
}

.publish-page .published-card .published-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 3px
}

.publish-page .published-metrics svg {
  width: 13px;
  height: 13px
}

.publish-page .published-metrics strong {
  font-weight: 500
}

.published-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid #f2e9e2;
  padding-top: 7px;
  font-size: 11px;
  color: #725443
}

.published-card-footer span:last-child {
  color: #316749
}

.publish-page #post-composer-dialog {
  border-color: #e6d8ce
}

.publish-page #post-composer-dialog .modal-header {
  border-bottom: 1px solid #f1e4d9;
  padding-bottom: 10px
}

/* Shared Social Space palette */
:root {
  --brand: #b74012;
  --brand-soft: #fff1e8;
  --line: #e7dfda;
  accent-color: var(--brand)
}

.app-shell .sidebar {
  background: #fffcf9;
  border-color: var(--line)
}

.app-shell .main-shell .topbar {
  background: #fffdfb;
  border-color: var(--line)
}

:is(.app-shell, dialog) .button.primary {
  background: #b74012;
  color: #fff;
  border-color: #b74012
}

:is(.app-shell, dialog) .button.primary:hover:not(:disabled) {
  background: #98330d;
  border-color: #98330d
}

.app-shell #nav [data-view]:hover {
  background: #f7f5f3;
  color: #302d2a
}

.app-shell #nav [data-view]:is(.active, [aria-current="page"]) {
  background: #efedeb;
  color: #292724;
  border-color: transparent;
  border-radius: 5px;
  font-weight: 500
}

.app-shell :is(.content-page, .inbox-page) {
  background: var(--workspace-bg)
}

:is(.app-shell, dialog) :is(input, select, textarea, button, a):focus-visible {
  outline: 2px solid #bf4f20;
  outline-offset: 2px
}

.app-shell :is(.competitor-source-tabs, .dashboard-platforms) button[aria-pressed=true],
.app-shell button[aria-selected=true] {
  background: #ffeadb;
  color: #89320c;
  border-color: #eeb997
}

.app-shell .dashboard-bar i {
  background: #cd592a
}

#modal:has(.published-analysis) .modal-body {
  padding: 20px
}

.published-analysis {
  display: grid;
  gap: 18px
}

.published-analysis h3 {
  font-size: 14px;
  margin: 0 0 8px
}

.published-analysis-content {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white
}

.published-analysis-content p {
  margin: 0
}

.published-analysis-content img {
  display: block;
  margin-top: 10px;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px
}

.published-analysis-channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px
}

.published-analysis-channel .button {
  margin-left: auto
}

.published-analysis-state {
  padding: 2px 7px;
  color: #346347;
  background: #eaf4ec;
  border-radius: 4px;
  font-size: 12px
}

.published-analysis-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0
}

.published-analysis-metrics>div {
  background: white;
  padding: 10px
}

.published-analysis-metrics dt {
  font-size: 12px;
  color: #66584e
}

.published-analysis-metrics dd {
  margin: 4px 0 0;
  font-weight: 650
}

.published-analysis .published-history-chart span {
  background: #b74012
}

.publish-page #open-post-composer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid #bb431d;
  border-radius: 6px;
  background: #bb431d;
  color: white;
  font: 500 13px/20px "Segoe UI", sans-serif;
  box-shadow: none;
}

.publish-page #open-post-composer:hover {
  background: #a63816;
  border-color: #a63816
}

#open-post-composer .ui-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex: none
}

.publish-page #post-composer-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  box-sizing: border-box;
  width: min(1160px, 76vw);
  max-width: 100%;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: white;
  box-shadow: -4px 0 18px #0000000a;
}

.publish-page #post-composer-dialog .modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0;
  padding: 12px 18px;
  background: white;
  border-bottom: 1px solid var(--line)
}

.publish-page #post-composer-dialog #post-form {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  padding: 16px
}

@media(max-width:900px) {
  .publish-page #post-composer-dialog {
    width: 100%
  }
}

.publish-page #post-composer-dialog {
  overflow: hidden
}

.publish-page #post-composer-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr)
}

.publish-page #post-composer-dialog #post-form {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: auto;
}

#post-composer-dialog .post-fields,
#post-composer-dialog .composer-sidebar {
  min-width: 0;
  overflow: auto;
  padding: 20px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#post-composer-dialog .composer-sidebar {
  border-left: 1px solid var(--line);
  background: #faf9f7
}

#post-composer-dialog .post-target-list {
  max-height: none;
  overflow: visible
}

#post-composer-dialog .post-target-list .check-row:has(:checked) {
  background: #fff0e7
}

#post-composer-dialog .post-target-list input {
  accent-color: #be431a
}

#post-composer-dialog .composer-preview {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px
}

#post-composer-dialog .composer-preview summary {
  cursor: pointer;
  margin-bottom: 12px
}

#post-composer-dialog .post-publish-bar {
  margin: 0;
  padding: 10px 18px;
  background: white
}

#post-composer-dialog .post-publish-bar #post-result {
  margin-right: auto
}

#post-composer-dialog .post-publish-bar button {
  margin: 0
}

#post-composer-dialog .post-fields>fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0 0;
  margin: 20px 0 0
}

@media(max-width:720px) {
  .publish-page #post-composer-dialog #post-form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto
  }

  #post-composer-dialog .post-fields,
  #post-composer-dialog .composer-sidebar {
    overflow: visible
  }

  #post-composer-dialog .composer-sidebar {
    border-left: 0;
    border-top: 1px solid var(--line)
  }

  #post-composer-dialog .post-publish-bar {
    position: sticky;
    bottom: 0
  }
}

.published-trend {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white
}

.published-trend figcaption {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px
}

.published-trend svg {
  display: block;
  width: 100%;
  height: auto
}

.published-trend svg line {
  stroke: #e6e2de;
  stroke-dasharray: 3 3
}

.published-trend svg path {
  fill: none;
  stroke-width: 2
}

.published-trend svg text {
  font-size: 10px;
  fill: #605d59
}

.published-trend ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 11px
}

.published-trend li {
  display: flex;
  align-items: center;
  gap: 5px
}

.published-trend li span {
  width: 10px;
  height: 3px;
  border-radius: 2px
}

.published-history-table summary {
  cursor: pointer
}

.published-analysis .published-analysis-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.published-analysis-metrics dd {
  font-weight: 500
}

.composer-timing {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 10px
}

#post-schedule-fields:not([hidden]) {
  display: grid;
  gap: 6px;
  margin-top: 10px
}

.publish-page .published-toolbar {
  gap: 8px;
  padding: 8px 10px;
  background: #faf8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.publish-page .published-toolbar :is(select, .button) {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink);
}

.published-view-controls,
.published-toolbar #published-pages {
  display: inline-flex;
  gap: 4px
}

.published-toolbar .published-pagination {
  margin: 0;
  gap: 3px
}

.published-toolbar .published-pagination:has(#published-pages button) {
  display: flex
}

.published-toolbar .button:is([aria-current="page"], [aria-pressed="true"]) {
  background: #f8e9df;
  color: #923711;
  border-color: #e8c9b6
}

.publish-page #published-grid[data-layout="list"] {
  grid-template-columns: minmax(0, 1fr)
}

#published-grid[data-layout="list"] .published-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto
}

#published-grid[data-layout="list"] .published-preview {
  grid-column: 1/-1
}

#published-grid[data-layout="list"] .published-card-footer {
  grid-column: 1/-1
}

/* Flat publishing composer */
.publish-page #post-composer-dialog {
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 8px 28px #0000001a;
  --line: #e4e4e4;
}

.publish-page #post-composer-dialog .modal-header {
  border-bottom: 1px solid #e4e4e4;
  padding: 14px 16px;
}

.publish-page #post-composer-dialog #post-form .post-fields {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  padding: 14px;
}

.publish-page #post-composer-dialog #post-form .composer-sidebar {
  border: 0;
  border-left: 1px solid #e4e4e4;
  background: #fff;
  padding: 14px;
  border-radius: 0;
  box-shadow: none;
}

#post-composer-dialog .caption-editor {
  border: 1px solid #dedede;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  padding: 0;
}

.publish-page #post-composer-dialog #post-content {
  border: 0;
  border-radius: 0;
  outline-offset: -2px;
  min-height: 100px;
  resize: vertical;
  padding: 12px;
  box-shadow: none;
}

.publish-page #post-composer-dialog #post-form .post-caption-heading {
  margin: 0 0 10px;
}

#post-composer-dialog .post-caption-heading label,
#post-composer-dialog .post-targets legend {
  font-size: 11px;
  text-transform: uppercase;
  color: #777;
  font-weight: 400;
}

.publish-page #post-composer-dialog #post-form .post-media-toolbar {
  display: flex;
  flex-wrap: wrap;
  padding: 8px;
  margin: 0;
  border: 0;
  background: white;
}

.post-media-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-height: 78px;
  border: 1px dashed #e1e1e1;
  cursor: pointer;
  font-size: 13px;
}

.post-media-drop strong {
  font-weight: 500;
}

.post-media-drop>span {
  flex-basis: 100%;
  text-align: center;
  font-size: 12px;
  color: #888;
}

#post-composer-dialog #post-media[hidden] {
  display: none;
}

#post-composer-dialog input:not([type=checkbox]),
#post-composer-dialog select,
#post-composer-dialog textarea {
  border-radius: 0;
  border-color: #dedede;
  box-shadow: none;
}

.post-platform-group {
  padding: 8px 0;
}

.post-platform-group>header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 6px 4px;
}

.post-platform-group>header strong {
  font-weight: 500;
}

.post-platform-group>header>span:last-child {
  color: #888;
  font-size: 12px;
}

#post-composer-dialog .post-platform-group .check-row {
  padding: 10px 5px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
}

.post-platform-logo {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 4px;
}

.post-platform-logo svg {
  width: 15px;
  height: 15px;
  stroke: none;
}

.post-platform-logo.facebook {
  background: #1877f2;
  color: white;
}

.post-platform-logo.youtube {
  background: #ff0033;
  color: white;
}

.post-platform-logo.tiktok {
  background: #111;
  color: white;
}

#post-composer-dialog .post-publish-bar {
  border-top: 1px solid #e4e4e4;
}

/* Headerless workspace and collapsible navigation */
.app-shell {
  --topbar: 0px;
}

.app-shell .main-shell {
  border-radius: 0;
  border: 0;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  flex-shrink: 0;
  cursor: default;
}

.sidebar-brand-row .brand {
  flex: 1;
  min-width: 0;
}

.sidebar-brand-row #sidebar-toggle {
  flex-shrink: 0;
  font-size: 19px;
}

.sidebar .global-search {
  display: none;
}

.sidebar-utilities {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-utilities .top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
}

.sidebar-utilities .mode-pill {
  flex-basis: 100%;
  width: max-content;
  border: 0;
  padding: 0 4px 8px;
}

.sidebar-utilities .window-controls {
  margin: 8px 0 0;
  padding: 6px 0 0;
  border-left: 0;
  border-top: 1px solid var(--line);
  width: 100%;
}

.app-shell.sidebar-collapsed {
  --sidebar: 64px;
}

.sidebar-collapsed .sidebar {
  width: 64px;
  padding-inline: 8px;
}

.sidebar-collapsed .brand,
.sidebar-collapsed .workspace-switch,
.sidebar-collapsed .nav-group-label,
.sidebar-collapsed .nav-item>span,
.sidebar-collapsed .mode-pill {
  display: none;
}

.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-collapsed .sidebar-utilities .top-actions {
  justify-content: center;
}

.sidebar-collapsed .window-controls {
  flex-direction: column;
  align-items: center;
}

@media(max-width:650px) {

  .app-shell .sidebar-brand-row,
  .app-shell .sidebar-utilities {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: 100%;
    padding: 0 10px;
  }
}

.publish-page .published-toolbar {
  padding: 5px 0;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.publish-page .published-toolbar :is(select, .button) {
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.publish-page .published-toolbar :is(select, .button):hover {
  background: #f4efeb
}

.publish-page .published-toolbar :is(.published-filter > summary, #published-sort) {
  border-color: var(--line);
  background: #fff;
}

.publish-page #published-sort {
  width: auto;
  max-width: min(100%, 205px)
}

.published-filter {
  position: relative
}

.published-filter>summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none
}

.published-filter>summary::-webkit-details-marker {
  display: none
}

#published-filter-active {
  color: #923711;
  font-size: 11px
}

.published-filter-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 5;
  width: min(245px, 75vw);
  padding: 10px;
  display: grid;
  gap: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 6px 18px #33231815;
}

.publish-page .published-filter-panel select {
  width: 100%;
  border-color: var(--line)
}

.published-toolbar .published-view-controls {
  gap: 1px
}

.published-toolbar .published-pagination button {
  min-width: 26px
}

.published-toolbar .published-pagination button:disabled {
  display: none
}

/* Compact media action and clean brand marks */
.publish-page #post-composer-dialog #post-form .post-media-toolbar {
  padding: 8px 10px;
  border-top: 1px solid #eee;
  align-items: center;
  gap: 10px;
}

.publish-page #post-composer-dialog .post-media-drop {
  width: auto;
  min-height: 30px;
  padding: 4px 8px;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 7px;
  border: 0;
  border-radius: 3px;
  font-size: 12px;
  color: #555;
}

.publish-page #post-composer-dialog .post-media-drop:hover {
  background: #f3f3f3;
}

.publish-page #post-composer-dialog .post-media-drop svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.publish-page #post-composer-dialog .post-media-drop strong {
  font-weight: 400;
  white-space: nowrap;
}

#post-composer-dialog .post-platform-logo {
  width: 20px;
  height: 20px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

#post-composer-dialog .post-platform-logo svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: none;
}

#post-composer-dialog .post-platform-group>header .post-platform-logo {
  width: 16px;
  height: 16px;
}

#post-composer-dialog .post-platform-group>header .post-platform-logo svg {
  width: 16px;
  height: 16px;
}

#post-composer-dialog .composer-timing {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0 0;
  margin: 18px 0 0;
  min-width: 0
}

.composer-timing legend {
  padding: 0 8px 0 0;
  color: #68635e;
  font-size: 12px
}

.composer-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f0eeeb
}

.composer-mode label {
  position: relative;
  cursor: pointer
}

.composer-mode input {
  position: absolute;
  opacity: 0
}

.composer-mode span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px;
  border-radius: 5px;
  font-size: 13px
}

.composer-mode .ui-icon {
  width: 15px;
  height: 15px
}

.composer-mode input:checked+span {
  background: white;
  color: #923711;
  box-shadow: 0 1px 3px #33231820
}

.composer-mode input:focus-visible+span {
  outline: 2px solid #bb431d
}

#post-schedule-fields:not([hidden]) {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px
}

#post-schedule-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px
}

#post-schedule-fields :is(select, input) {
  width: 100%;
  min-width: 0;
  min-height: 34px
}

@media(max-width:420px) {
  #post-schedule-fields:not([hidden]) {
    grid-template-columns: minmax(0, 1fr)
  }
}

/* Workspace identity footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  flex-shrink: 0;
}

.sidebar-footer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 35px;
  padding: 7px 10px;
  text-align: left;
  font-size: 13px;
  color: #303238;
}

.sidebar-footer-item>span:first-child {
  display: flex;
}

.sidebar-footer-item svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

.sidebar-footer-item:hover,
.sidebar-account:hover {
  background: #f0f0f0;
}

.sidebar-chevron {
  margin-left: auto;
  color: #727272;
  font-size: 16px;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 16px 10px 3px;
  border-top: 1px solid #e4e4e4;
  text-align: left;
}

.sidebar-account-avatar {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f1e8de;
  color: #945027;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-account-text {
  display: grid;
  min-width: 0;
  line-height: 1.45;
}

.sidebar-account-text strong {
  font-size: 13px;
  font-weight: 500;
}

.sidebar-account-text>span {
  font-size: 12px;
  color: #777;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar-footer-item>span:not(:first-child),
.sidebar-collapsed .sidebar-account-text,
.sidebar-collapsed .sidebar-account>.sidebar-chevron {
  display: none;
}

.sidebar-collapsed .sidebar-footer-item,
.sidebar-collapsed .sidebar-account {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-member-row p {
  font-size: 12px;
  color: #777;
}

@media(max-width:650px) {
  .sidebar-footer {
    display: none;
  }
}

.sidebar-brand-row #sidebar-toggle {
  width: 30px;
  height: 30px;
  color: #666360
}

.sidebar-brand-row #sidebar-toggle .ui-icon {
  width: 17px;
  height: 17px
}

.sidebar-brand-row #sidebar-toggle:hover {
  background: #efebe7;
  color: var(--ink)
}

.sidebar-collapsed .sidebar-brand-row {
  flex-direction: column;
  gap: 4px;
  padding-block: 4px
}

.sidebar-collapsed .sidebar-brand-row .brand {
  display: flex;
  flex: none;
  justify-content: center;
  padding: 3px
}

.sidebar-collapsed .sidebar-brand-row .brand>span {
  display: none
}

.sidebar-collapsed .sidebar-brand-row #sidebar-toggle {
  transform: scaleX(-1)
}

@media(max-width:650px) {
  .sidebar-collapsed .nav-item>span {
    display: revert
  }

  .sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding-inline: 8px
  }
}

.publish-page #post-composer-dialog #post-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0
}

#post-form .composer-body {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto
}

#post-form .composer-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100%
}

#post-composer-dialog .composer-body :is(.post-fields, .composer-sidebar) {
  height: auto;
  min-height: 0;
  overflow: visible;
  scrollbar-gutter: auto;
  padding-bottom: 24px
}

#post-composer-dialog :is(input, textarea, select):-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset
}

#post-composer-dialog #post-form .post-publish-bar {
  flex: none;
  background: white;
  padding: 10px 16px;
  border-top: 1px solid #e6e5e3;
  margin: 0
}

#post-composer-dialog #post-tiktok fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0
}

#post-composer-dialog #post-tiktok label.check-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: #f7f6f4;
  padding: 10px;
  border-radius: 4px
}

#post-composer-dialog #post-tiktok label.check-row input {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  padding: 0
}

#composer-attachment:not(:empty) {
  padding: 8px 12px
}

#composer-attachment :is(img, video) {
  display: block;
  width: 122px;
  height: 94px;
  object-fit: contain;
  background: #171717;
  border-radius: 5px
}

#post-composer-dialog [hidden] {
  display: none !important
}

@media(max-width:720px) {
  #post-form .composer-columns {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: 0
  }

  #post-composer-dialog .composer-body :is(.post-fields, .composer-sidebar) {
    min-height: 0;
    height: auto;
    overflow: visible;
    padding-bottom: 14px
  }
}

#post-account .post-platform-group header [data-group-toggle] {
  margin-left: auto;
  width: 15px;
  height: 15px;
  min-height: 0;
  accent-color: #be431a;
  cursor: pointer
}

#post-account [data-group-count] {
  font-variant-numeric: tabular-nums
}

#post-account .post-target-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap
}

#post-account .post-target-filters input {
  flex: 1 1 110px;
  min-width: 0
}

#post-account .post-target-filters select {
  width: auto;
  max-width: 100%
}

#post-account #post-target-clear {
  white-space: nowrap
}

#post-composer-dialog #reuse-content {
  width: auto;
  max-width: 48%;
  min-height: 30px;
  font-size: 12px
}

#post-composer-dialog .modal-header small {
  display: block;
  color: #68645f;
  margin-top: 4px
}

.publish-page #post-composer-dialog #reuse-content {
  width: 85px;
  min-height: 29px;
  height: 29px;
  font-size: 12px;
  padding: 2px 6px
}

.publish-page #post-composer-dialog #post-form .post-media-toolbar {
  border: 0;
  padding: 8px
}

.publish-page #post-composer-dialog #post-form .post-media-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  align-content: center;
  gap: 4px 7px;
  width: 100%;
  min-height: 76px;
  border: 1px dashed #d9d4ce;
  border-radius: 5px;
  background: #fcfbfa;
  cursor: pointer
}

.post-media-drop small {
  width: 100%;
  text-align: center;
  color: #716d68
}

#post-account .post-target-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px
}

#post-account .post-target-filters :is(input, select) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 4px 6px
}

#post-account #post-target-clear {
  grid-column: 1/-1;
  justify-self: end
}

.desktop .sidebar-footer .window-controls {
  justify-content: center;
  border: 0;
  padding: 0 0 4px
}

.desktop .sidebar-collapsed .sidebar-footer .window-controls {
  gap: 0
}

.desktop .sidebar-brand-row {
  padding-top: 6px;
  min-height: 46px
}

.publish-page #published-grid[data-layout="list"] {
  display: block;
  overflow-x: auto;
  max-width: 100%
}

.published-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--ink)
}

.published-list-table :is(th, td) {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap
}

.published-list-table th {
  font-weight: 500;
  background: #faf8f6;
  color: #615c58
}

.published-list-table td.post-stat {
  text-align: right;
  font-variant-numeric: tabular-nums
}

.published-list-table tbody tr:hover {
  background: #fcf7f3
}

.published-list-table button {
  display: block;
  max-width: 22ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left
}

.desktop-titlebar {
  display: none
}

.desktop .desktop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding-left: 8px;
  background: #f8f8fb;
  color: #545459;
  color-scheme: light;
  user-select: none
}

.desktop .desktop-titlebar .window-controls {
  height: 100%;
  padding: 0;
  gap: 0;
  border: 0
}

.desktop-titlebar .window-controls button {
  width: 46px;
  height: 100%;
  border-radius: 0;
  background: transparent;
  color: #44444a
}

.desktop-titlebar .window-controls button:hover {
  background: #eaeaf0
}

.desktop-titlebar #sidebar-toggle {
  width: 28px;
  height: 28px;
  color: #73737a
}

.desktop .app-shell {
  --topbar: 36px;
  height: calc(100dvh - 36px)
}

.list-search-wrap {
  padding: 8px 10px 6px;
  flex-shrink: 0
}

.comments-page .list-search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line)
}

.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #76767e;
  transition: border-color .15s, box-shadow .15s
}

.list-search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

.list-search input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  padding: 0;
  min-width: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink)
}

.list-search input::placeholder {
  color: #76767e
}

.list-search:focus-within {
  border-color: #bf4f20;
  box-shadow: 0 0 0 2px #bf4f2024
}

:is(.app-shell, dialog) .list-search input:focus-visible {
  outline: none
}

@media(max-width:650px) {
  .list-search {
    height: 38px
  }

  .list-search input {
    font-size: 14px
  }
}

#modal:has(.published-analysis) .modal-body>p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13px;
  color: #665e57
}

.published-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #faf8f6;
  font-size: 11px;
  color: #5b534d
}

.published-id-chip:hover {
  background: #f2ece7
}

.published-id-chip svg {
  width: 12px;
  height: 12px
}

.published-analysis {
  gap: 16px
}

.published-analysis h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6a615a;
  margin: 0 0 8px
}

.published-analysis-channel {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.published-analysis-channel strong {
  font-size: 14px;
  font-weight: 600
}

.published-analysis-channel>span:nth-of-type(1) {
  font-size: 13px;
  color: #665e57
}

.published-analysis-channel time {
  margin-left: auto;
  font-size: 12px;
  color: #726a63;
  font-variant-numeric: tabular-nums
}

.published-analysis-state {
  padding: 2px 8px;
  color: #286843;
  background: #eaf6ee;
  border-radius: 5px;
  font-weight: 500
}

.published-analysis-metrics>div {
  padding: 10px 12px
}

.published-analysis-metrics dt {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #6b625b
}

.published-analysis-metrics dd {
  margin: 5px 0 0;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink)
}

.published-trend {
  padding: 14px 16px
}

.published-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 10px
}

.published-trend-head strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink)
}

.published-trend-head span {
  font-size: 11px;
  color: #7a726b
}

.published-trend-stage {
  position: relative
}

.published-trend svg line.published-trend-base {
  stroke: #403d3a;
  stroke-dasharray: none
}

.published-trend svg line.published-trend-guide {
  stroke: #b7401255;
  stroke-dasharray: 3 2;
  pointer-events: none
}

.published-trend svg line[hidden],
.published-trend-tooltip[hidden] {
  display: none
}

.published-trend svg path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none
}

.published-trend svg circle {
  pointer-events: none
}

.published-trend svg rect.published-trend-hit {
  fill: transparent;
  cursor: crosshair
}

.published-trend svg text {
  font-size: 10px;
  fill: #6b6560;
  font-variant-numeric: tabular-nums
}

.published-trend-tooltip {
  position: absolute;
  top: 6px;
  z-index: 2;
  min-width: 148px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdfb;
  box-shadow: 0 6px 18px #261d1514;
  font-size: 11px;
  pointer-events: none
}

.published-trend-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--ink)
}

.published-trend-tooltip div {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.55
}

.published-trend-tooltip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none
}

.published-trend-tooltip span {
  color: #665e57
}

.published-trend-tooltip b {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums
}

.published-trend-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 11px;
  color: #514b46
}

.published-trend-legend li {
  display: flex;
  align-items: center;
  gap: 6px
}

.published-trend-legend li.is-empty {
  opacity: .5
}

.published-trend-legend li span {
  position: relative;
  width: 16px;
  height: 2px;
  background: var(--series);
  border-radius: 1px
}

.published-trend-legend li span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid var(--series);
  background: #fff
}

.published-timeline-empty {
  margin: 0 0 10px;
  font-size: 13px;
  color: #665e57
}

.published-history-table summary {
  font-size: 12px;
  color: #5d544d
}

.published-analysis .published-analysis-metrics>div:last-child {
  grid-column: span 3
}

@media(max-width:520px) {
  .published-analysis .published-analysis-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .published-analysis .published-analysis-metrics>div:last-child {
    grid-column: auto
  }
}

.publish-page #post-composer-dialog .reuse-button {
  min-height: 29px;
  padding: 4px 10px;
  gap: 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #4f4944;
  border-color: var(--line);
  background: #fff
}

.publish-page #post-composer-dialog .reuse-button:hover {
  background: #faf6f3;
  border-color: #d8c5b8;
  color: var(--ink)
}

.publish-page #post-composer-dialog .reuse-button svg {
  width: 13px;
  height: 13px
}

.composer-reused-note {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #6c645e
}

.publish-page #post-composer-dialog.is-reusing[open] {
  display: flex;
  flex-direction: column
}

.reuse-post-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #fcfbfa
}

.reuse-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0
}

.reuse-heading {
  min-width: 180px;
  flex: 1
}

.reuse-heading h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0
}

.reuse-heading p {
  font-size: 12px;
  color: #6c645e;
  margin: 2px 0 0
}

.reuse-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto
}

.reuse-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  width: 168px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #76767e
}

.reuse-search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0
}

#post-composer-dialog .reuse-search input {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  min-width: 0;
  font-size: 12px;
  outline: none;
  box-shadow: none
}

.reuse-search:focus-within {
  border-color: #bf4f20;
  box-shadow: 0 0 0 2px #bf4f2024
}

:is(.app-shell, dialog) .reuse-search input:focus-visible {
  outline: none
}

#post-composer-dialog #reuse-sort {
  height: 32px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  width: auto
}

.reuse-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px
}

#reuse-status {
  font-size: 13px;
  color: #6c645e;
  margin: 0
}

#reuse-status:empty {
  display: none
}

#reuse-status:not(:empty) {
  margin-bottom: 12px
}

.reuse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px
}

@media(max-width:1040px) {
  .reuse-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:580px) {
  .reuse-grid {
    grid-template-columns: minmax(0, 1fr)
  }
}

.reuse-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s
}

.reuse-card:hover {
  background: #fffaf7;
  border-color: #d8b8a4;
  box-shadow: 0 2px 8px #2a1a100a
}

.reuse-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  flex: 1
}

.reuse-card-caption {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere
}

.reuse-card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.reuse-platform-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f2efec;
  color: #5a524c;
  font-size: 11px;
  font-weight: 500
}

.reuse-card-body time {
  margin-top: auto;
  font-size: 11px;
  color: #78706a;
  font-variant-numeric: tabular-nums
}

.reuse-card-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  align-self: center;
  border-radius: 6px;
  overflow: hidden;
  background: #f0ece8
}

.reuse-card-thumb :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover
}

.reuse-video-badge,
.reuse-card-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px
}

.reuse-video-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #18181bb8
}

.reuse-card-placeholder {
  color: #6a615a;
  font-size: 16px
}

.reuse-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
  flex-shrink: 0
}

#reuse-summary {
  font-size: 12px;
  color: #6c645e;
  font-variant-numeric: tabular-nums
}

.reuse-pagination {
  display: flex;
  align-items: center;
  gap: 4px
}

.reuse-pagination .button {
  min-width: 30px;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px
}

.reuse-pagination .button[aria-current="page"] {
  background: #e03313;
  color: #fff;
  border-color: #e03313
}

.reuse-ellipsis {
  padding: 0 4px;
  font-size: 12px;
  color: #78706a
}

@media(min-width:961px) {
  .app-shell {
    padding: 0;
    gap: 0;
    background: #fff
  }

  .app-shell .sidebar {
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0
  }

  .app-shell:not(.sidebar-collapsed) .sidebar {
    padding: 14px 12px 16px
  }

  .app-shell .main-shell {
    border: 0;
    border-radius: 0
  }
}

.desktop .desktop-titlebar {
  background: #fffdfb;
  border-bottom: 1px solid var(--line);
  padding-left: 10px
}

.desktop .sidebar-brand-row {
  padding-top: 2px;
  min-height: 38px
}

.app-shell .sidebar-footer-item:is(.active, [aria-current="page"]) {
  background: #efedeb;
  color: #292724;
  border-radius: 5px;
  font-weight: 500
}

.settings-page [hidden] {
  display: none !important
}

.settings-page #settings-form {
  display: block;
  max-width: none;
  gap: 0
}

.settings-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 28px;
  background: #fffdfb;
  border-bottom: 1px solid var(--line)
}

.settings-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink)
}

.settings-page .settings-save-btn {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none
}

.settings-body {
  padding: 16px 28px 24px
}

.settings-sheet {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(210px, 275px) minmax(0, 1fr);
  gap: 14px 28px;
  padding: 16px 22px;
  align-items: start
}

.settings-row+.settings-row {
  border-top: 1px solid var(--line)
}

.settings-row-info {
  min-width: 0
}

.settings-row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px
}

.settings-row-info h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px
}

.settings-row-title h2 {
  margin: 0
}

.settings-row-info p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted)
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f1ef;
  color: #68615b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4
}

.settings-pill.is-ready {
  background: #eaf5ee;
  color: #276743
}

.settings-row-fields {
  min-width: 0;
  display: grid;
  gap: 11px
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px
}

.settings-page .form-field {
  margin: 0;
  min-width: 0
}

.settings-page .form-field label {
  font-size: 12px;
  font-weight: 500;
  color: #544d47;
  margin-bottom: 4px
}

.settings-page .form-field :is(input, select) {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dfd9d4;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  line-height: 1.4
}

.settings-page .form-field :is(input, select):focus {
  border-color: #bf4f20;
  outline: none;
  box-shadow: 0 0 0 2px #bf4f2022
}

.settings-page .form-field small {
  margin-top: 5px;
  font-size: 11px;
  color: #78706a
}

.settings-subpanel {
  padding-top: 11px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px
}

.settings-subpanel-top {
  padding-top: 0;
  border-top: 0;
}

.settings-row:has(> .settings-disclosure) {
  grid-template-columns: minmax(0, 1fr);
}

.settings-disclosure {
  min-width: 0;
}

.settings-disclosure-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.settings-disclosure-summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure-summary .settings-row-title {
  margin-bottom: 0;
}

.settings-row .settings-disclosure-summary h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.settings-row .settings-disclosure .form-field {
  margin-top: 0;
}

.settings-disclosure-summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #8c847d;
  border-bottom: 1.5px solid #8c847d;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
  margin-left: 2px;
}

.settings-disclosure[open] > .settings-disclosure-summary::after {
  transform: rotate(45deg);
}

.settings-disclosure-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.settings-disclosure-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-ai-advanced > .settings-disclosure-summary {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9f7;
}

.settings-disclosure[open] > .settings-disclosure-body {
  margin-top: 12px;
}

.settings-ai-advanced[open] > .settings-disclosure-body {
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbfa;
  cursor: pointer
}

.settings-switch-row>span {
  min-width: 0
}

.settings-switch-row strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink)
}

.settings-switch-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px
}

.settings-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border: 1px solid #c9c2bc;
  border-radius: 999px;
  background: #e6e1dc;
  cursor: pointer;
  transition: background .15s, border-color .15s
}

.settings-switch::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #00000026;
  transition: transform .15s ease
}

.settings-switch:checked {
  background: #b74012;
  border-color: #b74012
}

.settings-switch:checked::before {
  transform: translateX(16px)
}

.ai-control-rows {
  gap: 0;
}

.ai-control-rows .settings-switch-row {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 38px;
  padding-inline: 0;
  text-align: start;
}

.ai-control-rows .settings-switch-row + .settings-switch-row {
  border-top: 1px solid var(--line);
}

.ai-control-inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.ai-control-inline small {
  margin-top: 0;
}

.ai-control-inline svg {
  width: 14px;
  height: 14px;
  rotate: -90deg;
  color: var(--muted);
}

.page-ai-channels {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-ai-channel + .page-ai-channel {
  border-top: 1px solid var(--line);
}

.page-ai-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding-block: 6px;
}

.settings-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none
}

.settings-channel-icon svg {
  width: 18px;
  height: 18px
}

.settings-channel-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.3
}

.settings-channel-copy strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.settings-channel-copy small {
  font-size: 11px;
  color: var(--muted)
}

.page-ai-channel-row input:disabled {
  opacity: .62;
  cursor: default;
}

.page-ai-assignment {
  padding: 0 0 9px 32px;
  color: var(--muted);
  font-size: 12px;
}

.page-ai-assignment summary {
  cursor: pointer;
  width: fit-content;
}

.page-ai-assignment summary span {
  margin-inline-start: 8px;
}

.page-ai-assignment select {
  width: 100%;
  margin-top: 6px;
}

.settings-empty-note,
.settings-inline-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0
}

.settings-image-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start
}

.settings-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #5b534d;
  cursor: pointer
}

.settings-inline-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #b74012;
  cursor: pointer
}

.settings-retention-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px
}

.settings-page .radio-option {
  padding: 6px 12px;
  border-radius: 7px;
  border-color: #dfd9d4;
  font-size: 12px;
  cursor: pointer
}

.settings-page .radio-option:has(input:checked) {
  border-color: #dfb099;
  background: #fff8f3;
  color: #89320c;
  font-weight: 500
}

.settings-page .radio-option input {
  margin: 0;
  accent-color: #b74012
}

.settings-backend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px
}

.settings-backend-row .button {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none
}

@media(min-width:651px) and (max-width:800px) {

  .sidebar-footer-item>span:not(:first-child),
  .sidebar-account-text,
  .sidebar-account>.sidebar-chevron {
    display: none
  }

  .sidebar-footer-item,
  .sidebar-account {
    justify-content: center;
    padding-inline: 0
  }
}

@media(max-width:860px) {
  .settings-header {
    padding: 12px 16px
  }

  .settings-body {
    padding: 14px 16px 28px
  }

  .settings-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px
  }
}

@media(max-width:560px) {

  .settings-grid-2,
  .settings-backend-row {
    grid-template-columns: minmax(0, 1fr)
  }
}

.connections-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 63px;
  padding: 13px 28px;
  background: #fffdfb;
  border-bottom: 1px solid var(--line)
}

.connections-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink)
}

.connections-page .connections-add-btn {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none
}

.connections-page .connections-add-btn svg {
  width: 14px;
  height: 14px
}

.connections-body {
  display: grid;
  gap: 22px;
  padding: 18px 28px 32px
}

.connections-body>.notice {
  margin: 0
}

.connections-section {
  min-width: 0;
  display: grid;
  gap: 10px
}

.connections-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px
}

.connections-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0
}

.connections-section-title h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0
}

.connections-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1eeeb;
  color: #625b55;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4
}

.connections-pill.is-ready {
  background: #eaf5ee;
  color: #276743
}

.connections-pill.is-warn {
  background: #fff4e5;
  color: #9a5b13
}

.connections-pill.is-muted {
  background: #f1f0ee;
  color: #77716b
}

.connection-apify-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #fff
}

.connection-apify-note {
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  align-items: stretch
}

.connections-page .connection-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s
}

.connections-page .connection-group:hover {
  border-color: #d8c6ba;
  box-shadow: 0 3px 10px #2b1a0e08
}

.connections-page .connection-group>header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fffdfb;
  border-bottom: 1px solid var(--line)
}

.connection-key-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 7px;
  background: #faf1eb;
  color: #a1421a
}

.connection-key-icon svg {
  width: 15px;
  height: 15px
}

.connections-page .connection-info {
  flex: 1;
  min-width: 0
}

.connections-page .connection-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.connections-page .connection-info p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums
}

.connection-group-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none
}

.connection-group-actions .button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none
}

.connection-group-actions .icon-button {
  width: 30px;
  height: 30px;
  color: #827a73
}

.connection-group-actions .icon-button:hover {
  color: #a82938;
  background: #fceff0
}

.connections-page .connection-accounts {
  list-style: none;
  margin: 0;
  padding: 4px 14px 8px
}

.connections-page .connection-accounts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line)
}

.connections-page .connection-accounts li:first-child {
  border-top: 0
}

.connection-account-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1
}

.connection-platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none
}

.connection-platform-icon svg {
  width: 17px;
  height: 17px
}

.connection-account-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.connection-platform-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f4f1ee;
  color: #625a54;
  font-size: 11px;
  font-weight: 500
}

.connection-empty-accounts {
  padding: 14px;
  font-size: 12px;
  color: var(--muted)
}

.connections-empty-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px
}

.connections-empty-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink)
}

.connections-empty-card p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px
}

.connections-page .zalo-connection > header {
  align-items: flex-start
}

.connections-page .zalo-connection .channel-symbol {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex: none
}

.connections-page .zalo-connection .channel-symbol svg {
  width: 16px;
  height: 16px
}

.connections-page .zalo-connection .connection-info h3 {
  white-space: normal
}

.connections-page .zalo-connection .connection-info p {
  white-space: normal;
  overflow-wrap: anywhere
}

.connections-page .zalo-connection footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: auto 0 0
}

.connections-page .zalo-connection footer .button {
  flex: 1;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: none
}

@media(max-width:740px) {
  .connections-header {
    padding: 12px 16px
  }

  .connections-body {
    padding: 14px 16px 28px;
    gap: 18px
  }

  .connections-page .zalo-connection footer {
    width: 100%
  }

  .connections-page .zalo-connection footer .button {
    flex: 1
  }
}

/* Unified comment workspace & #e03313 orange theme for buttons and tabs */
:root {
  --primary: #e03313;
  --primary-hover: #c52a0e;
  --brand: #e03313;
  --brand-hover: #c52a0e;
  --brand-soft: #fff1ee;
  --brand-tint: #fde8e3;
  --brand-border: #f3b8ad;
  --brand-ink: #9e210a;
  --line: #e7dfda;
  accent-color: #e03313
}

.publish-page {
  --publish-orange: #e03313;
  --publish-accent: #f3b8ad;
  --publish-surface: #fff1ee
}

:is(.app-shell, dialog) .button.primary,
.publish-page #open-post-composer,
.publish-page .published-toolbar #open-post-composer,
.publish-page #post-form .button.primary,
.connect-button {
  background: #e03313;
  border-color: #e03313;
  color: #fff
}

.publish-page .published-toolbar {
  flex-wrap: wrap;
}

.publish-page .published-toolbar #open-post-composer {
  margin-left: auto;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 7px;
}

:is(.app-shell, dialog) .button.primary:hover:not(:disabled),
.publish-page #open-post-composer:hover,
.publish-page .published-toolbar #open-post-composer:hover,
.publish-page #post-form .button.primary:not(:disabled):hover,
.connect-button:hover {
  background: #c52a0e;
  border-color: #c52a0e
}

:is(.app-shell, dialog) .button.danger {
  background: #fff;
  border-color: #e5c3bd;
  color: #b42318
}

:is(.app-shell, dialog) .button.danger:hover:not(:disabled) {
  background: #fff1ee;
  border-color: #e03313;
  color: #9e210a
}

.app-shell button[aria-selected=true],
.app-shell :is(.competitor-source-tabs, .dashboard-platforms) button[aria-pressed=true],
.knowledge-page .knowledge-filters .tab.active,
#main[data-page=inbox] .list-status-tabs .tab.active,
.publish-page .composer-mode input:checked+span {
  background: #e03313;
  color: #fff;
  border-color: #e03313;
  box-shadow: 0 1px 2px #e033132b
}

.publish-page .published-toolbar .button:is([aria-current="page"], [aria-pressed="true"]) {
  background: #e03313;
  color: #fff;
  border-color: #e03313
}

.competitor-channel[aria-pressed="true"],
.draft-editor-tabs button[aria-selected="true"] {
  background: #fff1ee;
  color: #9e210a;
  border-color: #e03313
}

.comments-page .list-status-tabs .tab.active {
  background: transparent;
  color: #e03313;
  border-bottom: 2px solid #e03313
}

.comments-page .post-row.selected {
  background: #fff5f2;
  color: var(--ink)
}

.calendar-count-badge {
  background: #e03313;
  color: #fff
}

.plan-entry.scheduled-entry {
  border-color: #f3cbc3;
  border-left: 2.5px solid #e03313;
  background: #fff9f8
}

.scheduled-entry-clock {
  color: #b9240b
}

.overview-plan-badge,
.scheduled-modal-status {
  background: #fde8e3;
  color: #9e210a
}

.published-analysis .published-history-chart span,
.app-shell .dashboard-bar i {
  background: #e03313
}

.connection-key-icon {
  background: #fff1ee;
  color: #e03313
}

.settings-switch:checked {
  background: #e03313;
  border-color: #e03313
}

.settings-page .radio-option:has(input:checked) {
  background: #fff5f2;
  border-color: #f3b8ad;
  color: #9e210a
}

.settings-inline-check input,
.settings-page .radio-option input,
#post-composer-dialog .post-target-list input,
#post-account [data-group-toggle] {
  accent-color: #e03313
}

:is(.app-shell, dialog) :is(input, select, textarea, button, a):focus-visible,
.composer-mode input:focus-visible+span {
  outline: 2px solid #e03313;
  outline-offset: 2px
}

.list-search:focus-within,
.reuse-search:focus-within,
.settings-page .form-field :is(input, select):focus {
  border-color: #e03313;
  box-shadow: 0 0 0 2px #e0331324
}

.comments-page .comment-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 13px 28px;
  background: #fffdfb;
  border-bottom: 1px solid var(--line)
}

.comment-ai-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  min-width: 0
}

.comments-page .comment-ai-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2
}

.comments-page .comment-workspace-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 0 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  flex-shrink: 0
}

.comments-page .comment-workspace-tabs button {
  padding: 5px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #71717a;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s
}

.comments-page .comment-workspace-tabs button:hover {
  color: #18181b;
  background: #fafafa
}

.app-shell .comments-page .comment-workspace-tabs button[aria-selected="true"] {
  background: #f4f4f6;
  color: #18181b;
  font-weight: 600;
  border-color: transparent;
  box-shadow: none
}

.comments-page .comment-ai-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto
}

.comments-page .comment-ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #4a433d;
  cursor: pointer;
  user-select: none
}

.comments-page .comment-ai-toggle:hover {
  background: #faf7f4;
  border-color: #d9cdc5
}

.comments-page .comment-ai-toggle input {
  width: 32px;
  height: 18px;
  border: 1px solid #c9c2bc;
  background: #e6e1dc;
  transition: background .15s, border-color .15s
}

.comments-page .comment-ai-toggle input::before {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 2px
}

.comments-page .comment-ai-toggle input:checked {
  background: #e03313;
  border-color: #e03313
}

.comments-page .comment-ai-toggle input:checked::before {
  transform: translateX(14px)
}

.comments-page #reviewed-comment-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none
}

.comments-page #reviewed-comment-new svg {
  width: 14px;
  height: 14px;
  flex: none
}

.comments-page #comment-activity {
  padding: 18px 28px 28px
}

.comment-activity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px
}

.comments-page .comment-ai-overview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px
}

.comments-page .comment-ai-overview button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 9px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #544d47;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s
}

.comments-page .comment-ai-overview button:hover {
  background: #fff5f2;
  border-color: #f3b8ad;
  color: #9e210a
}

.comments-page .comment-ai-overview button span {
  color: inherit;
  font-size: 12px
}

.comments-page .comment-ai-overview button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f2eeea;
  color: #5d554e;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums
}

.comments-page .comment-ai-overview button[aria-pressed="true"] {
  background: #e03313;
  border-color: #e03313;
  color: #fff;
  font-weight: 600
}

.comments-page .comment-ai-overview button[aria-pressed="true"] span {
  color: #fff
}

.comments-page .comment-ai-overview button[aria-pressed="true"] strong {
  background: #ffffff30;
  color: #fff
}

.comment-activity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto
}

.comment-activity-meta>span {
  font-size: 12px;
  color: #78706a
}

.comment-activity-meta #comment-ai-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none
}

.comment-activity-meta #comment-ai-refresh svg {
  width: 13px;
  height: 13px;
  flex: none
}

#comment-ai-refresh[hidden] {
  display: none;
}

@media(max-width:740px) {
  .comments-page .comment-ai-header {
    padding: 12px 16px;
    flex-direction: row;
    align-items: center
  }

  .comments-page .comment-ai-header-actions {
    margin-left: 0
  }

  .comments-page #comment-activity {
    padding: 14px 16px 24px
  }

  .comment-activity-meta {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0
  }
}

/* Enhanced Inbox ergonomics and warm #e03313 consistency */
#main[data-page=inbox] .conversation-list {
  background: #fffdfb;
  border-right: 1px solid var(--line)
}

#main[data-page=inbox] .list-controls {
  height: auto;
  min-height: 48px;
  padding: 8px 12px;
  gap: 8px;
  flex-wrap: nowrap
}

#main[data-page=inbox] .list-title {
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600
}

#main[data-page=inbox] .list-controls select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  background: #fff;
  color: #4a433d;
  font-size: 12px
}

.list-sync-btn {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #5c534c
}

.list-sync-btn:hover:not(:disabled) {
  background: #fff1ee;
  border-color: #f3b8ad;
  color: #e03313
}

.list-sync-btn svg {
  width: 14px;
  height: 14px
}

.search-clear-btn {
  width: 22px;
  height: 22px;
  flex: none;
  color: #857d76;
  border-radius: 999px
}

.search-clear-btn:hover {
  color: #e03313;
  background: #fff1ee
}

.search-clear-btn svg {
  width: 13px;
  height: 13px
}

.search-clear-btn[hidden] {
  display: none
}

#main[data-page=inbox] .list-status-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 0 10px 8px;
  background: #f3efec;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px
}

#main[data-page=inbox] .list-status-tabs .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 29px;
  border: 0;
  border-radius: 6px;
  color: #625a54;
  font-size: 12px;
  font-weight: 500
}

#main[data-page=inbox] .list-status-tabs .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e03313;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1
}

#main[data-page=inbox] .list-status-tabs .tab.active .tab-count {
  background: #ffffff36;
  color: #fff
}

#main[data-page=inbox] .conversation {
  min-height: 76px;
  padding: 11px 12px;
  width: calc(100% - 14px);
  margin: 2px 7px;
  gap: 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-bottom-color: transparent
}

#main[data-page=inbox] .conversation>.avatar {
  width: 38px;
  height: 38px;
  font-size: 12px
}

#main[data-page=inbox] .conversation:hover {
  background: #faf7f4
}

#main[data-page=inbox] .conversation.selected {
  background: #fff4f1;
  border-color: #f5d5ce;
  border-left: 3px solid #e03313
}

#main[data-page=inbox] .conversation-channel {
  margin-top: 3px;
  gap: 6px
}

#main[data-page=inbox] .conversation .unread {
  position: static;
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: #e03313;
  color: #fff;
  flex-shrink: 0
}

#main[data-page=inbox] .conversation p {
  margin-top: 3px;
  padding-right: 0
}

#main[data-page=inbox] .conversation.is-unread strong,
#main[data-page=inbox] .conversation.is-unread p {
  color: #1d1a18;
  font-weight: 600
}

.inbox-page:not(.comments-page) .chat {
  background: #faf8f6
}

.inbox-page:not(.comments-page) .chat-tabs {
  min-height: 62px;
  padding: 10px 18px;
  justify-content: space-between;
  background: #fffdfb;
  border-bottom: 1px solid var(--line)
}

.chat-contact-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0
}
.chat-contact-handle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 400;
  color: #71717a
}

.chat-status-pill {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2eeea;
  color: #625a54;
  font-size: 11px;
  font-weight: 500
}

.inbox-page:not(.comments-page) .chat-actions {
  position: static;
  flex-shrink: 0;
  gap: 6px
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #4a433d;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none
}

.chat-action-btn:hover {
  background: #fff1ee;
  border-color: #f3b8ad;
  color: #e03313
}

.chat-action-btn svg {
  width: 14px;
  height: 14px;
  flex: none
}

.chat-scroll-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column
}

.chat-scroll-wrap .chat-scroll {
  flex: 1;
  min-height: 0
}

.chat-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 16px
}

.chat-date-divider span {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #6e655f;
  font-size: 11px;
  font-weight: 500
}

.scroll-bottom-btn {
  position: absolute;
  right: 20px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #f3b8ad;
  background: #fff;
  color: #e03313;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 14px #2b1a0e18
}

.scroll-bottom-btn:hover {
  background: #fff1ee
}

.scroll-bottom-btn[hidden] {
  display: none
}

#main[data-page=inbox] #chat .bubble {
  background: #fff;
  border: 1px solid #e7dfda;
  color: #24201d;
  box-shadow: 0 1px 2px #00000008
}

#main[data-page=inbox] #chat .outgoing .bubble {
  background: #262322;
  border-color: #262322;
  color: #fff
}

.composer-wrap {
  position: relative;
  flex-shrink: 0
}

.inbox-page:not(.comments-page) .composer {
  margin: 6px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px #2b1a0e08;
  transition: border-color .15s, background .15s
}

.inbox-page:not(.comments-page) .composer:focus-within {
  border-color: #a1a1aa;
  box-shadow: none
}

.inbox-page:not(.comments-page) .composer.is-dragover {
  border-color: #e03313;
  background: #fff5f2
}

.inbox-page:not(.comments-page) .composer .icon-button {
  color: #5f5650;
  border-radius: 7px
}

.inbox-page:not(.comments-page) .composer .icon-button:hover,
.inbox-page:not(.comments-page) .composer .icon-button[aria-expanded="true"] {
  background: #fff1ee;
  color: #e03313
}

.inbox-page:not(.comments-page) .composer .ai-button {
  background: #fff5f2;
  color: #c52a0e
}

.quick-reply-popover {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(100% + 2px);
  z-index: 6;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfb;
  box-shadow: 0 12px 30px #2b1a0e1a;
  overflow: hidden
}

.quick-reply-popover[hidden] {
  display: none
}

.quick-reply-popover header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #faf8f6
}

.quick-reply-popover header strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink)
}

.quick-reply-popover header small {
  font-size: 11px;
  color: #78706a;
  margin-right: auto
}

.quick-reply-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 200px;
  overflow: auto;
  display: grid;
  gap: 3px
}

.quick-reply-list li {
  display: flex;
  align-items: center;
  gap: 6px
}

.quick-reply-insert {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: transparent
}

.quick-reply-insert:hover {
  background: #fff1ee;
  color: #9e210a
}

.quick-reply-del {
  width: 28px;
  height: 28px;
  color: #857d76;
  flex: none
}

.quick-reply-del:hover {
  color: #e03313;
  background: #fff1ee
}

.quick-reply-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #78706a
}

.quick-reply-add {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #faf8f6
}

.quick-reply-add input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px
}

@media(max-width:650px) {
  .inbox-page:not(.comments-page) .chat-actions {
    display: flex
  }

  .chat-action-btn {
    padding: 5px 8px
  }

  .chat-action-btn span {
    display: none
  }

  .inbox-page:not(.comments-page) .composer {
    margin: 4px 10px 10px
  }

  .quick-reply-popover {
    left: 10px;
    right: 10px
  }
}
/* Rich attachment rendering inside messages */
.media-video-player {display:block;max-width:100%;max-height:320px;border-radius:7px;background:#141414}
.media-audio {display:grid;gap:4px;padding:4px 0;min-width:220px;max-width:100%}
.media-audio audio {width:100%;height:36px}
.media-audio small {font-size:11px;opacity:.8}
.file-attachment {display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:8px;border:1px solid var(--line);background:#faf8f6;color:#4a433d;font-size:12px;line-height:1.4}
.file-attachment svg {width:15px;height:15px;flex:none}
.file-attachment.is-link {color:#c52a0e;border-color:#f3b8ad;background:#fff5f2;text-decoration:none}
.file-attachment.is-link:hover {background:#fde8e3}
.file-attachment.is-muted {color:#6b635c;background:#f7f4f1}
.message.outgoing .file-attachment.is-muted {background:#ffffff1c;border-color:#ffffff2e;color:#f3efec}
.attachment-share-card {display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:#faf8f6;color:var(--ink);text-decoration:none;max-width:300px}
.attachment-share-card:not(.is-static):hover {border-color:#f3b8ad;background:#fff5f2}
.share-card-thumb {width:52px;height:52px;object-fit:cover;border-radius:6px;flex:none;background:#ede9e5}
.share-card-thumb.is-fallback {display:grid;place-items:center;color:#78716c;background:#f0ece8}
.share-card-thumb.is-fallback svg {width:22px;height:22px}
.share-card-body {display:grid;gap:3px;min-width:0}
.share-card-body strong {font-size:12px;font-weight:600;overflow-wrap:anywhere}
.share-card-body small {font-size:11px;color:#6e655f;overflow-wrap:anywhere}
.share-card-link {display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:500;color:#e03313}
.share-card-link svg {width:12px;height:12px}

/* Global cross-view UI consistency (headers, typography, surfaces, spacing) */
.app-shell {
  --page-header-height: 63px;
}
.app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
  position: sticky;
  top: 0;
  z-index: 25;
  flex-shrink: 0;
  max-width: none;
  min-height: var(--page-header-height);
  padding: 13px 28px;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.app-shell .publish-page .published-heading .page-heading {
  padding: 0;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.app-shell :is(.dashboard-analytics-page, .knowledge-page, .competitor-page, .workspace-page, .publish-page, .comments-page, .connections-page, .settings-page, .trends-page, .news-page, .admin-page) h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
.app-shell .competitor-page>.content-inner {
  max-width: none;
  margin: 0;
  padding: 14px 28px 28px;
}
.app-shell .competitor-page .competitor-sources {
  top: 77px;
}
.app-shell .publish-page>.published-posts {
  max-width: none;
  margin: 0;
  padding: 12px 28px 28px;
}
.app-shell .workspace-page>.content-inner {
  max-width: none;
  margin: 0;
  padding: 16px 28px 28px;
}
.app-shell .news-page>.news-layout {
  padding: 20px 28px 32px;
}
.app-shell .competitor-page .competitor-feed-heading {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
}
.desktop .app-shell {
  --topbar: 0px;
  height: 100dvh;
}
.desktop .sidebar-brand-row,
.app-shell .sidebar-brand-row {
  padding: 0 12px;
  min-height: var(--page-header-height);
  height: var(--page-header-height);
  border-bottom: 1px solid var(--line);
  margin: 0 -12px 10px;
  gap: 10px;
  justify-content: flex-start;
}
.desktop .sidebar-brand-row .brand {
  gap: 7px;
  font-size: 14px;
}
.desktop .sidebar-brand-row .brand-mark {
  width: 26px;
  height: 21px;
}
.desktop .app-shell.sidebar-collapsed .sidebar-brand-row,
.app-shell.sidebar-collapsed .sidebar-brand-row {
  margin: 0 -8px 10px;
  padding: 6px 4px;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.desktop .app-shell.sidebar-collapsed .sidebar-brand-row .brand {
  padding: 0;
}
.desktop .app-shell.sidebar-collapsed .sidebar-brand-row .brand-mark {
  width: 24px;
  height: 19px;
}
.desktop .window-controls.mac-traffic-lights {
  position: fixed;
  top: 0;
  right: 26px;
  height: var(--page-header-height);
  z-index: 40;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
  flex: none;
}
.desktop .app-shell.sidebar-collapsed .window-controls.mac-traffic-lights {
  flex-direction: row;
  gap: 8px;
}
.desktop .app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
  padding-right: 102px;
}
@media(max-width:740px) {
  .desktop .window-controls.mac-traffic-lights {
    height: 54px;
    right: 20px;
  }
  .desktop .app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
    padding-right: 92px;
  }
}
.window-controls.mac-traffic-lights button {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  transition: filter .12s, background-color .15s;
}
.window-controls.mac-traffic-lights #window-close {
  background: #ff5f57;
  border: 1px solid #e0443e;
  color: #4d0000;
}
.window-controls.mac-traffic-lights #window-minimize {
  background: #febc2e;
  border: 1px solid #d89e24;
  color: #7a4400;
}
.window-controls.mac-traffic-lights #window-maximize {
  background: #28c840;
  border: 1px solid #1aab29;
  color: #004e0c;
}
.window-controls.mac-traffic-lights #window-close:hover {
  background: #ff5f57;
  color: #4d0000;
  filter: brightness(.94);
}
.window-controls.mac-traffic-lights #window-minimize:hover,
.window-controls.mac-traffic-lights #window-maximize:hover {
  filter: brightness(.94);
}
body.window-inactive .window-controls.mac-traffic-lights button {
  background: #d4d4d8 !important;
  border-color: #c4c4c9 !important;
  color: #52525b !important;
}
.window-controls.mac-traffic-lights button svg {
  width: 8px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity .12s;
}
.window-controls.mac-traffic-lights:hover button svg,
.window-controls.mac-traffic-lights:focus-within button svg {
  opacity: 1;
}
.app-shell:not(.sidebar-collapsed) .sidebar {
  padding-top: 0;
}
.page-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sidebar-toggle-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 7px;
  color: #6b7280;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.sidebar-toggle-btn:hover {
  background: #f1f1f4;
  color: var(--ink);
}
.sidebar-toggle-btn svg {
  width: 16px;
  height: 16px;
}
.comments-page .comment-ai-title-group {
  gap: 10px 14px;
}
.inbox-page:not(.comments-page) .list-controls .sidebar-toggle-btn {
  margin-right: 2px;
}

/* Zernio-style full-width publishing & scheduled calendar */
.calendar-page .calendar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calendar-shell.calendar-full {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.calendar-shell.calendar-full .calendar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.calendar-bar-left,
.calendar-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.calendar-bar-left .icon-button {
  width: 28px;
  height: 28px;
  font-size: 16px;
  color: #52525b;
}
#calendar-month-select {
  height: 30px;
  padding: 0 24px 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
#calendar-month-select:hover,
#calendar-month-select:focus {
  border-color: var(--line);
  background: #fafafa;
  outline: none;
}
.calendar-bar-right>.button[data-month="0"] {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 7px;
  background: #fff;
}
.calendar-week-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calendar-week-label {
  font-size: 11.5px;
  color: #71717a;
}
.calendar-week-btns {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f4f6;
  padding: 2px;
  gap: 2px;
}
.calendar-week-btns button {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: #52525b;
  background: transparent;
}
.calendar-week-btns button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.calendar-shell.calendar-full .month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 0;
  margin-top: 0;
}
.calendar-shell.calendar-full .month-grid>b {
  background: #fff;
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #71717a;
  letter-spacing: .04em;
}
.calendar-shell.calendar-full .plan-day {
  background: #fff;
  min-height: 112px;
  padding: 6px 7px 8px;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.calendar-shell.calendar-full .plan-day.outside {
  background: #fafafa;
}
.calendar-shell.calendar-full .plan-day.outside .day-number {
  color: #a1a1aa;
}
.calendar-shell.calendar-full .plan-day.is-today {
  box-shadow: inset 0 0 0 1.5px #e03313;
  background: #fffdfb;
}
.calendar-shell.calendar-full .plan-day .day-number {
  margin-left: auto;
  padding: 1px 5px;
  font-size: 12px;
  font-weight: 500;
  color: #3f3f46;
  border-radius: 5px;
  min-width: 24px;
  text-align: right;
}
.calendar-shell.calendar-full .plan-day .day-number:hover {
  background: #f3f3f6;
}
.calendar-shell.calendar-full .plan-day.is-today .day-number {
  background: transparent;
  color: #e03313;
  font-weight: 700;
}
.calendar-post-card,
.calendar-shell.calendar-full .plan-entry {
  width: 100%;
  text-align: left;
  border: 1px solid #e6e6eb;
  border-left: 3px solid #22c55e;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin: 0;
  transition: border-color .12s, background .12s;
}
.calendar-post-card:hover {
  background: #f8fcf9;
  border-color: #cbd5e1;
  border-left-color: #16a34a;
}
.calendar-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #71717a;
  font-variant-numeric: tabular-nums;
}
.calendar-card-plat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #3f3f46;
}
.calendar-card-plat svg {
  width: 12px;
  height: 12px;
}
.calendar-card-caption {
  font-size: 11.5px;
  line-height: 1.35;
  color: #18181b;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.calendar-card-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  font-size: 10.5px;
  color: #52525b;
  font-variant-numeric: tabular-nums;
}
.calendar-card-metrics>span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.calendar-card-metrics svg {
  width: 11px;
  height: 11px;
  color: #71717a;
}
.calendar-shell.calendar-full .plan-entry {
  border-left-color: #71717a;
}
.calendar-shell.calendar-full .plan-entry.scheduled-entry {
  border-color: #f3cbc3;
  border-left: 3px solid #e03313;
  background: #fff9f8;
}
.calendar-shell.calendar-full .plan-entry b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  font-weight: 500;
}
.scheduled-clock-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.calendar-sched-dot {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 4px;
  background: #fde8e3;
  color: #9e210a;
}
.calendar-shell.calendar-full .plan-entry>span {
  font-size: 11.5px;
  line-height: 1.35;
  color: #18181b;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.calendar-more-btn {
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 500;
  color: #71717a;
  text-align: left;
  background: transparent;
}
.calendar-more-btn:hover {
  color: #e03313;
}
@media(max-width:860px) {
  .calendar-shell.calendar-full .month-grid {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
  }
}

.published-view-controls .calendar-nav-button[aria-pressed="true"] .calendar-count-badge {
  background: #fff;
  color: #e03313;
}

/* Zernio-style Messages (Tin nhắn) workspace */
#main[data-page=inbox] .inbox-page {
  display: flex;
  flex-direction: column;
}
#main[data-page=inbox] .inbox-page-header {
  min-height: 63px;
  padding: 13px 28px;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#main[data-page=inbox] .inbox-page-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
#main[data-page=inbox] .inbox-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
#main[data-page=inbox] .conversation-list {
  width: clamp(320px, 26vw, 370px);
  background: var(--workspace-bg);
  border-right: 1px solid var(--line);
}
.inbox-list-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
.inbox-list-toolbar .list-search {
  flex: 1 1 0;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inbox-list-toolbar .list-search svg {
  width: 14px;
  height: 14px;
  color: #8e8e93;
  flex: none;
}
.inbox-list-toolbar .list-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink);
}
.inbox-list-toolbar .inbox-filter-select {
  height: 32px;
  max-width: 118px;
  flex: 0 1 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  background: #fff;
  color: #3f3f46;
  cursor: pointer;
}
.inbox-list-toolbar .list-sync-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.inbox-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  flex-shrink: 0;
}
.inbox-subbar-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.inbox-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #71717a;
  letter-spacing: .04em;
}
.inbox-subbar .list-count {
  margin: 0;
  font-size: 11px;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}
#main[data-page=inbox] .inbox-subbar .list-status-tabs {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 3px;
  flex: 0 0 auto;
  max-width: 100%;
  background: #ededf0;
  border: 0;
  border-radius: 7px;
}
#main[data-page=inbox] .inbox-subbar .list-status-tabs .tab {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  color: #52525b;
  font-weight: 500;
  border: 0;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
}
#main[data-page=inbox] .inbox-subbar .list-status-tabs .tab.active {
  background: #e03313;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
#main[data-page=inbox] .inbox-subbar .list-status-tabs .tab-count {
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  font-size: 10px;
}
#main[data-page=inbox] .conversation {
  width: 100%;
  margin: 0;
  min-height: 0;
  padding: 11px 14px 11px 11px;
  gap: 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #f0f0f3;
  border-radius: 0;
  background: #fff;
  align-items: center;
}
#main[data-page=inbox] .conversation:hover {
  background: #fafafa;
}
#main[data-page=inbox] .conversation.selected {
  background: #fff7f5;
  border-color: #f0f0f3;
  border-left: 3px solid #e03313;
}
#main[data-page=inbox] .conversation>.avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
  flex-shrink: 0;
}
.conversation-name-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#main[data-page=inbox] .conversation strong {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
  flex: 0 1 auto;
}
.conversation-via {
  font-size: 11.5px;
  color: #71717a;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
#main[data-page=inbox] .conversation time {
  font-size: 11px;
  color: #8e8e93;
  flex-shrink: 0;
}
.conversation-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
#main[data-page=inbox] .conversation .conversation-preview-row p {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #71717a;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#main[data-page=inbox] .conversation.is-unread .conversation-preview-row p {
  color: #18181b;
  font-weight: 500;
}
#main[data-page=inbox] .conversation .unread {
  position: static;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  font-size: 10px;
}
#main[data-page=inbox] .chat {
  background: var(--workspace-bg);
}
#main[data-page=inbox] .chat-tabs {
  min-height: 58px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
#main[data-page=inbox] .chat-contact strong {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
}
.chat-contact-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: #71717a;
}
.chat-reply-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f4f4f6;
  color: #3f3f46;
  font-size: 11.5px;
  font-weight: 500;
}
.chat-reply-pill svg {
  width: 12px;
  height: 12px;
}
.chat-contact-sep {
  color: #71717a;
  font-size: 11.5px;
}
#main[data-page=inbox] .chat-scroll {
  background: var(--workspace-bg);
  padding: 20px 24px;
}
#main[data-page=inbox] .chat-date-divider span {
  background: #f4f4f5;
  border: 0;
  border-radius: 6px;
  color: #71717a;
  padding: 3px 10px;
  font-size: 11px;
}
#main[data-page=inbox] #chat .message {
  margin: 0 0 12px;
}
#main[data-page=inbox] #chat .bubble {
  background: #f4f4f5;
  border: 1px solid #ececf0;
  color: #18181b;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  padding: 9px 13px 7px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: none;
}
#main[data-page=inbox] #chat .outgoing .bubble {
  background: #fae2dc;
  border: 1px solid #f4cbc2;
  color: #1f1716;
  border-radius: 10px;
  border-bottom-right-radius: 3px;
}
#main[data-page=inbox] #chat .outgoing time {
  color: #6b4740;
}
#main[data-page=inbox] .composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 20px 16px;
  padding: 10px 12px 8px;
  min-height: 82px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
#main[data-page=inbox] .composer textarea {
  flex: 0 0 auto;
  width: 100%;
  min-height: 38px;
  max-height: 140px;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.5;
}
#main[data-page=inbox] .composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
#main[data-page=inbox] .composer #send-button {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12.5px;
}

@media(max-width:740px) {
  .app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
    padding: 12px 16px;
    min-height: 54px;
  }
  .app-shell :is(.competitor-page>.content-inner, .publish-page>.published-posts, .workspace-page>.content-inner) {
    padding: 12px 16px 24px;
  }
  .app-shell .news-page>.news-layout {
    padding: 14px 16px 24px;
  }
  #main[data-page=inbox] .conversation-list {
    width: 100%;
    border-right: 0;
  }
  #main[data-page=inbox] .composer {
    margin: 6px 12px 12px;
  }
}

/* Zernio-style Comments workspace */
.comments-page .inbox-body {
  background: var(--workspace-bg);
}
.comments-page .conversation-list {
  width: clamp(320px, 26vw, 370px);
  background: var(--workspace-bg);
  border-right: 1px solid var(--line);
}
.comments-subbar-hint {
  font-size: 11px;
  color: #71717a;
}
.comments-page .post-row {
  width: 100%;
  margin: 0;
  padding: 10px 12px 10px 10px;
  gap: 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #f0f0f3;
  background: #fff;
  align-items: flex-start;
}
.comments-page .post-row:hover {
  background: #fafafa;
}
.comments-page .post-row.selected {
  background: #fff7f5;
  border-color: #f0f0f3;
  border-left: 3px solid #e03313;
}
.comments-page .post-thumb {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: #f4f4f6;
}
.comments-page .post-thumb>svg {
  width: 20px;
  height: 20px;
}
.comments-page .post-caption {
  font-size: 12.5px;
  font-weight: 600;
  color: #18181b;
  line-height: 1.4;
}
.comments-page .post-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: #71717a;
}
.post-meta-plat {
  display: inline-flex;
  align-items: center;
}
.post-meta-plat svg {
  width: 13px;
  height: 13px;
}
.comments-page .post-account {
  display: inline;
  margin: 0;
  font-size: 11.5px;
  color: #52525b;
  max-width: 140px;
}
.post-meta-comments {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #71717a;
}
.post-meta-comments svg {
  width: 12px;
  height: 12px;
}
.comments-page #chat {
  background: var(--workspace-bg);
  min-height: 0;
}
.comments-page .comments-header {
  height: auto;
  min-height: 46px;
  padding: 7px 20px;
  gap: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  flex-wrap: wrap;
}
.comments-page .comments-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  margin: 0;
}
.comments-page .comments-header h2 span {
  font-weight: 500;
  color: #71717a;
}
.comments-header-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.comments-page .comment-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #ededf0;
  border-radius: 6px;
}
.comments-page .comment-filter-tabs .tab {
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 0;
  font-size: 11px;
  font-weight: 500;
  color: #52525b;
}
.comments-page .comment-filter-tabs .tab.active {
  background: #e03313;
  color: #fff;
}
.comments-header-controls select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11.5px;
  background: #fff;
  color: #3f3f46;
  cursor: pointer;
}
.comments-header-controls #reload-chat {
  margin-left: 0;
  width: 28px;
  height: 28px;
}
.comments-page .comments-scroll {
  padding: 16px 20px 24px;
  background: var(--workspace-bg);
}
.comments-page .comments-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comments-page .comments-stream>.comment-item {
  padding: 12px 14px;
  gap: 10px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
}
.comments-page .comments-stream>.comment-item.selected-comment {
  border-color: #d4d4d8;
  background: #fafafa;
  box-shadow: none;
}
.comments-page .comment-avatar .avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.comments-page .comment-heading {
  gap: 6px;
  margin-bottom: 3px;
}
.comments-page .comment-heading strong {
  font-size: 13px;
  font-weight: 600;
  color: #18181b;
}
.comments-page .own-label {
  background: #fef3c7;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.comments-page .comment-text {
  font-size: 13px;
  line-height: 1.5;
  color: #27272a;
  margin: 0;
}
.comments-page .comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.comments-page .comment-actions time {
  font-size: 11.5px;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}
.comments-page .comment-likes {
  font-size: 11.5px;
  color: #9e210a;
  gap: 3px;
}
.comments-page .comment-reply {
  font-size: 11.5px;
  font-weight: 500;
  color: #9e210a;
  padding: 0;
  gap: 4px;
}
.comments-page .comment-reply:hover {
  color: #e03313;
}
.comments-page .comment-replies {
  margin-top: 10px;
  border-left: 2px solid #e4e4e7;
  padding-left: 12px;
}
.comments-page .comment-replies>summary {
  font-size: 11.5px;
  color: #71717a;
  padding: 2px 0 6px;
}
.comments-page .comment-replies .comment-item {
  padding: 10px 12px;
  gap: 8px;
  border: 1px solid #ececf0;
  border-radius: 6px;
  background: #fafafa;
  margin-bottom: 6px;
}
.comments-page .comment-replies .own-comment,
.comments-page .comment-saved-reply {
  background: #fff6f4;
  border: 1px solid #f4d6cf;
}
.comments-page .comment-replies .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.comment-bottom-composer {
  flex-shrink: 0;
  padding: 10px 20px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.comments-page .comment-composer {
  margin: 0;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 9px 12px 7px;
  background: #fff;
}
.comments-page .comment-composer:focus-within {
  border-color: #a1a1aa;
  box-shadow: none;
}
.comments-page .comment-composer textarea:focus-visible,
#main[data-page=inbox] .composer textarea:focus-visible,
.inbox-list-toolbar .list-search input:focus-visible {
  outline: none;
}
.inbox-list-toolbar .list-search:focus-within {
  border-color: #a1a1aa;
  box-shadow: none;
}
.comments-page .comment-composer textarea {
  min-height: 36px;
  max-height: 110px;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
}
.comments-page .comment-composer-actions {
  padding-top: 4px;
}
.comments-page .comment-composer-actions #send-button {
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 6px;
}
@media(max-width:740px) {
  .comments-page .conversation-list {
    width: 100%;
    border-right: 0;
  }
  .comments-page .comments-scroll {
    padding: 12px 14px 20px;
  }
  .comment-bottom-composer {
    padding: 8px 12px 10px;
  }
}

/* Multi-user Admin RBAC, Auth Landing & iPhone PWA Polish */
dialog {
  overflow-y: auto;
}
.auth-landing-page {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px 16px;
}
.auth-landing-card {
  width: min(400px, 100%);
  padding: 32px 26px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.auth-landing-card h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.auth-landing-card p {
  font-size: 13px;
  line-height: 1.55;
  color: #71717a;
  margin: 0;
}
.auth-landing-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
}
.tiktoday-page { min-width: 0; }
.tiktoday-body { container: tiktoday / inline-size; padding-block: 20px 28px; }
.tiktoday-directory {
  --shop-line: #ebe8e4;
  --shop-muted: #69645f;
  border: 1px solid var(--shop-line);
  border-radius: 10px;
  background: #fff;
}
.tiktoday-top, .tiktoday-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
}
.tiktoday-top { justify-content: space-between; padding-block: 0; border-bottom: 1px solid var(--shop-line); }
.tiktoday-tabs { display: flex; gap: 14px; min-width: 0; }
.tiktoday-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--shop-muted);
  font: inherit;
  white-space: nowrap;
}
.tiktoday-tabs button[aria-pressed="true"] { border-bottom-color: var(--primary); color: var(--ink); font-weight: 600; }
.tiktoday-directory :is(.tiktoday-tabs, .tiktoday-toolbar) svg { width: 15px; height: 15px; flex: none; }
.tiktoday-directory .tiktoday-feed-settings { flex: none; max-width: min(36%,190px); min-height: 30px; padding-inline: 8px; border-color: transparent; background: transparent; color: var(--shop-muted); }
.tiktoday-feed-settings svg { width: 15px; height: 15px; }
.tiktoday-feed-settings span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiktoday-toolbar { padding-block: 8px; }
.tiktoday-toolbar #shop-search { flex: 0 1 360px; min-width: 0; margin-inline-start: auto; }
.tiktoday-result-summary { color: var(--shop-muted); min-width: 0; font-size: 12px; }
.tiktoday-result-summary strong { color: var(--ink); }
.tiktoday-toolbar :is(.button,select) { min-height: 34px; }
.tiktoday-directory select { border: 1px solid var(--shop-line); padding: 0 8px; border-radius: 7px; background: #fff; }
.tiktoday-search-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--shop-line);
  border-radius: 7px;
  color: var(--shop-muted);
}
.tiktoday-search-field label { display: flex; align-items: center; flex: 1; min-width: 0; gap: 7px; padding-inline: 9px 5px; }
.tiktoday-search-field:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.tiktoday-search-field input[type="search"] {
  flex: 1;
  height: 35px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
}
.tiktoday-search-field #shop-submit { min-width: 53px; padding-inline: 8px; border-color: transparent; background: transparent; box-shadow: none; color: var(--ink); }
.tiktoday-search-field #shop-submit:hover { background: #f7f4f1; }
.tiktoday-options { position: relative; flex: none; }
.tiktoday-options > summary { display: grid; width: 38px; place-items: center; padding: 0; list-style: none; cursor: pointer; }
.tiktoday-options > summary::-webkit-details-marker { display: none; }
.tiktoday-options[open] > summary { background: #f4f0ec; }
.tiktoday-options-panel {
  display: grid;
  gap: 6px;
  position: absolute;
  z-index: 5;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  width: 188px;
  padding: 10px;
  border: 1px solid var(--shop-line);
  border-radius: 8px;
  background: #fff;
  color: var(--shop-muted);
  box-shadow: 0 6px 20px #29211a1a;
  font-size: 12px;
}
.tiktoday-options-panel select + label { margin-top: 3px; }
.tiktoday-option-actions { display: grid; border-top: 1px solid var(--shop-line); margin-top: 3px; padding-top: 4px; }
.tiktoday-option-actions button { display: flex; align-items: center; gap: 7px; min-height: 34px; text-align: start; padding-inline: 5px; }
.tiktoday-growth-positive { color: #186c45; font-weight: 600; }
.tiktoday-selection svg { width: 15px; height: 15px; }
.tiktoday-choices:not([hidden]) {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  padding: 4px 15px;
  background: #fbf9f7;
  border-top: 1px solid var(--shop-line);
}
.tiktoday-select-page, .tiktoday-row-check { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tiktoday-select-page, .tiktoday-row-check input { min-width: 15px; }
.tiktoday-select-page { min-height: 20px; }
.tiktoday-select-page span { display: none; }
.tiktoday-select-page input, .tiktoday-row-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.tiktoday-selection { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tiktoday-selection > span { font-size: 12px; white-space: nowrap; }
.tiktoday-selection :is(.button,.icon-button) { min-height: 34px; padding-inline: 8px; }
.tiktoday-table .tiktoday-select-cell { width: 50px; text-align: center; }
.tiktoday-table .tiktoday-select-cell .tiktoday-row-check { justify-content: center; min-height: 32px; }
.tiktoday-table tbody tr:has([data-shop-select]:checked) { background: #fff6f0; }
.tiktoday-pages { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 15px; border-top: 1px solid var(--shop-line); }
.tiktoday-pages > div { display: flex; gap: 6px; }
.tiktoday-pages > span { font-size: 12px; color: var(--shop-muted); }
.tiktoday-message-list { list-style: none; margin: 0; padding: 0; }
.tiktoday-message-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 8px; border-top: 1px solid #ebe8e4; }
.tiktoday-message-list .button { flex: none; }
.tiktoday-overflow { overflow-x: auto; border-radius: 0 0 9px 9px; }
.tiktoday-table { width: 100%; border-collapse: collapse; text-align: start; font-size: 13px; }
.tiktoday-table :is(th,td) { padding: 10px 13px; text-align: start; border-top: 1px solid var(--shop-line); }
.tiktoday-table thead th { color: var(--shop-muted); background: #f8f7f5; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tiktoday-table tbody th { min-width: 195px; font-weight: 400; }
.tiktoday-table .tiktoday-identity > span:last-child { max-width: 28rem; }
.tiktoday-table .tiktoday-identity strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tiktoday-table tbody tr:hover { background: #fcfbf9; }
.tiktoday-table .tiktoday-action { white-space: nowrap; }
.tiktoday-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tiktoday-identity > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.tiktoday-identity small { display: block; margin-top: 2px; color: #69645f; font-size: 11.5px; }
.tiktoday-thumb { position: relative; display: grid; place-items: center; overflow: hidden; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 7px; background: #f1efec; color: #69645f; }
.tiktoday-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #f1efec; }
.tiktoday-thumb svg { width: 17px; height: 17px; }
.tiktoday-empty { margin: 0; padding: 5px 15px 18px; color: var(--shop-muted); font-size: 13px; }
.tiktoday-message { margin: 0 15px 10px; }
#modal:has(#shop-detail) { width: min(640px,calc(100vw - 20px)); }
#modal:has(#shop-detail) .modal-body > p:empty { display: none; }
.tiktoday-detail h3 { font-size: 16px; margin-block: 10px; overflow-wrap: anywhere; }
.tiktoday-detail-identity .tiktoday-thumb { width: 50px; height: 50px; flex-basis: 50px; }
.tiktoday-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.tiktoday-details-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 0 14px; margin: 12px 0; }
.tiktoday-details-grid div { min-width: 0; border-top: 1px solid #ebe8e4; padding-block: 8px; }
.tiktoday-details-grid dt { color: #69645f; font-size: 12px; }
.tiktoday-details-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.tiktoday-gallery { display: flex; gap: 8px; overflow-x: auto; }
.tiktoday-gallery img { width: 94px; height: 94px; flex: none; object-fit: cover; border-radius: 6px; }
.tiktoday-description { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.tiktoday-video-list { list-style: none; padding: 0; }
.tiktoday-video-list li { display: grid; gap: 3px; padding-block: 7px; border-top: 1px solid #ebe8e4; }
.tiktoday-video-list button { text-align: start; white-space: normal; }
.tiktoday-player { display: block; width: min(100%,405px); height: min(60dvh,510px); margin-inline: auto; border: 0; border-radius: 8px; background: #171717; }
.tiktoday-video-status { margin-top: 8px; color: var(--muted); font-size: 12px; }
.tiktoday-video-status:empty { display: none; }
@container tiktoday (max-width: 620px) {
  .tiktoday-tabs { gap: 8px; font-size: 12px; }
  .tiktoday-top, .tiktoday-toolbar, .tiktoday-choices, .tiktoday-pages { padding-inline: 10px; }
  .tiktoday-table, .tiktoday-table tbody { display: block; }
  .tiktoday-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .tiktoday-table thead:has(.tiktoday-select-page) { position: static; display: block; clip-path: none; width: auto; height: auto; }
  .tiktoday-table thead:has(.tiktoday-select-page) tr { display: block; }
  .tiktoday-table thead:has(.tiktoday-select-page) th:not(.tiktoday-select-cell) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; }
  .tiktoday-table thead .tiktoday-select-cell { display: block; width: auto; padding: 0 10px; }
  .tiktoday-select-page { justify-content: start; gap: 8px; }
  .tiktoday-select-page span { display: inline; }
  .tiktoday-table tbody tr { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; border-top: 1px solid var(--shop-line); padding: 11px 12px; }
  .tiktoday-table tbody :is(th,td) { border: 0; padding: 0; overflow-wrap: anywhere; }
  .tiktoday-table tbody th { grid-column: 1 / -1; min-width: 0; padding-inline-end: 40px; }
  .tiktoday-table tbody tr:has(.tiktoday-select-cell) th { padding-inline: 38px 40px; }
  .tiktoday-table tbody .tiktoday-select-cell { position: absolute; inset-block-start: 8px; inset-inline-start: 7px; width: 36px; }
  .tiktoday-table td[data-label]::before { content: attr(data-label); display: block; color: var(--shop-muted); font-size: 11px; margin-bottom: 2px; }
  .tiktoday-action { position: absolute; inset-block-start: 13px; inset-inline-end: 12px; }
}

.admin-body {
  --admin-surface: #fff;
  --admin-subtle: #f8f7f5;
  --admin-line: #ebe8e4;
  --admin-secondary: #6b6763;
  container: admin-directory / inline-size;
  display: grid;
  align-content: start;
  gap: 18px;
  padding-top: 20px;
  padding-bottom: 32px;
}
.admin-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: var(--admin-surface);
}
.admin-stat {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 15px clamp(12px, 2.1cqw, 24px);
}
.admin-stat + .admin-stat { border-inline-start: 1px solid var(--admin-line); }
.admin-stat dt {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--admin-secondary);
  font-size: 12.5px;
  line-height: 1.35;
}
.admin-stat dt svg { width: 15px; height: 15px; flex: none; }
.admin-stat dd {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  color: var(--ink);
}
.admin-directory {
  min-width: 0;
  background: var(--admin-surface);
  border: 1px solid var(--admin-line);
  border-radius: 10px;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.admin-toolbar .admin-refresh {
  width: 36px;
  height: 36px;
  color: var(--admin-secondary);
}
.admin-toolbar .admin-create { min-height: 36px; white-space: nowrap; }
.admin-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(370px, 100%);
  min-width: 0;
  padding-inline: 11px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  color: var(--admin-secondary);
}
.admin-search-field:focus-within { outline: 2px solid var(--focus, #c65038); outline-offset: 1px; }
.admin-search-field svg { width: 16px; height: 16px; flex: none; }
.admin-search-field input[type="search"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
  font-size: 13px;
}
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  padding-inline: 16px;
  border-bottom: 1px solid var(--admin-line);
}
.admin-filters button {
  min-height: 34px;
  padding: 0 1px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--admin-secondary);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
}
.admin-filters button:hover,
.admin-filters button[aria-pressed="true"] { color: var(--ink); }
.admin-filters button[aria-pressed="true"] {
  border-bottom-color: var(--primary, #dc391f);
  font-weight: 600;
}
.admin-notice { margin: 12px 16px; }
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  text-align: start;
  font-size: 13px;
}
.admin-col-identity { width: 26%; }
.admin-col-role { width: 13%; }
.admin-col-status { width: 12%; }
.admin-col-integrations { width: 15%; }
.admin-col-date { width: 10%; }
.admin-col-actions { width: 48px; }
.admin-table th, .admin-table td {
  text-align: start;
  vertical-align: middle;
  padding: 12px 9px;
  overflow-wrap: anywhere;
}
.admin-table :is(th, td):first-child { padding-inline-start: 16px; }
.admin-table thead th {
  padding-block: 10px;
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-subtle);
  color: var(--admin-secondary);
  font-size: 12px;
  font-weight: 600;
}
.admin-table tbody th { font-weight: 400; }
.admin-table tbody tr + tr > * { border-top: 1px solid var(--admin-line); }
.admin-table tbody tr:hover > * { background: #fcfbf9; }
.admin-table tbody tr:last-child > :first-child { border-bottom-left-radius: 10px; }
.admin-table tbody tr:last-child > :last-child { border-bottom-right-radius: 10px; }
.admin-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}
.admin-identity .admin-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  flex: none;
  font-size: 11px;
  font-weight: 600;
}
.admin-identity-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.admin-identity-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
}
.admin-identity-name strong { font-size: 13.5px; font-weight: 650; }
.admin-secondary, .admin-integrations-cell, .admin-date-cell {
  color: var(--admin-secondary);
  font-size: 12px;
}
.admin-date-cell time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-self {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1efec;
  color: var(--admin-secondary);
  font-size: 10.5px;
}
.admin-role, .admin-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.admin-role.is-admin { color: #62458a; font-weight: 600; }
.admin-role svg { width: 13px; height: 13px; flex: none; }
.admin-status {
  padding: 3px 7px;
  border-radius: 5px;
  background: #eaf5ee;
  color: #24613d;
  font-weight: 500;
}
.admin-status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.admin-status.is-locked { background: #fcf0ea; color: #94402a; }
.admin-actions-cell { padding-inline: 2px 12px !important; }
.admin-row-menu { position: relative; width: max-content; margin-inline-start: auto; }
.admin-row-menu summary {
  width: 32px;
  min-width: 32px;
  height: 32px;
  list-style: none;
  border: 0;
  background: transparent;
  color: var(--admin-secondary);
}
.admin-row-menu summary::-webkit-details-marker { display: none; }
.admin-row-menu summary:hover,
.admin-row-menu[open] summary { background: #f2efec; color: var(--ink); }
.admin-row-menu summary svg { width: 17px; height: 17px; }
.admin-row-actions {
  position: absolute;
  z-index: 5;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 4px);
  width: max-content;
  min-width: 172px;
  padding: 4px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: var(--admin-surface);
  box-shadow: 0 7px 22px #241b1518;
}
.admin-account-row:nth-child(n+3):nth-last-child(-n+2) .admin-row-actions {
  inset-block: auto calc(100% + 4px);
}
.admin-row-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  text-align: start;
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
}
.admin-row-actions button:hover { background: var(--admin-subtle); }
.admin-row-actions button[data-admin-delete] { color: #aa3428; }
.admin-row-actions button svg { width: 15px; height: 15px; flex: none; }
.admin-empty {
  min-height: 154px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 18px;
  text-align: center;
  color: var(--admin-secondary);
  font-size: 13px;
}
.admin-empty strong { color: var(--ink); font-weight: 600; }
.admin-empty-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--admin-subtle);
}
.admin-empty-icon svg { width: 17px; height: 17px; }
.admin-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@container admin-directory (max-width: 740px) {
  .admin-table, .admin-table tbody { display: block; }
  .admin-table colgroup { display: none; }
  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .admin-table .admin-account-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 15px;
    padding: 12px 15px;
  }
  .admin-table tbody tr + tr { border-top: 1px solid var(--admin-line); }
  .admin-table .admin-account-row > :is(th, td) {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .admin-table .admin-account-row > .admin-identity-cell { grid-column: 1 / -1; padding-inline-end: 38px; }
  .admin-table td[data-label]::before {
    display: block;
    content: attr(data-label);
    margin-bottom: 2px;
    color: var(--admin-secondary);
    font-size: 11px;
  }
  .admin-table .admin-actions-cell {
    position: absolute;
    inset-block-start: 11px;
    inset-inline-end: 12px;
    padding: 0 !important;
  }
  .admin-row-menu summary { width: 36px; height: 36px; }
}
@container admin-directory (max-width: 450px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stat + .admin-stat { border-inline-start: 0; }
  .admin-stat:nth-child(even) { border-inline-start: 1px solid var(--admin-line); }
  .admin-stat:nth-child(n+3) { border-top: 1px solid var(--admin-line); }
  .admin-stat { padding: 10px 12px; }
  .admin-stat dd { font-size: 22px; }
  .admin-toolbar { gap: 7px; padding: 12px 11px 7px; }
  .admin-toolbar-actions { gap: 4px; }
  .admin-toolbar .admin-create { padding-inline: 8px; font-size: 12px; }
  .admin-filters { gap: 0 11px; padding-inline: 11px; }
}
@container admin-directory (max-width: 330px) {
  .admin-toolbar { flex-wrap: wrap; }
  .admin-toolbar-actions { margin-inline-start: auto; }
  .admin-search-field { width: 100%; }
}

#modal:has(.admin-form) { width: min(540px, calc(100vw - 24px)); }
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-form :is(.form-field, .form-field:last-child) { margin: 0; }
.admin-form label { font-weight: 600; }
.admin-form .admin-form-access {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ebe8e4;
}
.admin-lock-field {
  display: flex;
  align-self: end;
  gap: 8px;
  padding-block: 4px;
}
.admin-lock-field input { align-self: start; margin-top: 2px; }
.admin-lock-field span { display: grid; gap: 3px; }
.admin-lock-field strong { font-size: 12px; font-weight: 600; }
.admin-lock-field small { color: #6b6763; font-size: 11.5px; font-weight: 400; }
.admin-form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}
.admin-password-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-password-row input {
  flex: 1;
  min-width: 0;
}
.admin-password-row .button { flex: none; white-space: nowrap; }
@media (max-width: 460px) {
  .admin-form-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-password-row { align-items: stretch; flex-direction: column; }
  .admin-password-row .button { align-self: start; }
}
.admin-share-box pre {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.account-modal-card {
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fafafa;
}

/* Unified Responsive Architecture, Outgoing Attachment Contrast & Calendar Agenda */
.message.outgoing .file-attachment.is-muted {
  background: rgba(158, 33, 10, 0.08);
  border-color: rgba(158, 33, 10, 0.22);
  color: #6b2418;
}

.mobile-bottom-nav,
.mobile-nav-backdrop,
.mobile-drawer-close,
.knowledge-back-mobile {
  display: none;
}

#mobile-nav-backdrop[hidden],
#mobile-bottom-nav[hidden] {
  display: none !important;
}

.calendar-agenda {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.agenda-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agenda-day.is-today {
  border-color: #f3b8ad;
  background: #fff9f7;
}

.agenda-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agenda-day-date {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agenda-day-num {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f4f4f5;
  color: #18181b;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.agenda-day.is-today .agenda-day-num {
  background: #e03313;
  color: #fff;
}

.agenda-day-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agenda-day-meta strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.agenda-day-meta small {
  font-size: 12px;
  color: #71717a;
}

.agenda-day-add {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
  flex-shrink: 0;
}

.agenda-day-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agenda-day-items :is(.plan-entry, .calendar-post-card) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 9px;
  text-align: left;
}

.agenda-day-items .calendar-card-caption {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agenda-day-empty {
  margin: 0;
  font-size: 12.5px;
  color: #71717a;
}

.agenda-empty-month {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.agenda-empty-month svg {
  width: 24px;
  height: 24px;
  color: #9e210a;
}

.agenda-empty-month strong {
  font-size: 14px;
  color: var(--ink);
}

.agenda-empty-month p {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: #71717a;
  max-width: 320px;
}

/* Short viewports / mobile landscape */
@media(max-height:560px) {
  .sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar nav {
    flex: 1 0 auto;
    overflow: visible;
  }

  .sidebar-brand-row {
    margin-bottom: 10px;
  }

  .sidebar-footer {
    flex-shrink: 0;
  }

  dialog {
    max-height: calc(100dvh - 16px);
  }
}

/* Tablet layout (741px - 960px) */
@media(min-width:741px) and (max-width:960px) {
  :root {
    --sidebar: 68px;
  }

  .app-shell:not(.sidebar-collapsed) .sidebar {
    width: 68px;
    padding: 14px 8px;
  }

  .app-shell:not(.sidebar-collapsed) .sidebar-brand-row {
    justify-content: center;
  }

  .app-shell:not(.sidebar-collapsed) .brand {
    justify-content: center;
    padding: 0;
  }

  .app-shell:not(.sidebar-collapsed) .brand>span:last-child,
  .app-shell:not(.sidebar-collapsed) .brand-name,
  .app-shell:not(.sidebar-collapsed) .workspace-switch,
  .app-shell:not(.sidebar-collapsed) .nav-group-label,
  .app-shell:not(.sidebar-collapsed) .nav-item>span,
  .app-shell:not(.sidebar-collapsed) .sidebar-footer-item>span:not(:first-child),
  .app-shell:not(.sidebar-collapsed) .sidebar-account-text,
  .app-shell:not(.sidebar-collapsed) .sidebar-account>.sidebar-chevron,
  .app-shell:not(.sidebar-collapsed) .mode-pill {
    display: none;
  }

  .app-shell:not(.sidebar-collapsed) .nav-item {
    justify-content: center;
    padding: 10px 0;
    min-height: 42px;
  }

  .app-shell:not(.sidebar-collapsed) .sidebar-footer-item,
  .app-shell:not(.sidebar-collapsed) .sidebar-account {
    justify-content: center;
    padding-inline: 0;
  }

  .app-shell:not(.sidebar-collapsed) .sidebar-utilities .top-actions {
    justify-content: center;
  }

  #main[data-page=inbox] .conversation-list,
  .comments-page .conversation-list {
    width: clamp(236px, 31vw, 290px);
  }

  .app-shell :is(.page-heading, .comments-page .comment-ai-header, .connections-header, .settings-header) {
    padding: 12px 18px;
  }

  .app-shell .content-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .app-shell .sidebar-toggle-btn {
    display: none;
  }

  .comments-page .comment-ai-header,
  .comments-page .comment-ai-title-group {
    justify-content: flex-start;
  }

  .dash-kpi-cell:last-child {
    grid-column: 1 / -1;
  }

  .dash-kpi-cell:nth-child(odd):not(:last-child) {
    border-right: 1px solid var(--line);
  }

  .knowledge-workspace {
    display: flex;
    flex-direction: column;
  }

  .knowledge-split {
    flex: 1;
    min-height: 360px;
  }
}

/* Mobile Unified Layout (<= 740px) */
@media(max-width:740px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a,
  [role="button"],
  summary {
    touch-action: manipulation;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  form select {
    font-size: 16px !important;
  }

  .app-shell {
    display: block;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  .app-shell.is-unauthed {
    padding-bottom: env(safe-area-inset-bottom);
  }

  #main {
    width: 100%;
    height: 100%;
    min-width: 0;
  }

  .inbox-page,
  .content-page {
    height: calc(100dvh - env(safe-area-inset-top) - 62px - env(safe-area-inset-bottom));
    min-height: 0;
  }

  .app-shell.is-unauthed .content-page {
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  /* Bottom Navigation Bar (5 core items) */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 251, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(24, 24, 27, 0.06);
  }

  .mobile-nav-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #71717a;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    font: inherit;
    transition: background .15s, color .15s;
  }

  .mobile-nav-btn.active {
    color: #e03313;
    background: rgba(224, 51, 19, 0.08);
    font-weight: 600;
  }

  .mobile-nav-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
  }

  .mobile-nav-ico svg {
    width: 19px;
    height: 19px;
  }

  .mobile-nav-label {
    font-size: 10.5px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mobile-nav-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e03313;
    color: #fff;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fffdfb;
  }

  .mobile-nav-dot {
    position: absolute;
    top: -1px;
    right: -3px;
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: #e03313;
    box-shadow: 0 0 0 2px #fffdfb;
  }

  /* Slide-over Navigation Drawer */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 54;
    background: rgba(24, 24, 27, 0.42);
    backdrop-filter: blur(2px);
  }

  .app-shell .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 55;
    width: min(296px, 84vw) !important;
    height: 100dvh !important;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #fffdfb !important;
    border-right: 1px solid var(--line) !important;
    border-top: 0 !important;
    box-shadow: 12px 0 36px rgba(24, 24, 27, 0.16);
    transform: translateX(-106%);
    visibility: hidden;
    pointer-events: none;
    transition: none;
  }

  .app-shell.mobile-nav-ready .sidebar {
    transition: transform .22s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .22s;
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .22s cubic-bezier(.22, 1, .36, 1), visibility 0s;
  }

  .app-shell .sidebar-brand-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
  }

  .app-shell .brand {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 0;
  }

  .app-shell .brand>span:last-child,
  .app-shell .brand-name {
    display: block !important;
  }

  .app-shell .mobile-drawer-close {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }

  .app-shell .sidebar nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: auto !important;
    margin-top: 0 !important;
    gap: 14px;
    flex: 1 0 auto;
    overflow: visible;
  }

  .app-shell .nav-group {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
  }

  .app-shell .nav-group-label {
    display: block !important;
    padding: 0 10px 4px;
  }

  .app-shell .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 44px;
    height: auto;
    padding: 9px 12px !important;
    justify-content: flex-start !important;
    gap: 11px;
    border-radius: 9px;
  }

  .app-shell .nav-item>span,
  .app-shell.sidebar-collapsed .nav-item>span {
    display: inline !important;
  }

  .app-shell .sidebar-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    margin-top: 16px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--line);
    gap: 4px;
    flex-shrink: 0;
  }

  .app-shell .sidebar-footer #sidebar-members {
    display: flex !important;
  }

  .app-shell .sidebar-footer-item,
  .app-shell .sidebar-account {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 44px;
    padding: 9px 12px !important;
    justify-content: flex-start !important;
    gap: 10px;
    border-radius: 9px;
  }

  .app-shell .sidebar-footer-item>span:not(:first-child),
  .app-shell .sidebar-account-text,
  .app-shell .sidebar-account>.sidebar-chevron {
    display: flex !important;
  }

  .app-shell .sidebar-account-text {
    flex-direction: column;
    min-width: 0;
    flex: 1;
  }

  .app-shell .sidebar-footer .sidebar-chevron {
    margin-left: auto;
  }

  .app-shell .sidebar-utilities {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
  }

  .app-shell .sidebar-utilities .mode-pill {
    display: inline-flex !important;
    padding: 0 4px 2px;
  }

  .app-shell .sidebar-utilities #help {
    display: inline-flex;
  }

  /* Compact Sticky Page Headers & Visible Drawer Trigger */
  .app-shell .sidebar-toggle-btn {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: #3f3f46;
    flex-shrink: 0;
  }

  .app-shell .page-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .app-shell .page-title-group h1,
  .app-shell .comment-ai-header h1,
  .app-shell .connections-header h1,
  .app-shell .settings-header h1 {
    font-size: 17px !important;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
    padding: 8px 14px !important;
    min-height: 54px !important;
    gap: 8px 10px;
  }

  .desktop .app-shell :is(.dashboard-analytics-page>.page-heading, .knowledge-page>.page-heading, .competitor-page>.page-heading, .workspace-page>.page-heading, .publish-page .published-heading, .comments-page .comment-ai-header, .connections-header, .settings-header, .trends-page>.page-heading, .news-page>.page-heading, .admin-page>.page-heading, #main[data-page=inbox] .inbox-page-header) {
    padding-right: 122px !important;
  }

  .app-shell :is(.competitor-page>.content-inner, .publish-page>.published-posts, .workspace-page>.content-inner, .settings-body, .connections-body, .admin-body, .news-page>.news-layout) {
    padding: 12px 14px 22px !important;
  }

  .app-shell .heading-actions {
    flex-shrink: 0;
  }

  .app-shell .heading-actions .button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  /* Hide outer page title header inside active mobile thread/comment */
  .inbox-page.has-mobile-chat .inbox-page-header,
  .inbox-page.has-mobile-chat .comment-ai-header {
    display: none !important;
  }

  /* Unified <=740px Single-Pane Inbox & Comments */
  .inbox-body {
    position: relative;
    min-height: 0;
  }

  .inbox-body .conversation-list,
  #main[data-page=inbox] .conversation-list,
  .comments-page .conversation-list {
    width: 100% !important;
    border-right: 0 !important;
  }

  .inbox-body .chat {
    display: none !important;
    width: 100% !important;
    min-width: 0;
  }

  .inbox-body.chat-open .conversation-list {
    display: none !important;
  }

  .inbox-body.chat-open .chat {
    display: flex !important;
    height: 100%;
  }

  .back-mobile {
    display: inline-flex !important;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .inbox-list-toolbar {
    padding: 8px 12px;
    gap: 6px;
  }

  .inbox-filter-select {
    font-size: 13.5px !important;
    min-height: 36px;
    max-width: 124px;
  }

  .list-sync-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .inbox-subbar {
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .app-shell .list-status-tabs .tab {
    min-height: 34px;
    padding: 4px 10px;
  }

  .conversation {
    min-height: 70px;
    padding: 12px 14px;
  }

  .chat-tabs {
    min-height: 54px;
    padding: 6px 10px;
    gap: 8px;
  }

  .chat-tab-items {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .chat-actions {
    display: flex !important;
    gap: 4px;
    flex-shrink: 0;
  }

  .chat-action-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 0 8px !important;
  }

  .chat-action-btn>span {
    display: none;
  }

  .chat-scroll {
    padding: 12px 12px 16px;
  }

  .message-wrap {
    max-width: 88%;
  }

  .composer,
  #main[data-page=inbox] .composer {
    margin: 6px 10px 10px;
  }

  .composer textarea {
    font-size: 16px !important;
  }

  .composer-toolbar .icon-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .app-shell .composer-toolbar #send-button,
  .app-shell .comments-page .comment-composer-actions .button {
    min-height: 36px !important;
    padding: 6px 14px;
  }

  .quick-reply-popover {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    max-height: 52dvh;
  }

  /* Comments AI & Manual View Mobile */
  .comments-page .comment-ai-header {
    row-gap: 8px;
  }

  .comments-page .comment-ai-title-group {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
  }

  .comments-page .comment-ai-title-group h1 {
    flex: 1 1 auto;
    width: auto;
  }

  .comments-page .comment-workspace-tabs {
    flex-basis: 100%;
    width: 100%;
    border-left: 0;
    border-top: 1px solid #f0ece8;
    padding: 8px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .comments-page .comment-workspace-tabs button {
    min-height: 34px;
    text-align: center;
  }

  .comments-page .comment-ai-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .comments-page .comment-ai-header-actions .button,
  .comments-page .comment-ai-toggle {
    min-height: 34px;
  }

  .comment-ai-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .comments-page #comment-activity {
    padding: 12px 14px 20px;
  }

  .comment-ai-feed-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .comment-ai-feed-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .comment-ai-feed-filters select {
    width: 100%;
    min-height: 36px;
    font-size: 13px !important;
  }

  .comments-header {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .comments-header h2 {
    font-size: 15.5px;
    margin: 0 auto 0 0;
  }

  .comments-header-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
    gap: 6px;
    align-items: center;
  }

  .comment-filter-tabs {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .comment-filter-tabs .tab {
    justify-content: center;
    padding: 5px 4px;
    min-height: 34px;
    font-size: 12px;
  }

  #comment-ai-filter,
  #comment-sort {
    width: 100%;
    min-height: 36px;
    font-size: 13px !important;
  }

  .comments-page .comments-scroll {
    padding: 10px 12px 18px;
  }

  .comment-replies {
    margin-left: 12px !important;
    padding-left: 10px !important;
  }

  .comment-bottom-composer {
    padding: 8px 12px 10px;
  }

  /* Dashboard Mobile */
  .dashboard-analytics-page>.dash-overview {
    padding: 12px 14px 20px !important;
  }

  .dash-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dash-topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dash-topbar-actions .button {
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
  }

  .dash-filters-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dash-filters-row select {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 38px;
    height: 38px;
    font-size: 13.5px !important;
    padding: 0 26px 0 10px;
  }

  .dash-filters-row select:last-of-type:nth-child(odd) {
    grid-column: 1 / -1;
  }

  #dashboard-metrics-status {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .dash-range-bar {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .dash-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-cell:nth-child(odd):not(:last-child) {
    border-right: 1px solid var(--line);
  }

  .dash-kpi-cell:first-child,
  .dash-kpi-cell:nth-child(2) {
    border-top: 0;
  }

  .dash-kpi-cell:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  #chart-best-time {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  #chart-best-time .hm-grid {
    min-width: 500px;
  }

  .hm-cell {
    min-width: 16px;
    min-height: 16px;
  }

  .dash-format-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dash-format-meter {
    width: 100%;
    min-width: 0;
  }

  .dash-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-table {
    min-width: 540px;
  }

  .dash-td-post {
    min-width: 185px;
  }

  /* Publish & Calendar Agenda Mobile */
  .app-shell .publish-page .published-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .app-shell .publish-page .published-toolbar :is(select, .button) {
    min-height: 36px;
    font-size: 13.5px !important;
  }

  .app-shell .publish-page .published-view-controls .button {
    min-width: 38px;
    min-height: 36px;
    padding: 0 10px;
  }

  .app-shell .publish-page .published-filter {
    flex: 0 0 auto;
  }

  .app-shell .publish-page #published-sort {
    flex: 1 1 150px;
    min-width: 0;
    max-width: none;
  }

  .app-shell .publish-page #open-post-composer {
    margin-left: auto;
  }

  .calendar-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .calendar-bar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .calendar-bar-left [data-month],
  #refresh-scheduled {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  #calendar-month-select {
    flex: 1 1 140px;
    min-height: 36px;
    font-size: 14px !important;
  }

  .calendar-status {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }

  .calendar-bar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .calendar-bar-right>[data-month="0"] {
    min-height: 36px;
    padding: 0 12px;
  }

  .calendar-week-btns button {
    min-height: 34px;
    padding: 4px 10px;
  }

  .calendar-shell.is-month {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-shell.is-month .month-grid {
    min-width: 560px;
  }

  /* Knowledge Master-Detail Mobile */
  .knowledge-page {
    height: calc(100dvh - env(safe-area-inset-top) - 62px - env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
  }

  .knowledge-page.has-mobile-detail>.page-heading,
  .knowledge-page.has-mobile-detail .knowledge-toolbar {
    display: none;
  }

  .knowledge-workspace {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
  }

  .knowledge-toolbar {
    padding: 10px 14px !important;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    background: #fffdfb;
  }

  .knowledge-filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .knowledge-filters .tab {
    justify-content: center;
    min-height: 36px;
  }

  .knowledge-toolbar-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .knowledge-search-box {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }

  .knowledge-split {
    flex: 1;
    min-height: 0;
    display: block !important;
    overflow: hidden;
  }

  .knowledge-list-pane {
    width: 100%;
    height: 100%;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    overflow-y: auto;
    padding: 10px 14px 20px;
  }

  .knowledge-detail-pane {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }

  .knowledge-split.detail-open .knowledge-list-pane {
    display: none;
  }

  .knowledge-split.detail-open .knowledge-detail-pane {
    display: flex;
    flex-direction: column;
  }

  .knowledge-back-mobile {
    display: inline-flex !important;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .knowledge-detail-head {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fffdfb;
    border-bottom: 1px solid var(--line);
  }

  .knowledge-detail-badges {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .knowledge-detail-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .knowledge-detail-actions .button {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 36px;
  }

  .knowledge-editor {
    height: 100%;
  }

  .knowledge-title-field {
    padding: 12px 14px 8px;
  }

  .knowledge-content-field {
    padding: 0 14px 12px;
    min-height: 220px;
  }

  .knowledge-detail-foot {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  /* Competitors, Trends, Connections, Settings, Admin & Dialogs */
  .app-shell .dash-chart-head :is(select, .button),
  .app-shell .dash-kpi-cell .dash-link-btn,
  .app-shell .calendar-bar-right [data-month="0"],
  .app-shell .competitor-page :is(.tab, select, .button),
  .app-shell .competitor-toolbar :is(button, select),
  .app-shell #competitor-content :is(button, select):not(.competitor-more),
  .app-shell .comment-ai-header :is(button, .button),
  .app-shell #comment-activity :is(button, .button, select),
  .app-shell .connection-group-actions :is(.button, .icon-button),
  .app-shell .connection-card :is(.button, .icon-button),
  .app-shell .zalo-connection footer .button,
  .app-shell .news-header-actions .text-button,
  .app-shell #news-refresh {
    min-height: 36px;
    height: auto;
  }

  .app-shell :is(.connection-group-actions .icon-button, .connection-card .icon-button) {
    min-width: 36px;
    width: 36px;
  }

  .competitor-toolbar-left {
    width: 100%;
    flex-wrap: wrap;
  }

  .competitor-toolbar-left select {
    width: 100%;
    min-height: 38px;
    font-size: 13.5px !important;
  }

  .competitor-manage-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .competitor-manage-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
  }

  .competitor-manage-actions .button {
    min-height: 36px;
  }

  .connection-card-head,
  .connection-apify-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .connection-apify-note .button {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }

  #reuse-post-view {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-body {
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-actions .button {
    min-height: 40px;
    flex: 1 1 120px;
    justify-content: center;
  }

  #toast {
    bottom: calc(74px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }

  #toast:empty {
    display: none !important;
  }
}

@media(max-width:480px) {

  #post-target-filters,
  #post-schedule-fields,
  .post-datetime-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dash-kpi-cell {
    padding: 12px 12px;
  }
}

.comments-page .comment-activity-meta { flex-wrap: wrap; }
.comments-page .comment-activity-meta .comment-ai-header-actions { width: auto; }
.comments-page:not(.show-ai-activity) .comment-ai-header-actions { justify-content: flex-end; padding: 8px 20px; }

.knowledge-toolbar-right { flex-wrap: wrap; }

.secondary-page-header .page-title-group {
  min-width: 0;
}

.secondary-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.secondary-page-actions :is(.button, .icon-button) {
  min-height: 35px;
  box-shadow: none;
}

.secondary-page-actions .button {
  white-space: nowrap;
}

.secondary-page-actions .tiktoday-feed-settings {
  max-width: 145px;
}

.secondary-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.secondary-tabs button {
  flex: none;
  min-height: 40px;
  padding: 0 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.secondary-tabs button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.connections-page [data-connection-section][hidden] {
  display: none;
}

.connections-page .secondary-tabs {
  margin-bottom: 14px;
}

.secondary-options {
  position: relative;
  flex: none;
}

.secondary-options > summary {
  list-style: none;
  cursor: pointer;
}

.secondary-options > summary::-webkit-details-marker {
  display: none;
}

.secondary-options-menu {
  position: absolute;
  inset: calc(100% + 4px) 0 auto auto;
  z-index: 8;
  min-width: 143px;
  display: grid;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px #211b191a;
}

.secondary-options-menu .button {
  justify-content: flex-start;
  min-height: 34px;
  border-color: transparent;
  box-shadow: none;
}

.competitor-page .competitor-more {
  align-items: center;
  gap: 8px;
}

.news-page > .news-layout {
  gap: 0;
}

.news-manage-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

#news-source-count {
  color: var(--muted);
  padding-top: 10px;
  font-size: 12px;
}

#news-source-count:empty {
  display: none;
}

.news-form [role="status"]:empty {
  display: none;
}

.admin-filters small {
  margin-inline-start: 2px;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

.settings-form-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
/* Align collapsed sidebar rail with page headers. */
@media(min-width:741px) {
 .app-shell.sidebar-collapsed .sidebar {
  padding-top:0;
 }
 .app-shell.sidebar-collapsed .sidebar-brand-row {
  flex:0 0 var(--page-header-height);
  padding:0;
  margin:0 -8px 10px;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:0;
 }
 .app-shell.sidebar-collapsed .sidebar-brand-row .brand {
  display:flex;
  flex:none;
  height:100%;
  width:100%;
  margin:0;
  padding:0;
  align-items:center;
  justify-content:center;
 }
 .app-shell.sidebar-collapsed .sidebar-brand-row .brand .brand-mark {
  display:block;
  width:26px;
  height:26px;
  object-fit:contain;
  /* Center the artwork inside its asymmetric transparent margins. */
  transform:translateX(1px);
 }
 .app-shell.sidebar-collapsed .nav-item {
  width:36px;
  min-height:36px;
  margin-inline:auto;
  padding:8px;
  justify-content:center;
  gap:0;
 }
 .app-shell.sidebar-collapsed .nav-item svg {
  display:block;
  width:18px;
  height:18px;
 }
}

/* Separate workspace tools from the main workflow. */
.sidebar > .sidebar-footer { border-top: 1px solid var(--line); }
