@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap');

/* Shared palette. Both themes use the same layout and controls. */
:root {
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --sidebar: #ffffff;
  --inset: #f1f3f6;
  --hover: #eceff4;
  --text: #17191f;
  --muted: #6d7482;
  --subtle: #858d9b;
  --line: #e5e8ee;
  --line-strong: #cfd5df;
  --accent: #176ffa;
  --accent-hover: #095ddb;
  --accent-soft: #eaf2ff;
  --accent-line: #c9ddff;
  --on-accent: #ffffff;
  --button-bg: #191b20;
  --button-text: #ffffff;
  --button-hover: #30343c;
  --success: #168154;
  --success-soft: #eaf7ef;
  --warning: #946200;
  --warning-soft: #fff4dc;
  --danger: #b54141;
  --danger-soft: #fff0f0;
  --shadow: 0 16px 60px rgba(24, 36, 58, .12);
  --backdrop: rgba(24, 32, 48, .34);
  --scrollbar: #c5cbd5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --surface: #1b1e25;
  --surface-soft: #20242c;
  --sidebar: #171a20;
  --inset: #242832;
  --hover: #2c313c;
  --text: #f0f2f6;
  --muted: #a2a9b7;
  --subtle: #858e9e;
  --line: #2e3440;
  --line-strong: #454e5e;
  --accent: #5798ff;
  --accent-hover: #7bafff;
  --accent-soft: #202f48;
  --accent-line: #365783;
  --on-accent: #ffffff;
  --button-bg: #eff2f7;
  --button-text: #161a21;
  --button-hover: #ffffff;
  --success: #69ce9b;
  --success-soft: #1d362c;
  --warning: #edc476;
  --warning-soft: #3b3020;
  --danger: #f19a9a;
  --danger-soft: #3c252c;
  --shadow: 0 16px 60px rgba(0, 0, 0, .35);
  --backdrop: rgba(0, 0, 0, .64);
  --scrollbar: #4c5668;
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

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

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

button {
  cursor: pointer
}

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

[hidden] {
  display: none !important
}

button,
a,
input,
select,
textarea {
  transition: background .15s, border-color .15s, color .15s
}

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

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

p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  padding: 36px 20px 24px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column
}

.brand {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.8px;
  padding: 0 16px
}

.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 48px
}

.nav {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  font-weight: 500
}

.nav:hover {
  background: var(--hover);
  color: var(--text)
}

.nav.active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent)
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px;
  font-size: 12px;
  color: var(--subtle)
}

.shell {
  margin-left: 232px
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted)
}

.topbar span:first-child {
  color: var(--text)
}

main {
  max-width: 1320px;
  padding: 42px 40px 50px;
  margin: auto
}

.page-head {
  margin-bottom: 28px
}

h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1.3px;
  line-height: 1.2
}

.page-head p {
  margin-top: 12px;
  font-size: 14px
}

h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.4px
}

h3 {
  font-size: 16px;
  font-weight: 600
}

.collector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px
}

.section-heading {
  margin-bottom: 24px
}

.filter-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 24px
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 500
}

.segmented {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--inset);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 10px;
  gap: 3px
}

.segmented button {
  height: 38px;
  min-width: 0;
  padding: 0 11px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500
}

.segmented button:hover {
  color: var(--text);
  background: var(--hover)
}

.segmented button.selected {
  background: var(--hover);
  color: var(--text)
}

.source-filter {
  min-width: 0
}

input,
select,
textarea {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  min-width: 0;
  height: 48px
}

select {
  width: 100%;
  padding-right: 32px
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle)
}

textarea {
  height: auto;
  resize: vertical;
  padding: 14px;
  line-height: 1.7
}

.filter-bottom {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 16px;
  margin-top: 20px;
  align-items: center
}

.search input {
  width: 100%
}

.primary,
.secondary,
.ai-button,
.article-actions>a {
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid var(--line)
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--button-text)
}

.primary:hover {
  background: var(--accent)
}

.secondary {
  background: var(--hover);
  color: var(--text)
}

.secondary:hover,
.ai-button:hover {
  background: var(--hover);
  border-color: var(--line-strong)
}

.collect-action {
  display: flex;
  align-items: center;
  gap: 16px
}

.collect-action .primary {
  min-width: 190px
}

.quota-badge {
  min-width: 246px;
  border-left: 1px solid var(--line);
  padding: 0 0 0 16px;
  line-height: 1.6;
  font-size: 11px;
  color: var(--muted)
}

.quota-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--text)
}

.quota-heading button {
  width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: var(--muted);
  border-radius: 5px;
  font-size: 18px;
  padding: 0
}

.quota-heading button:hover {
  background: var(--hover)
}

#quotaMeta {
  font-size: 10px;
  color: var(--subtle);
  margin-top: 4px
}

.quota-low {
  border-color: var(--warning);
  color: var(--warning)
}

.collection-note {
  font-size: 11px;
  color: var(--subtle);
  margin-top: 14px;
  line-height: 1.7
}

.dates {
  display: flex;
  gap: 16px;
  margin-top: 18px
}

.dates label {
  margin: 0
}

.dates input {
  display: block;
  margin-top: 8px
}

#message {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--warning-soft);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 13px;
  line-height: 1.7;
  border-radius: 10px
}

.history {
  margin: 18px 0 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px
}

.history>summary {
  display: flex;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  padding: 17px 20px;
  list-style: none;
  font-weight: 500
}

.history>summary::after {
  content: '⌄';
  color: var(--muted);
  font-size: 16px
}

.history[open]>summary::after {
  content: '⌃'
}

#historyStatus {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400
}

#historyList {
  max-height: 300px;
  overflow: auto;
  padding: 0 20px
}

.history-row {
  display: grid;
  grid-template-columns: 100px 18px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.7
}

.history-row time {
  color: var(--muted);
  font-size: 11px
}

.history-row strong {
  display: block;
  font-weight: 500;
  color: var(--text)
}

.history-text {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere
}

.history-status.success {
  color: var(--success)
}

.history-status.error {
  color: var(--danger)
}

.history-status.warning {
  color: var(--warning)
}

.history-status.running {
  color: var(--accent)
}

#coverageNote {
  padding: 0 20px 16px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted)
}

#coverageNote:empty {
  display: none
}

.top-section {
  padding: 0;
  background: none
}

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

.feed-header h2 {
  font-size: 23px;
  letter-spacing: -.7px
}

#runStatus {
  font-size: 12px;
  color: var(--success);
  margin-top: 8px;
  line-height: 1.7
}

#runStatus:empty {
  display: none
}

#rangeLabel {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 6px;
  color: var(--muted)
}

#rangeLabel:empty {
  display: none
}

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted)
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent)
}

.auto-top {
  margin-bottom: 20px
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px
}

.top-group {
  min-width: 0
}

.top-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 0 12px
}

.top-group-head small {
  font-size: 11px;
  font-weight: 400;
  color: var(--subtle)
}

.news-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-top: 12px
}

.article-number,
.article-text {
  display: none
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6
}

.source-tag {
  font-size: 10px;
  color: var(--muted);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 4px
}

.source-tag.telegram {
  color: var(--accent);
  background: var(--accent-soft)
}

.news-card h3 {
  margin: 15px 0 12px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -.3px
}

.news-card h3 a:hover {
  color: var(--accent)
}

.why {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted)
}

.article-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px
}

.article-actions>a,
.ai-button {
  height: 36px;
  padding: 0 13px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px
}

.check-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 9px;
  border-radius: 5px;
  margin-top: 16px;
  line-height: 1.5
}

.check-badge.insufficient {
  background: var(--warning-soft);
  color: var(--warning)
}

.check-badge.conflict,
.check-badge.not_checked {
  background: var(--danger-soft);
  color: var(--danger)
}

.check-badge.corroborated {
  background: var(--success-soft);
  color: var(--success)
}

.check-details {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 12px
}

.check-details>summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px
}

.check-details p {
  font-size: 12px;
  margin: 10px 0;
  color: var(--muted)
}

.check-details blockquote {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--inset);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
  font-size: 12px
}

.check-details a {
  display: block;
  color: var(--accent);
  font-size: 12px;
  margin-top: 8px;
  overflow-wrap: anywhere
}

.verification-note {
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.7;
  margin-top: 24px
}

.top-placeholder {
  grid-column: 1/-1;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  padding: 36px 24px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.8
}

.top-loading {
  border-style: solid
}

.top-error {
  padding: 14px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid var(--warning-soft);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.8
}

.ai-result {
  padding: 16px;
  background: var(--inset);
  border-radius: 8px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap
}

dialog {
  width: calc(100% - 32px);
  max-width: 640px;
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 28px;
  box-shadow: 0 24px 90px #0008
}

dialog::backdrop {
  background: #05080dbc;
  backdrop-filter: blur(5px)
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px
}

.dialog-head h2 {
  font-size: 24px
}

.icon-button {
  height: 36px;
  width: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--muted);
  font-size: 22px
}

.settings-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line)
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 8px
}

.settings-section p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
  line-height: 1.75
}

.settings-section textarea {
  width: 100%;
  margin: 0 0 20px
}

.settings-section input:not([type=checkbox]) {
  width: 100%;
  margin-top: 8px
}

.settings-section>label {
  margin-top: 18px
}

.settings-section a {
  font-size: 12px;
  color: var(--accent)
}

.fixed-model {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--inset);
  border: 1px solid var(--line);
  padding: 15px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted)
}

.fixed-model strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500
}

.model-row {
  margin: 9px 0 15px
}

.key-info {
  font-size: 12px;
  color: var(--success);
  margin: 10px 0 18px
}

.ai-settings-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 20px
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px
}

#settingsError {
  font-size: 13px;
  color: var(--danger);
  margin-top: 16px
}

@media(max-width:1280px) {
  .filter-top {
    grid-template-columns: 1fr
  }

  .source-filter {
    max-width: none
  }

  .filter-bottom {
    grid-template-columns: 1fr
  }

  .collect-action {
    justify-content: space-between
  }

  .quota-badge {
    min-width: 270px
  }

  .top-grid {
    grid-template-columns: 1fr
  }

  .feed-header {
    flex-wrap: wrap
  }

  .top-actions {
    flex-shrink: 0
  }
}

@media(max-width:900px) {
  .sidebar {
    width: 192px;
    padding: 28px 14px
  }

  .shell {
    margin-left: 192px
  }

  main {
    padding: 32px 24px
  }

  .topbar {
    padding: 0 24px
  }

  .nav {
    padding: 0 12px
  }

  .brand {
    padding: 0 12px
  }

  .collect-action {
    gap: 12px
  }

  .quota-badge {
    min-width: 230px
  }

  .collect-action .primary {
    min-width: 160px;
    padding: 0 14px
  }
}

@media(max-width:750px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px 22px;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line)
  }

  .brand {
    padding: 0;
    font-size: 21px
  }

  .sidebar nav {
    margin: 0;
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: flex-end
  }

  .nav {
    width: auto;
    height: 38px;
    padding: 0 12px;
    font-size: 12px
  }

  .sidebar-bottom {
    display: none
  }

  .shell {
    margin-left: 0
  }

  .topbar {
    height: 48px;
    padding: 0 24px;
    font-size: 11px
  }

  main {
    padding: 28px 24px 40px
  }

  h1 {
    font-size: 32px
  }

  .page-head p {
    font-size: 13px
  }

  .collector {
    padding: 22px
  }

  .filter-top {
    gap: 18px
  }

  .segmented button {
    padding: 0 7px;
    font-size: 12px
  }

  .segmented {
    gap: 2px
  }

  .feed-header h2 {
    font-size: 22px
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr
  }

  .top-actions button {
    width: 100%
  }

  .history>summary {
    padding: 16px
  }

  .history-row {
    grid-template-columns: 70px 14px 1fr;
    gap: 8px
  }

  .news-card {
    padding: 20px
  }

  .feed-header {
    margin-bottom: 16px
  }
}

@media(max-width:520px) {
  .sidebar {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px
  }

  .sidebar nav {
    justify-content: flex-start;
    flex-basis: 100%;
    gap: 6px
  }

  .nav {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 0 7px
  }

  .topbar {
    padding: 0 18px
  }

  .topbar>span:first-child {
    display: none
  }

  .topbar>span:last-child {
    margin-left: auto
  }

  main {
    padding: 26px 16px
  }

  .collector {
    padding: 18px
  }

  .segmented {
    grid-template-columns: repeat(3, 1fr)
  }

  .collect-action {
    flex-direction: column;
    align-items: stretch;
    gap: 16px
  }

  .collect-action .primary {
    width: 100%
  }

  .quota-badge {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 0;
    min-width: 0
  }

  .quota-heading {
    font-size: 13px
  }

  .quota-badge {
    font-size: 12px
  }

  #historyStatus {
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
  }

  .news-card h3 {
    font-size: 16px
  }

  .dates label {
    flex: 1;
    min-width: 0
  }

  .dates input {
    width: 100%
  }

  .fixed-model {
    flex-wrap: wrap;
    gap: 8px
  }

  .dialog-head h2 {
    font-size: 21px
  }

  dialog {
    padding: 22px
  }

  .ai-settings-actions {
    flex-wrap: wrap
  }
}

.rank-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--hover);
  color: var(--text);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600
}

.stats-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px
}

.stats-heading p {
  margin-top: 12px
}

.tg-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px
}

#tgQuota,
#tgStatus,
#tgDelta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8
}

#tgStatus {
  margin-bottom: 24px;
  color: var(--text)
}

.tg-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px
}

.tg-metric {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px
}

.tg-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6
}

.tg-metric strong {
  display: block;
  margin-top: 14px;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -.7px
}

.tg-chart-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px
}

.tg-chart-box .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px
}

.tg-chart {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8
}

.tg-chart svg {
  width: 100%;
  height: auto
}

.tg-sample {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted)
}

#tgError {
  color: var(--danger);
  font-size: 12px;
  margin-top: 16px;
  line-height: 1.8
}

#tgDialog .checkbox {
  margin-bottom: 15px
}

@media(max-width:900px) {
  .tg-metrics {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:750px) {
  .sidebar {
    flex-wrap: wrap
  }

  .sidebar nav {
    flex-wrap: wrap;
    justify-content: flex-start
  }

  .stats-heading {
    flex-wrap: wrap
  }

  .stats-heading h1 {
    font-size: 29px
  }

  .tg-controls {
    flex-wrap: wrap
  }

  .tg-sample {
    flex-wrap: wrap;
    gap: 8px 20px
  }
}

.tg-primary-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.tg-metric {
  min-width: 0
}

.tg-primary-metrics .tg-metric {
  border-top: 2px solid var(--line-strong)
}

.tg-metric-note {
  display: block;
  min-height: 18px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6
}

.tg-chart-heading {
  margin-bottom: 18px
}

.tg-chart-heading select {
  width: 260px;
  height: 44px
}

.tg-chart-heading h2 {
  margin-bottom: 5px
}

.tg-chart-empty {
  text-align: center;
  padding: 24px 16px
}

.tg-chart-empty strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px
}

.tg-chart-empty span {
  font-size: 12px;
  color: var(--muted)
}

.tg-detail-section {
  margin-top: 30px
}

.tg-detail-section>h2 {
  margin-bottom: 16px;
  font-size: 17px
}

.tg-detail-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.tg-detail-metrics .tg-metric {
  padding: 18px 20px
}

.tg-detail-metrics strong {
  font-size: 25px
}

.tg-detail-metrics .tg-metric-note:empty {
  display: none
}

.tg-chart svg {
  max-height: 310px
}

.tg-chart {
  min-height: 190px
}

@media(max-width:1100px) {
  .tg-primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:750px) {
  .tg-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .tg-chart-heading {
    flex-wrap: wrap
  }

  .tg-chart-heading select {
    width: 100%
  }

  .tg-chart-box {
    padding: 20px
  }

  .tg-metric {
    padding: 18px
  }

  .tg-metric strong {
    font-size: 27px
  }
}

@media(max-width:390px) {
  .tg-detail-metrics {
    grid-template-columns: 1fr
  }

  .tg-primary-metrics {
    gap: 10px
  }

  .tg-primary-metrics .tg-metric {
    padding: 14px
  }

  .tg-primary-metrics .tg-metric strong {
    font-size: 24px
  }
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start
}

.settings-card {
  min-width: 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px
}

.settings-card>.settings-section {
  margin-top: 20px;
  padding-top: 20px
}

.settings-card .dialog-footer {
  justify-content: flex-start
}

.settings-card textarea {
  display: block
}

.settings-card #settingsError,
.settings-card #tgError {
  color: var(--success);
  min-height: 20px;
  line-height: 1.7
}

.settings-card .settings-section>label:first-child {
  margin-top: 0
}

@media(max-width:1100px) {
  .settings-grid {
    grid-template-columns: 1fr
  }
}

@media(max-width:520px) {
  .settings-card {
    padding: 20px
  }

  .settings-card .dialog-footer button {
    width: 100%
  }
}

/* Editorial workspace */
.plan-heading,
.plan-toolbar,
.plan-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px
}

.plan-heading .primary {
  flex-shrink: 0
}

.plan-toolbar {
  margin-bottom: 18px
}

.plan-views {
  display: flex
}

.plan-views button {
  min-width: 110px
}

#planCount {
  color: var(--muted);
  font-size: 12px
}

.plan-notice {
  margin-bottom: 18px;
  color: var(--accent);
  min-height: 24px
}

.plan-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 18px;
  align-items: start
}

.plan-column {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-height: 280px
}

.plan-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft)
}

.plan-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px
}

.plan-column-head h2 {
  font-size: 13px
}

.plan-column-head span {
  font-size: 11px;
  background: var(--hover);
  border-radius: 5px;
  padding: 4px 7px;
  color: var(--muted)
}

.plan-column[data-status=scheduled] {
  border-top: 2px solid var(--accent)
}

.plan-column[data-status=published] {
  border-top: 2px solid var(--accent)
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 12px;
  padding: 12px;
  cursor: grab;
  overflow: hidden
}

.plan-card:hover {
  border-color: var(--line-strong)
}

.plan-card>img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 10px
}

.plan-card-title {
  display: block;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  padding: 0;
  width: 100%;
  overflow-wrap: anywhere
}

.plan-card p {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap
}

.plan-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 10px;
  color: var(--muted)
}

.plan-empty {
  font-size: 12px;
  padding: 28px 0;
  color: var(--subtle);
  text-align: center
}

.plan-add {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 0;
  width: 100%;
  text-align: left
}

.plan-add:hover {
  color: var(--accent)
}

.plan-month {
  margin: 10px 0 16px
}

.plan-month h2 {
  text-transform: capitalize
}

.plan-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 18px
}

.plan-weekday {
  background: var(--surface-soft);
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px
}

.plan-day {
  min-height: 130px;
  background: var(--surface-soft);
  padding: 8px;
  min-width: 0
}

.plan-day.today {
  background: var(--accent-soft)
}

.plan-day.outside {
  background: var(--inset)
}

.plan-day-number {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 12px
}

.today .plan-day-number {
  background: var(--accent);
  color: var(--button-text)
}

.plan-mini {
  display: block;
  width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 11px;
  padding: 7px;
  margin-top: 6px;
  line-height: 1.5
}

.plan-mini small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px
}

#planUndated {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

#planUndated h2 {
  width: 100%;
  font-size: 15px
}

#planUndated .plan-mini {
  width: 220px
}

#postEditor {
  max-width: 1080px
}

#postEditor .dialog-head {
  margin-bottom: 24px
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px
}

.post-fields input,
.post-fields textarea {
  display: block;
  width: 100%;
  margin-top: 8px
}

.post-fields textarea {
  font-size: 14px
}

.post-fields label {
  margin-bottom: 18px
}

.post-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.post-meta select {
  margin-top: 8px
}

.post-upload input {
  padding: 10px;
  height: auto
}

.post-fields p {
  font-size: 12px
}

.post-preview {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 0;
  min-width: 0
}

.post-preview>span {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 18px
}

#postPreviewText {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

#postLength {
  display: block;
  margin-top: 24px;
  color: var(--subtle);
  font-size: 11px
}

.post-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px
}

.post-image {
  position: relative;
  width: 110px
}

.post-image img {
  width: 110px;
  height: 90px;
  object-fit: cover;
  border-radius: 7px
}

.post-image a {
  display: block;
  font-size: 11px;
  color: var(--accent);
  margin: 5px 0 12px
}

.post-image button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  font-size: 16px
}

.post-preview-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 16px
}

.post-preview-images:empty {
  display: none
}

.post-preview-images img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px
}

.post-preview-images img:only-child {
  grid-column: 1/-1;
  height: auto;
  max-height: 280px;
  object-fit: contain
}

#postSource {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.8
}

#postSource summary {
  cursor: pointer;
  color: var(--accent)
}

#postSourceText {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 12px;
  max-height: 260px;
  overflow: auto
}

#postSourceLink {
  overflow-wrap: anywhere;
  color: var(--accent);
  margin-top: 10px
}

#postMessage {
  color: var(--warning);
  margin-top: 18px;
  min-height: 24px;
  font-size: 12px
}

.post-footer {
  flex-wrap: wrap
}

#postDelete {
  margin-right: auto;
  color: var(--danger)
}

.article-actions {
  flex-wrap: wrap
}

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

  .post-preview {
    position: static
  }

  .plan-heading {
    flex-wrap: wrap
  }

  .plan-calendar {
    min-width: 630px
  }

  #planCalendar {
    overflow-x: auto
  }

  .plan-board {
    grid-template-columns: repeat(5, 230px)
  }
}

@media(max-width:520px) {
  .post-meta {
    grid-template-columns: 1fr
  }

  .post-footer button {
    flex: 1
  }

  .post-footer #postDelete {
    margin-right: 0
  }

  .plan-views button {
    min-width: 90px
  }

  #postEditor {
    padding: 18px
  }
}

.plan-column {
  transition: background .2s, border-color .2s, box-shadow .2s
}

.plan-card {
  transition: opacity .18s, box-shadow .18s, border-color .18s
}

.plan-card.dragging {
  opacity: .3;
  box-shadow: inset 0 0 0 1px var(--accent);
  border-style: dashed
}

.plan-dragging .plan-column {
  border-color: var(--line-strong)
}

.plan-column.drag-over {
  box-shadow: inset 0 0 0 1px var(--accent-soft)
}

.plan-column.drag-over::after {
  content: 'Отпустить сюда';
  display: block;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  text-align: center;
  padding: 18px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
  animation: drop-hint .2s ease-out
}

.plan-drag-ghost {
  position: fixed;
  left: -10000px;
  top: -10000px;
  transform: rotate(-3deg) scale(1.03);
  box-shadow: 0 16px 40px #0009;
  border-color: var(--accent);
  pointer-events: none
}

.plan-publish {
  width: 100%;
  margin-top: 14px;
  padding: 9px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  font-size: 12px
}

.plan-publish:hover {
  background: var(--accent-soft)
}

.channel-style-card {
  grid-column: 1/-1
}

.channel-style-card>p {
  margin: 12px 0 20px;
  font-size: 12px
}

.channel-style-card>label textarea {
  display: block;
  width: 100%;
  margin-top: 8px
}

.style-examples-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px
}

.style-examples-heading span {
  color: var(--muted);
  font-size: 11px
}

#styleExamples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

.style-example {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px
}

.style-example label {
  margin-bottom: 8px
}

.style-example textarea {
  display: block;
  width: 100%;
  margin-top: 8px
}

.style-remove {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--danger);
  font-size: 11px
}

.style-example-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0
}

.style-file-button {
  cursor: pointer;
  margin: 0
}

#styleSettingsMessage {
  color: var(--accent)
}

.post-assistant {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  margin-bottom: 20px
}

.post-assistant>summary {
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  font-weight: 500
}

.post-assistant p {
  margin: 12px 0;
  color: var(--muted)
}

.post-assistant label {
  margin-bottom: 12px
}

.post-assistant #assistantText {
  background: var(--inset)
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

#assistantMessage {
  color: var(--warning)
}

#assistantResult {
  margin-top: 14px
}

#postPublish {
  color: var(--accent);
  border-color: var(--line-strong)
}

.post-assistant .secondary {
  white-space: normal;
  height: auto;
  min-height: 40px;
  padding: 10px 14px
}

#assistantStyleInfo {
  font-size: 11px;
  line-height: 1.8
}

@keyframes drop-hint {
  from {
    opacity: 0;
    transform: translateY(-6px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@media(max-width:750px) {
  #styleExamples {
    grid-template-columns: 1fr
  }

  .style-examples-heading {
    align-items: flex-start;
    flex-direction: column
  }
}

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

  .plan-column,
  .plan-card {
    transition: none
  }

  .plan-column.drag-over::after {
    animation: none
  }
}

.post-assistant {
  padding: 0;
  background: var(--surface-soft);
  border-color: var(--line);
  overflow: hidden
}

.post-assistant>summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
  list-style: none;
  color: var(--text)
}

.post-assistant>summary::-webkit-details-marker {
  display: none
}

.post-assistant>summary::after {
  content: '⌄';
  margin-left: auto;
  color: var(--muted)
}

.post-assistant[open]>summary::after {
  content: '⌃'
}

.assistant-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 17px
}

.assistant-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted)
}

.assistant-body {
  padding: 4px 16px 16px
}

.assistant-body .post-meta {
  gap: 12px
}

.assistant-body select {
  height: 42px;
  background: var(--inset);
  border-color: var(--line)
}

.assistant-body label {
  color: var(--muted);
  font-size: 11px
}

.assistant-body #assistantPreferences {
  margin-bottom: 0;
  font-size: 13px;
  background: var(--inset);
  border-color: var(--line);
  min-height: 72px;
  line-height: 1.6
}

.assistant-quick {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 16px
}

.assistant-quick button {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  border-radius: 20px;
  padding: 6px 11px;
  color: var(--muted);
  font-size: 11px
}

.assistant-quick button:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong)
}

.assistant-body>#assistantGenerate {
  width: 100%;
  height: 42px
}

.post-assistant #assistantMessage:empty {
  display: none
}

.post-assistant #assistantStyleInfo:empty {
  display: none
}

.assistant-result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 9px;
  color: var(--text);
  font-size: 12px
}

.assistant-result-heading span:last-child {
  font-size: 10px;
  color: var(--muted)
}

.post-assistant #assistantText {
  margin: 0 0 12px;
  border-color: var(--line);
  background: var(--inset);
  line-height: 1.8;
  font-weight: 400
}

.assistant-actions button {
  flex: 1;
  font-size: 12px;
  min-height: 40px
}

.post-assistant .assistant-actions .secondary {
  padding: 8px 12px
}

#postEditor .dialog-head h2 {
  font-size: 22px
}

.post-fields #postText {
  font-weight: 400
}

.post-preview {
  background: var(--surface-soft);
  border-color: var(--line)
}

.post-preview>span {
  letter-spacing: 1px;
  color: var(--muted);
  font-size: 10px
}

.plan-card {
  padding: 14px;
  margin-bottom: 9px;
  border-radius: 9px;
  background: var(--surface)
}

.plan-card-title {
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 21px
}

.plan-card-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  color: var(--muted);
  font-size: 10px;
  gap: 8px
}

.plan-card .plan-publish {
  width: 25px;
  height: 25px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  font-size: 14px
}

.plan-column {
  min-height: 220px
}

.plan-card:hover {
  background: var(--hover)
}

html {
  scrollbar-gutter: stable;
  overflow-x: clip
}

body.editor-open {
  overflow: hidden
}

.sidebar {
  overflow-y: auto;
  overscroll-behavior: contain
}

#postEditor {
  padding: 0;
  max-height: calc(100dvh - 40px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable
}

#postForm {
  padding: 24px
}

#postEditor .dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -24px -24px 24px;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line)
}

#postEditor .post-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 24px -24px -24px;
  padding: 16px 24px;
  background: var(--surface)
}

#postEditor .post-preview {
  position: static
}

#postSourceText {
  max-height: none;
  overflow: visible
}

.post-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px
}

.post-title-row #postTitle {
  flex: 1;
  margin: 0
}

.post-title-row button {
  width: 44px;
  padding: 0;
  flex-shrink: 0;
  font-size: 18px;
  color: var(--accent)
}

.plan-board {
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) var(--inset)
}

.plan-calendar {
  scrollbar-width: thin
}

.tg-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px
}

.tg-mini-chart {
  min-width: 0;
  padding: 18px 20px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px
}

.tg-mini-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px
}

.tg-mini-heading h2 {
  font-size: 14px;
  letter-spacing: 0
}

.tg-mini-heading strong {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -.5px
}

.tg-mini-delta {
  min-height: 22px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted)
}

.tg-mini-plot {
  position: relative;
  min-height: 145px
}

.tg-mini-plot svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 178px
}

.tg-mini-plot svg circle[role=button] {
  cursor: crosshair;
  outline: none
}

.tg-mini-plot svg circle[role=button]:focus {
  stroke: var(--accent);
  stroke-width: 2
}

.tg-chart-tooltip {
  position: absolute;
  transform: translateX(-50%);
  padding: 7px 10px;
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 14px #0005;
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2
}

.tg-mini-empty {
  height: 145px;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 12px
}

.tg-mini-single {
  font-size: 10px;
  color: var(--subtle)
}

@media(max-width:750px) {
  .tg-mini-chart {
    padding: 16px 12px 8px
  }

  .tg-mini-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px
  }

  .tg-mini-heading strong {
    font-size: 21px
  }

  .tg-mini-plot {
    min-height: 100px
  }
}

@media(max-width:520px) {
  .tg-chart-grid {
    grid-template-columns: 1fr
  }

  .tg-mini-heading {
    flex-direction: row;
    align-items: center
  }

  .tg-mini-plot {
    min-height: 145px
  }

  #postForm {
    padding: 18px
  }

  #postEditor .dialog-head {
    margin: -18px -18px 18px;
    padding: 14px 18px
  }

  #postEditor .post-footer {
    margin: 18px -18px -18px;
    padding: 12px 18px
  }
}

#postEditor .post-preview {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent
}

.tg-mini-plot {
  min-height: 148px
}

.tg-mini-plot svg {
  height: 148px;
  max-height: none
}

.tg-mini-empty {
  height: 148px
}

.task-quick-form {
  display: flex;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px
}

.task-quick-form input {
  flex: 1
}

.task-quick-form .primary {
  height: 48px
}

.task-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px
}

.task-filters {
  display: flex
}

.task-filters button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px
}

.task-filters span {
  font-size: 10px;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted)
}

.task-toolbar>input {
  width: 230px;
  height: 42px
}

.task-group {
  margin-bottom: 28px
}

.task-group>h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin-bottom: 12px
}

.task-group>h2 span {
  font-size: 10px;
  color: var(--subtle)
}

.task-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px
}

.task-row>input {
  width: 19px;
  height: 19px;
  padding: 0;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer
}

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

.task-row-title {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere
}

.task-row-title:hover {
  color: var(--accent)
}

.task-row.completed .task-row-title {
  color: var(--subtle);
  text-decoration: line-through
}

.task-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted)
}

.task-row-meta:empty {
  display: none
}

.task-row-meta .task-priority {
  color: var(--warning);
  background: var(--warning-soft);
  border-radius: 4px;
  padding: 2px 6px
}

.task-row-meta .task-doing {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 6px
}

.task-row-meta .task-overdue {
  color: var(--danger)
}

.task-post-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 10px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.task-inline-steps {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px
}

.task-inline-steps>summary {
  cursor: pointer;
  margin-bottom: 10px
}

.task-step-label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 400;
  margin: 8px 0;
  color: var(--muted);
  overflow-wrap: anywhere
}

.task-step-label input {
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 3px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent)
}

.step-done {
  text-decoration: line-through;
  color: var(--subtle)
}

.task-empty {
  text-align: center;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 46px 20px
}

.task-empty-icon {
  display: block;
  font-size: 30px;
  color: var(--accent);
  margin-bottom: 14px
}

.task-empty h2 {
  font-size: 17px;
  margin-bottom: 10px
}

.task-empty p {
  font-size: 12px
}

#taskEditor {
  max-width: 720px;
  padding: 0;
  max-height: calc(100dvh - 40px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable
}

#taskForm {
  padding: 24px
}

#taskEditor .dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -24px -24px 24px;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line)
}

#taskForm>label {
  margin-bottom: 18px
}

#taskForm>label>input,
#taskForm>label>textarea {
  width: 100%;
  display: block;
  margin-top: 8px
}

.task-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px
}

.task-fields-grid input,
.task-fields-grid select {
  display: block;
  width: 100%;
  margin-top: 8px
}

.task-checklist-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px
}

.task-checklist-heading h3 {
  font-size: 14px
}

.task-checklist-heading span {
  font-size: 11px;
  color: var(--muted)
}

.task-edit-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px
}

.task-edit-step input[type=checkbox] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  padding: 0;
  accent-color: var(--accent)
}

.task-edit-step input[type=text] {
  flex: 1;
  height: 42px
}

.task-step-remove {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  padding: 4px 8px
}

.task-step-remove:hover {
  color: var(--danger)
}

#taskEditorMessage {
  font-size: 12px;
  color: var(--warning);
  margin-top: 18px
}

#taskEditorMessage:empty {
  display: none
}

#taskEditor .dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 24px -24px -24px;
  padding: 16px 24px;
  background: var(--surface)
}

#taskDelete {
  margin-right: auto;
  color: var(--danger)
}

@media(max-width:750px) {
  .task-toolbar {
    flex-wrap: wrap
  }

  .task-toolbar>input {
    width: 100%
  }

  .task-row {
    padding: 16px
  }

  .sidebar nav .nav {
    flex: 0 1 auto
  }

  .task-post-link {
    max-width: 220px
  }
}

@media(max-width:520px) {
  .task-quick-form {
    padding: 12px;
    gap: 8px
  }

  .task-quick-form .primary {
    padding: 0 12px
  }

  .task-fields-grid {
    grid-template-columns: 1fr
  }

  #taskForm {
    padding: 18px
  }

  #taskEditor .dialog-head {
    margin: -18px -18px 18px;
    padding: 14px 18px
  }

  #taskEditor .dialog-footer {
    margin: 18px -18px -18px;
    padding: 12px 18px
  }

  .task-filters {
    width: 100%
  }

  .task-filters button {
    flex: 1;
    justify-content: center
  }

  .task-row-title {
    font-size: 13px
  }

  .task-post-link {
    max-width: 180px
  }
}

.task-row-delete {
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 9px;
  margin-top: -2px;
  background: none;
  color: var(--danger);
  font-size: 11px
}

.task-row-delete:hover {
  background: var(--danger-soft);
  border-color: var(--danger-soft);
  color: var(--danger)
}

.task-row-delete:disabled {
  opacity: .4
}

@media(max-width:520px) {
  .task-row {
    gap: 10px
  }

  .task-row-delete {
    padding: 6px 5px;
    font-size: 10px
  }
}

#taskPersonFilter {
  width: 190px;
  flex-shrink: 0;
  height: 42px
}

.task-toolbar .task-filters {
  margin-right: auto
}

.task-assignee {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 7px
}

.task-assignee::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent)
}

@media(max-width:750px) {
  #taskPersonFilter {
    flex: 1;
    min-width: 160px
  }

  .task-toolbar>input {
    flex: 1;
    min-width: 160px
  }

  .task-toolbar .task-filters {
    flex-basis: 100%;
    justify-content: flex-start
  }
}

@media(max-width:520px) {

  #taskPersonFilter,
  .task-toolbar>input {
    min-width: 0;
    width: calc(50% - 9px);
    flex: 1
  }
}

/* Minimal workspace, shared by light and dark themes. */
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

html {
  scrollbar-color: var(--scrollbar) var(--bg);
}

.sidebar {
  width: 224px;
  padding: 28px 16px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  gap: 24px;
}

.sidebar nav {
  display: grid;
  margin: 0;
  gap: 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.nav svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.shell {
  margin-left: 224px;
  min-width: 0;
}

.topbar {
  height: 72px;
  padding: 0 32px;
  border: 0;
  color: var(--muted);
  max-width: 1600px;
  margin: auto;
}

.topbar span:first-child {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.theme-toggle:hover {
  background: var(--hover);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-sun {
  display: none;
}

[data-theme="dark"] .theme-sun {
  display: block;
}

[data-theme="dark"] .theme-moon {
  display: none;
}

main {
  max-width: 1600px;
  padding: 18px 32px 48px;
}

h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1.1px;
}

h2 {
  font-size: 18px;
  letter-spacing: -.3px;
}

.page-head,
.stats-heading {
  margin-bottom: 26px;
}

.page-head p,
.stats-heading p {
  margin-top: 9px;
}

label {
  color: var(--text);
  font-size: 13px;
}

input,
select,
textarea {
  background: var(--inset);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.primary,
.secondary,
.ai-button,
.article-actions>a {
  border-radius: 10px;
  font-size: 13px;
}

.primary {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}

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

.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.secondary:hover,
.ai-button:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.segmented {
  background: var(--inset);
  border: 0;
  border-radius: 11px;
  padding: 4px;
}

.segmented button {
  border-radius: 8px;
  color: var(--muted);
}

.segmented button:hover {
  background: var(--hover);
  color: var(--text);
}

.segmented button.selected {
  background: var(--accent);
  color: var(--on-accent);
}

.collector,
.settings-card,
.tg-metric,
.tg-mini-chart,
.task-quick-form,
.news-card {
  background: var(--surface);
  border-color: transparent;
  border-radius: 16px;
}

.collector,
.settings-card {
  padding: 26px;
}

.filter-top {
  gap: 20px;
}

.collection-note:empty,
.plan-notice:empty,
#taskNotice:empty {
  display: none;
}

.collection-note {
  color: var(--muted);
}

.quota-badge {
  border-color: var(--line);
  color: var(--muted);
}

.quota-heading {
  color: var(--text);
}

.history {
  background: var(--surface);
  border-color: transparent;
  border-radius: 12px;
}

.history-row strong {
  color: var(--text);
}

.feed-header h2 {
  font-size: 22px;
}

.top-grid {
  gap: 24px;
}

.top-group-head {
  font-size: 16px;
}

.news-card {
  padding: 24px;
}

.news-card h3 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.why {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.article-actions>a,
.ai-button {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  height: 36px;
  padding: 0 12px;
}

.article-actions> :last-child {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.rank-label,
.source-tag {
  background: var(--inset);
  color: var(--muted);
}

.source-tag.telegram {
  background: var(--accent-soft);
  color: var(--accent);
}

.check-details blockquote,
.ai-result {
  background: var(--inset);
}

.top-placeholder {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--muted);
}

.tg-controls {
  gap: 16px;
}

.tg-chart-grid {
  gap: 20px;
  margin-top: 20px;
}

.tg-mini-chart {
  padding: 24px 24px 16px;
}

.tg-mini-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.tg-mini-heading h2 {
  font-size: 15px;
  font-weight: 500;
}

.tg-mini-heading strong {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1px;
}

.tg-mini-delta {
  font-size: 12px;
  color: var(--muted);
  min-height: 20px;
  margin: 8px 0 12px;
}

.tg-mini-plot {
  min-height: 178px;
}

.tg-mini-plot svg {
  height: 178px;
}

.tg-mini-empty {
  height: 178px;
  color: var(--subtle);
}

.tg-chart-tooltip {
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 18px var(--backdrop);
  font-size: 12px;
}

.tg-detail-section {
  margin-top: 28px;
}

.tg-metric strong {
  font-weight: 600;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.settings-card .dialog-footer {
  border: 0;
  padding-top: 0;
}

.settings-section {
  border-color: var(--line);
}

.fixed-model {
  border-color: transparent;
  background: var(--inset);
  color: var(--muted);
}

.fixed-model strong {
  color: var(--text);
}

.settings-section a {
  color: var(--accent);
}

.style-example {
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: 12px;
}

.style-remove {
  color: var(--muted);
}

.style-remove:hover {
  color: var(--danger);
}

.plan-board {
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  scrollbar-color: var(--scrollbar) transparent;
}

.plan-column {
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px;
  min-height: max(300px, calc(100dvh - 280px));
}

.plan-column[data-status="scheduled"],
.plan-column[data-status="published"] {
  border-top: 1px solid transparent;
}

.plan-column-head {
  margin: 4px 0 16px;
  gap: 6px;
}

.plan-column-head h2 {
  font-weight: 500;
  font-size: 13px;
}

.plan-column-head span {
  background: var(--inset);
  color: var(--muted);
}

.plan-card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 16px 14px;
  margin-bottom: 12px;
}

.plan-card:hover {
  background: var(--surface);
  border-color: var(--accent-line);
}

.plan-card-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

.plan-card-meta {
  color: var(--muted);
  font-size: 11px;
  margin-top: 14px;
}

.plan-card-meta time {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-card .plan-publish {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.plan-publish {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}

.plan-publish:hover {
  background: var(--accent-line);
}

.plan-add {
  color: var(--muted);
  padding: 10px 4px;
}

.plan-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.plan-dragging .plan-column {
  border-color: var(--line-strong);
}

.plan-column.drag-over::after {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
  border-radius: 12px;
}

.plan-drag-ghost {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-day {
  background: var(--surface);
}

.plan-day.outside,
.plan-weekday {
  background: var(--surface-soft);
}

.plan-day.today {
  background: var(--accent-soft);
}

.today .plan-day-number {
  color: var(--on-accent);
}

.plan-mini {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-line);
}

.plan-mini small {
  color: var(--muted);
}

.task-quick-form {
  padding: 12px;
  gap: 12px;
  margin-bottom: 20px;
}

.task-toolbar {
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.task-filters span {
  background: transparent;
  color: inherit;
}

.task-group {
  padding: 10px 18px;
  background: var(--surface);
  border-radius: 16px;
  margin-bottom: 18px;
}

.task-group>h2 {
  padding: 12px 2px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.task-row {
  padding: 18px 2px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  margin: 0;
  gap: 14px;
}

.task-row>input {
  width: 20px;
  height: 20px;
}

.task-row-title {
  font-size: 15px;
  color: var(--text);
}

.task-row-meta {
  font-size: 12px;
  color: var(--muted);
  gap: 8px 12px;
}

.task-row-meta time {
  margin-left: auto;
}

.task-assignee {
  padding: 0;
  color: var(--muted);
  background: transparent;
  gap: 7px;
}

.task-assignee::before {
  width: 6px;
  height: 6px;
}

.task-post-link {
  color: var(--accent);
  font-size: 12px;
}

.task-inline-steps {
  font-size: 12px;
  color: var(--muted);
}

.task-inline-steps[open] {
  background: var(--surface-soft);
  padding: 12px 16px;
  border-radius: 10px;
}

.task-step-label {
  font-size: 13px;
  color: var(--text);
}

.step-done {
  color: var(--subtle);
}

.task-row-delete {
  width: 32px;
  height: 32px;
  padding: 7px;
  margin: -3px 0 0;
  color: var(--subtle);
  border-radius: 8px;
}

.task-row-delete svg {
  width: 17px;
  height: 17px;
  display: block;
}

.task-row-delete:hover {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.task-empty {
  background: var(--surface);
  border-color: var(--line-strong);
}

dialog {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(4px);
}

.icon-button {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--muted);
  border-radius: 10px;
}

#postEditor .dialog-head,
#postEditor .post-footer,
#taskEditor .dialog-head,
#taskEditor .dialog-footer {
  background: var(--surface);
}

.post-preview {
  background: var(--surface-soft);
  border-color: var(--line);
}

#postEditor .post-preview {
  scrollbar-color: var(--scrollbar) transparent;
}

.post-assistant {
  background: var(--surface-soft);
  border-color: var(--line);
  border-radius: 12px;
}

.post-assistant>summary {
  color: var(--text);
}

.assistant-mark {
  background: var(--accent-soft);
  color: var(--accent);
}

.assistant-tag,
.assistant-body label,
.assistant-result-heading span:last-child {
  color: var(--muted);
}

.assistant-body select,
.assistant-body #assistantPreferences,
.post-assistant #assistantText {
  background: var(--inset);
  border-color: transparent;
}

.assistant-result-heading {
  color: var(--text);
}

.assistant-quick button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
  font-size: 12px;
}

.assistant-quick button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

#postPublish {
  color: var(--accent);
  border-color: var(--accent-line);
}

#postDelete,
#taskDelete {
  color: var(--danger);
}

@media (max-width: 1280px) {
  .top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-actions {
    gap: 8px;
  }

  .filter-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {

  .settings-grid,
  .top-grid {
    grid-template-columns: 1fr;
  }

  .tg-mini-chart {
    padding: 20px 18px 12px;
  }

  .task-toolbar>input {
    flex: 1;
    min-width: 160px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 200px;
    padding: 24px 12px 18px;
  }

  .shell {
    margin-left: 200px;
  }

  .topbar {
    padding: 0 24px;
  }

  main {
    padding: 16px 24px 40px;
  }

  .nav {
    padding: 0 12px;
    gap: 10px;
  }

  h1 {
    font-size: 30px;
  }

  .tg-mini-heading strong {
    font-size: 30px;
  }
}

@media (max-width: 750px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .sidebar nav {
    display: flex;
    flex: 1;
    gap: 6px;
    margin: 0;
    flex-wrap: nowrap;
  }

  .sidebar-footer {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
  }

  .sidebar .nav {
    height: 42px;
    padding: 0 10px;
    font-size: 12px;
    gap: 8px;
    width: auto;
  }

  .sidebar nav .nav {
    flex: 1;
    justify-content: center;
  }

  .sidebar .nav svg {
    width: 18px;
    height: 18px;
  }

  .shell {
    margin: 0;
  }

  .topbar {
    height: 60px;
    padding: 0 20px;
  }

  main {
    padding: 18px 20px 36px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .plan-board {
    grid-template-columns: repeat(5, 220px);
  }

  .plan-column {
    min-height: 340px;
  }

  .tg-mini-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .tg-mini-plot,
  .tg-mini-empty {
    min-height: 150px;
  }

  .tg-mini-plot svg,
  .tg-mini-empty {
    height: 150px;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .sidebar {
    padding: 10px 12px;
    gap: 6px;
  }

  .sidebar .nav {
    flex-direction: column;
    height: 54px;
    padding: 7px 6px;
    gap: 5px;
    font-size: 10px;
  }

  .sidebar .nav svg {
    width: 19px;
    height: 19px;
  }

  .sidebar-footer .nav {
    width: 58px;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar>span:first-child {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-actions>span:first-child {
    display: block;
    margin: 0;
  }

  main {
    padding: 14px 16px 30px;
  }

  h1 {
    font-size: 28px;
  }

  .collector,
  .settings-card,
  .news-card {
    padding: 20px;
  }

  .tg-chart-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tg-mini-heading {
    flex-direction: row;
    align-items: center;
  }

  .tg-mini-heading strong {
    font-size: 28px;
  }

  .task-group {
    padding: 8px 14px;
  }

  .task-row {
    gap: 10px;
  }

  .task-row-title {
    font-size: 14px;
  }

  .task-row-meta {
    font-size: 11px;
    gap: 7px;
  }

  .task-row-meta time {
    margin-left: 0;
  }

  .task-toolbar {
    gap: 10px;
  }

  .task-quick-form {
    gap: 8px;
  }

  .task-quick-form input {
    width: 0;
  }

  .task-quick-form .primary {
    padding: 0 12px;
  }

  .task-inline-steps[open] {
    padding: 10px;
  }

  .post-footer {
    gap: 8px;
  }

  .post-footer button {
    padding: 0 10px;
    min-width: 0;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Feedback stays separate from article actions and adapts to both themes. */
.news-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.feedback-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1.5;
}

.feedback-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.feedback-button.selected {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.feedback-reason {
  height: 34px;
  width: auto;
  max-width: 100%;
  flex: 1 1 190px;
  font-size: 12px;
  padding-left: 10px;
}

.feedback-error {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.6;
  color: var(--danger);
}

.news-preferences-card {
  grid-column: 1 / -1;
}

.news-preferences-card>p {
  margin-top: 12px;
}

#newsPreferenceSummary {
  color: var(--text);
  font-size: 13px;
}

.preference-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.preference-row:first-child {
  margin-top: 16px;
}

.preference-row-body {
  flex: 1;
  min-width: 140px;
}

.preference-title {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.preference-row-body small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

/* Account and sign-in screens share the panel palette. */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px
}

.login-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow)
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 12px
}

.login-card form {
  display: grid;
  gap: 20px;
  margin-top: 28px
}

.login-card label {
  display: grid;
  gap: 8px;
  font-size: 14px
}

.login-card input {
  width: 100%;
  background: var(--inset);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px
}

.login-card button {
  width: 100%
}

.login-card [role=alert] {
  color: var(--danger)
}

#accountForm label,
#teamForm label {
  display: grid;
  gap: 8px;
  margin-top: 18px
}

#teamForm {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line)
}

.account-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line)
}

#logoutButton {
  color: var(--muted)
}

@media(max-width:600px) {
  .login-card {
    padding: 24px
  }

  .account-user {
    flex-wrap: wrap
  }
}

.settings-card fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0
}

.settings-card fieldset:disabled {
  opacity: .65
}

/* Compact editor: one writing surface, optional preview. */
#postEditor {
  width: min(800px, calc(100vw - 40px));
  max-width: 1160px;
  padding: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
  max-height: calc(100dvh - 40px)
}

#postEditor[data-view=preview] {
  width: min(1160px, calc(100vw - 40px))
}

#postForm {
  display: flex;
  flex-direction: column;
  padding: 0;
  max-height: calc(100dvh - 40px);
  min-height: 0
}

#postEditor .dialog-head {
  position: static;
  margin: 0;
  padding: 16px 24px;
  flex-shrink: 0;
  align-items: center;
  border-bottom: 1px solid var(--line)
}

#postEditor .dialog-head h2 {
  font-size: 19px
}

.editor-header-actions {
  display: flex;
  align-items: center;
  gap: 12px
}

.preview-toggle {
  height: 34px;
  padding: 0 10px;
  font-size: 11px;
  gap: 7px
}

.preview-toggle svg {
  height: 17px;
  width: 17px
}

.preview-toggle[aria-pressed=true] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line)
}

.post-workspace {
  padding: 20px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent
}

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

#postEditor[data-view=preview] .post-layout {
  grid-template-columns: minmax(0, 1fr) 330px
}

.post-fields {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px
}

.editor-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap
}

.editor-meta-row>select {
  width: auto;
  min-width: 140px;
  height: 34px;
  padding: 0 30px 0 10px;
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line)
}

.editor-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  font-size: 10px;
  color: var(--subtle);
  white-space: nowrap
}

.editor-date input {
  height: 34px;
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 0 8px;
  max-width: 200px
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.post-title-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0
}

.post-title-row #postTitle {
  height: 42px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.3px;
  background: transparent;
  border: 0;
  border-radius: 4px
}

.post-title-row #postTitle::placeholder {
  font-weight: 500;
  color: var(--subtle)
}

.post-title-row button {
  height: 30px;
  width: 30px;
  font-size: 16px;
  background: transparent;
  border-color: transparent;
  color: var(--accent)
}

.editor-composer {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-soft)
}

.editor-text-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 14px 0
}

.editor-text-heading label {
  font-size: 11px;
  font-weight: 400;
  margin: 0;
  color: var(--muted)
}

.editor-text-tools,
.assistant-result-tools {
  display: flex;
  align-items: center;
  gap: 8px
}

#postLength {
  display: inline;
  margin: 0;
  font-size: 10px;
  color: var(--subtle);
  white-space: nowrap
}

.copy-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted)
}

.copy-icon svg {
  width: 16px;
  height: 16px
}

.copy-icon:hover {
  background: var(--accent-soft);
  color: var(--accent)
}

.copy-icon[data-copied=true] {
  background: var(--success-soft);
  color: var(--success)
}

#postEditor #postText {
  display: block;
  margin: 0;
  min-height: 220px;
  height: clamp(220px, 32vh, 320px);
  max-height: 520px;
  width: 100%;
  padding: 10px 14px 14px;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none
}

#postEditor #postText:focus-visible {
  outline-offset: -2px
}

.editor-attachments {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 9px 12px
}

.editor-attachments>span {
  font-size: 10px;
  color: var(--subtle)
}

#postEditor .post-upload {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted)
}

.post-upload svg {
  width: 17px;
  height: 17px
}

.post-upload:hover {
  color: var(--accent)
}

#postFiles {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden
}

.post-upload:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px
}

#postEditor .post-images {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px;
  scrollbar-width: thin
}

.post-images:empty {
  display: none
}

#postEditor .post-image {
  width: 64px;
  min-width: 64px;
  height: 64px;
  position: relative
}

#postEditor .post-image img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px
}

#postEditor .post-image button {
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text)
}

#postEditor .post-image a {
  display: grid;
  place-items: center;
  position: absolute;
  bottom: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1
}

#postEditor .post-assistant {
  margin: 0;
  border-radius: 12px;
  flex-shrink: 0
}

#postEditor .post-assistant>summary {
  padding: 12px 14px;
  gap: 10px;
  font-size: 13px
}

.assistant-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px
}

.assistant-tag {
  font-size: 10px
}

.assistant-body {
  padding: 0 14px 14px
}

.assistant-result-heading .assistant-result-tools span {
  font-size: 10px;
  color: var(--muted)
}

#postEditor #postSource {
  margin: 0;
  padding: 0 2px;
  font-size: 11px
}

#postSource summary {
  color: var(--muted);
  font-weight: 400
}

#postSourceText {
  max-height: 220px;
  overflow: auto;
  scrollbar-width: thin
}

.editor-bottom {
  background: var(--surface);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  padding: 12px 24px
}

#postEditor #postMessage {
  margin: 0;
  min-height: 0;
  font-size: 11px
}

#postMessage:not(:empty) {
  padding-bottom: 9px
}

#postEditor .post-footer {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 10px
}

#postEditor .post-footer button {
  height: 38px;
  font-size: 12px
}

#postDelete {
  margin-right: auto
}

#postSave {
  min-width: 120px
}

#postEditor[data-view=edit] .post-preview {
  display: none
}

.preview-back {
  display: none
}

/* Phone preview is an approximation, with a fixed readable message width. */
#postEditor .post-preview {
  position: sticky;
  top: 0;
  max-height: none;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px
}

.preview-heading>span {
  font-size: 11px;
  color: var(--muted)
}

.telegram-phone {
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  padding: 8px;
  background: var(--surface-soft);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
  overflow: hidden
}

.phone-status {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--text);
  font: 600 10px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
}

.phone-camera {
  width: 72px;
  height: 17px;
  border-radius: 20px;
  background: var(--text)
}

.telegram-channel {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  background: var(--surface);
  border-radius: 20px 20px 0 0
}

.telegram-back {
  font: 30px/1 system-ui;
  color: var(--accent);
  margin-right: 2px
}

.telegram-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #4e9ec5;
  color: white;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0
}

.telegram-channel>div {
  display: grid;
  gap: 2px
}

.telegram-channel strong {
  font: 600 13px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
}

.telegram-channel div span {
  font-size: 10px;
  color: var(--muted)
}

.telegram-menu {
  margin-left: auto;
  font-size: 22px;
  color: var(--muted)
}

.telegram-screen {
  height: min(500px, calc(100dvh - 295px));
  min-height: 220px;
  padding: 14px 10px 20px;
  background: #dae5e8;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9c8ce transparent
}

.telegram-message {
  border-radius: 12px 12px 12px 4px;
  background: white;
  color: #17212b;
  box-shadow: 0 1px 3px #0000000d;
  overflow: hidden
}

#postPreviewText {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px 13px 4px;
  letter-spacing: 0
}

#postPreviewText strong {
  font-weight: 700
}

#postPreviewText em {
  font-style: italic
}

#postPreviewText a {
  color: #168acd;
  text-decoration: underline
}

#postPreviewText code,
#postPreviewText pre {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  background: #0000000b;
  border-radius: 3px
}

#postPreviewText pre {
  white-space: pre-wrap;
  padding: 8px;
  margin: 6px 0
}

#postPreviewText.preview-empty {
  color: #74818c
}

.telegram-message-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 9px;
  color: #83919c;
  font: 10px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
}

.phone-home {
  height: 4px;
  width: 100px;
  margin: 10px auto 3px;
  border-radius: 10px;
  background: var(--text);
  opacity: .6
}

#postEditor .post-preview-images {
  margin: 0;
  gap: 3px
}

#postEditor .post-preview-images img {
  display: block;
  width: 100%;
  height: 125px;
  object-fit: cover;
  border-radius: 0
}

#postEditor .post-preview-images img:only-child {
  height: auto;
  max-height: 300px;
  object-fit: contain
}

.post-preview-images[data-count="3"] img:first-child {
  grid-column: 1/-1;
  height: 145px
}

.preview-note {
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  color: var(--subtle);
  padding: 12px 16px 0
}

[data-theme=dark] .telegram-screen {
  background: #0e1621;
  scrollbar-color: #35495e transparent
}

[data-theme=dark] .telegram-message {
  background: #182533;
  color: #eef3f7
}

[data-theme=dark] #postPreviewText code,
[data-theme=dark] #postPreviewText pre {
  background: #ffffff0d
}

.editor-mobile-views {
  display: none
}

/* The signed-in identity lives above settings in the sidebar. */
.profile-nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 12px;
  margin-bottom: 6px;
  min-width: 0
}

.profile-nav:hover {
  background: var(--surface-soft);
  border-color: var(--line)
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0
}

.profile-info {
  min-width: 0;
  display: grid;
  gap: 4px
}

.profile-info strong {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.profile-info small {
  font-size: 10px;
  color: var(--muted)
}

.profile-chevron {
  margin-left: auto;
  color: var(--subtle);
  font-size: 22px
}

#profileDialog {
  width: min(400px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 20px
}

#profileDialog .dialog-head {
  margin-bottom: 24px
}

#profileDialog h2 {
  font-size: 20px
}

.profile-dialog-identity {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px
}

.profile-dialog-identity .profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 20px
}

.profile-dialog-identity strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px
}

.profile-dialog-identity p {
  font-size: 12px;
  margin-top: 4px
}

#profileDialog>button {
  width: 100%;
  margin: 6px 0
}

#profileDialog #logoutButton {
  color: var(--danger)
}

#profileMessage {
  font-size: 12px;
  color: var(--warning);
  margin-top: 10px
}

@media(max-width:750px) {

  #postEditor,
  #postEditor[data-view=preview] {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px)
  }

  #postForm {
    max-height: calc(100dvh - 20px)
  }

  #postEditor[data-view=preview] .post-layout {
    grid-template-columns: minmax(0, 1fr)
  }

  #postEditor .dialog-head {
    padding: 14px 16px
  }

  .editor-header-actions {
    gap: 6px
  }

  .preview-toggle {
    padding: 0 8px
  }

  .post-workspace {
    padding: 16px
  }

  #postEditor .post-preview {
    position: static;
    width: min(100%, 340px);
    margin: 0 auto
  }

  #postEditor[data-view=preview] .post-fields {
    display: none
  }

  .preview-back {
    display: block;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    padding: 4px
  }

  .preview-heading>span {
    display: none
  }

  .telegram-screen {
    height: min(470px, calc(100dvh - 280px))
  }

  .editor-bottom {
    padding: 12px 16px
  }

  .sidebar {
    flex-wrap: wrap
  }

  .sidebar nav {
    flex-basis: 100%
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 4px
  }

  .sidebar-footer .profile-nav {
    flex: 1;
    width: auto;
    margin: 0;
    padding: 6px 8px
  }

  .sidebar-footer #settingsNav {
    width: auto;
    flex-direction: row;
    padding: 0 10px;
    gap: 8px;
    height: 40px
  }

  .profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px
  }

  .profile-info {
    display: flex;
    align-items: center;
    gap: 8px
  }

  .profile-chevron {
    display: none
  }

  .profile-info strong {
    max-width: 180px
  }

  .profile-info small {
    font-size: 10px
  }
}

@media(max-width:440px) {
  #postEditor .dialog-head h2 {
    font-size: 17px
  }

  .preview-toggle {
    font-size: 10px;
    gap: 5px
  }

  .editor-meta-row {
    gap: 8px
  }

  .editor-meta-row>select {
    min-width: 110px;
    font-size: 11px
  }

  .editor-date {
    font-size: 0;
    gap: 0
  }

  .editor-date input {
    width: 177px;
    max-width: 177px;
    font-size: 10px;
    padding: 0 5px
  }

  .post-title-row #postTitle {
    font-size: 17px
  }

  .editor-bottom .post-footer button {
    flex: 0 1 auto
  }

  #postSave {
    margin-left: auto;
    min-width: 110px
  }

  .profile-info strong {
    max-width: 125px
  }

  .profile-info small {
    font-size: 9px
  }
}

.phone-camera {
  background: #0b0e13;
  border: 1px solid #29313a
}

/* Compact settings disclosure rows. */
html[data-restore-view] .shell main {
  visibility: hidden
}

#settingsPage .settings-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 10px;
  max-width: 900px
}

.settings-fold {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden
}

.settings-fold>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none
}

.settings-fold>summary::-webkit-details-marker {
  display: none
}

.settings-fold>summary>span:first-child {
  display: grid;
  gap: 4px
}

.settings-fold summary strong {
  font-size: 14px;
  font-weight: 500
}

.settings-fold summary small {
  font-size: 11px;
  color: var(--subtle)
}

.fold-chevron {
  font-size: 18px;
  color: var(--muted);
  transition: transform .18s ease
}

.settings-fold[open] .fold-chevron {
  transform: rotate(180deg)
}

.settings-fold>summary:hover {
  background: var(--surface-soft)
}

#settingsPage .settings-fold>.settings-card {
  margin: 0;
  padding: 18px 20px 22px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-width: none
}

.settings-fold #accountRole {
  margin: 0 0 16px;
  font-size: 12px
}

.settings-fold .channel-style-card>p {
  margin: 0 0 16px
}

.settings-fold .dialog-footer {
  margin-top: 18px
}

.settings-fold #teamForm {
  margin-top: 18px;
  padding-top: 18px
}

.settings-fold #teamForm h3 {
  font-size: 14px
}

.assistant-applied-tools:has(button:not([hidden])) {
  display: flex;
  margin-top: 12px
}

.assistant-applied-tools button {
  font-size: 11px;
  height: 32px;
  padding: 0 10px;
  min-height: 32px
}

@media(max-width:580px) {
  .settings-fold>summary {
    padding: 14px 16px
  }

  #settingsPage .settings-fold>.settings-card {
    padding: 16px
  }

  .settings-fold summary strong {
    font-size: 13px
  }

  .settings-fold summary small {
    font-size: 10px
  }
}

@media(prefers-reduced-motion:reduce) {
  .fold-chevron {
    transition: none
  }
}

/* TikTok accounts */
.tt-accounts {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 16px;
  margin-bottom: 16px;
  scrollbar-width: thin
}

.tt-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 11px 16px;
  text-align: left;
  color: var(--text)
}

.tt-account:hover {
  background: var(--surface-soft)
}

.tt-account.selected {
  border-color: var(--accent);
  background: var(--accent-soft)
}

.tt-account-label {
  display: grid;
  gap: 4px;
  min-width: 0
}

.tt-account-label strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis
}

.tt-account-label small {
  font-size: 11px;
  color: var(--muted)
}

.tt-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--inset);
  color: var(--muted);
  font-size: 14px;
  overflow: hidden
}

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

.tt-avatar-large {
  width: 54px;
  height: 54px;
  font-size: 22px
}

.tt-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px
}

.tt-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0
}

.tt-identity>div {
  min-width: 0
}

.tt-identity h2 {
  font-size: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
  margin: 0
}

.tt-identity p {
  margin: 5px 0 0;
  font-size: 12px
}

.tt-identity a {
  color: var(--muted)
}

.tt-update {
  display: flex;
  align-items: center;
  gap: 16px
}

.tt-update>span {
  font-size: 11px;
  color: var(--muted);
  text-align: right
}

.tt-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px
}

.tt-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 12px
}

.tt-stat>span,
.tt-muted {
  color: var(--muted);
  font-size: 11px
}

.tt-stat>strong {
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere
}

.tt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface)
}

.tt-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left
}

.tt-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 16px 14px;
  border-bottom: 1px solid var(--line)
}

.tt-table td {
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top
}

.tt-table tr:last-child td {
  border-bottom: 0
}

.tt-video {
  min-width: 230px;
  max-width: 400px
}

.tt-video>a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere
}

.tt-table td small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px
}

.tt-table td .tt-positive {
  color: var(--accent)
}

.tt-counter {
  font-variant-numeric: tabular-nums;
  min-width: 96px
}

.tt-counter strong {
  font-weight: 500;
  font-size: 14px
}

.tt-empty {
  padding: 65px 25px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px
}

.tt-empty h2 {
  font-size: 17px
}

.tt-empty p {
  font-size: 13px;
  color: var(--muted)
}

.tt-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6
}

.tt-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-top: 14px
}

.tt-foot>p {
  margin: 0
}

.tt-help {
  font-size: 11px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6
}

.tt-help>summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted)
}

.tt-help>summary::after {
  content: ' +';
  padding-left: 6px
}

.tt-help[open]>summary::after {
  content: ' −'
}

.tt-foot>.tt-help {
  text-align: right
}

.tt-help p {
  margin: 10px 0
}

.tt-settings-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

#tiktokForm label:not(.checkbox) {
  display: grid;
  gap: 8px;
  margin: 16px 0
}

#tiktokForm label:not(.checkbox)>input,
#tiktokForm label>select,
#tiktokForm textarea {
  width: 100%
}

#tiktokForm label small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted)
}

#tiktokForm p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6
}

#tiktokForm .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0
}

#tiktokForm .checkbox input {
  width: 16px;
  height: 16px;
  margin: 0
}

@media(max-width:1000px) {
  .tt-summary {
    gap: 8px
  }

  .tt-stat {
    padding: 17px 12px
  }

  .tt-stat>strong {
    font-size: 23px
  }

  .tt-update {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px
  }

  .tt-table {
    min-width: 800px
  }
}

@media(max-width:650px) {
  .tt-account-head {
    align-items: flex-start;
    gap: 12px
  }

  .tt-update>span {
    max-width: 120px;
    line-height: 1.5
  }

  .tt-identity h2 {
    font-size: 17px
  }

  .tt-avatar-large {
    width: 44px;
    height: 44px
  }

  .tt-identity {
    gap: 10px
  }

  .tt-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .tt-stat {
    padding: 15px 12px
  }

  .tt-foot {
    flex-direction: column;
    gap: 8px
  }

  .tt-foot>.tt-help {
    text-align: left
  }

  .tt-settings-fields {
    grid-template-columns: 1fr;
    gap: 0
  }

  .tt-table td,
  .tt-table th {
    padding: 14px
  }
}

/* Recovery copies belong to the signed-in account on this browser. */
.draft-recovery {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

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

.draft-recovery span {
  flex: 1;
  min-width: 180px;
}

.system-notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}

.system-notice[hidden] {
  display: none;
}

.server-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.server-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.server-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.server-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.server-metrics>div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
}

.server-metrics dt {
  color: var(--muted);
  font-size: 12px;
}

.server-metrics dd {
  margin: 10px 0 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.server-usage-heading,
.server-status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.server-disk-bar {
  height: 8px;
  margin: 12px 0;
  background: var(--inset);
  border-radius: 6px;
  overflow: hidden;
}

.server-disk-bar>span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--text);
  border-radius: inherit;
}

.server-disk-bar.is-low>span {
  background: var(--danger);
}

.server-card .server-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 12px 0 0;
}

.server-status-row {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.server-status-row strong {
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 520px) {
  .server-metrics {
    gap: 6px;
  }

  .server-metrics>div {
    padding: 12px 8px;
  }

  .server-metrics dd {
    font-size: 18px;
  }

  .server-heading {
    flex-wrap: wrap;
  }
}

/* Grouped navigation, personal inbox and the shared API chat. */
.sidebar {
  overflow-y: auto;
}

.nav-group {
  min-width: 0;
}

.nav-group>summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-group>summary::-webkit-details-marker {
  display: none;
}

.nav-group.has-current>summary {
  color: var(--accent);
}

.nav-chevron {
  margin-left: auto;
  font-size: 17px;
  transition: transform .15s;
}

.nav-group[open] .nav-chevron {
  transform: rotate(180deg);
}

.nav-children {
  display: grid;
  gap: 4px;
  margin: 5px 0 8px 23px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.nav-children .nav {
  height: 40px;
  padding: 0 10px;
  font-size: 12px;
  gap: 9px;
}

.nav-children .nav svg {
  width: 16px;
  height: 16px;
}

.sidebar-footer #notificationsNav {
  margin-top: 4px;
  gap: 9px;
  font-size: 13px;
}

.notification-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 20px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10px;
  margin-left: auto;
}

.notification-badge[hidden] {
  display: none;
}

.notification-preferences {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 12px;
}

.notification-preferences label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
}

.notification-preferences input:not([type=checkbox]) {
  width: 100%;
  max-width: 340px;
}

.notification-preferences .checkbox {
  display: flex;
}

.notification-preferences p,
.notification-meta {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.notification-preferences p {
  margin: 10px 0 0;
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 12px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.notification-item.is-unread {
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  padding-left: 22px;
}

.notification-item-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}

.notification-item-heading strong {
  font-size: 13px;
  color: var(--muted);
}

.notification-item.is-unread .notification-item-heading strong {
  color: var(--accent);
}

.notification-item-heading time {
  color: var(--subtle);
  font-size: 11px;
}

.notification-task-title {
  font-size: 16px;
  font-weight: 550;
  margin: 10px 0 5px;
  overflow-wrap: anywhere;
}

.notification-item .notification-meta {
  margin: 0;
}

.notification-item-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.notification-read-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}

.notification-empty {
  padding: 50px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}

.notification-empty h2 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 10px;
}

.notification-empty p {
  font-size: 13px;
  line-height: 1.7;
}

.assistant-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
}

.assistant-widget[hidden],
.assistant-panel[hidden] {
  display: none;
}

.assistant-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  border: 1px solid var(--accent-line);
  border-radius: 32px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 15px 20px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 550;
}

.assistant-launcher:hover {
  background: var(--accent-hover);
}

.assistant-launcher svg {
  width: 23px;
  height: 23px;
}

.assistant-panel {
  width: 410px;
  height: min(650px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.assistant-header strong {
  display: block;
  font-size: 15px;
}

.assistant-header small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.assistant-header>div:last-child {
  display: flex;
  gap: 4px;
}

.assistant-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 23px;
}

.assistant-icon-button:hover {
  background: var(--hover);
  color: var(--text);
}

.assistant-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px;
  scroll-behavior: auto;
}

.assistant-welcome {
  padding: 6px 8px 18px;
}

.assistant-welcome-symbol {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 14px;
}

.assistant-welcome h2 {
  font-size: 24px;
  margin: 0 0 10px;
}

.assistant-welcome p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.assistant-prompts {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.assistant-prompt {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  padding: 11px 12px;
  line-height: 1.5;
}

.assistant-prompt:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.assistant-message {
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.assistant-author {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}

.assistant-text {
  white-space: pre-wrap;
}

.assistant-message.user {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 10px 13px;
  border-radius: 13px 13px 3px 13px;
  margin-left: 24px;
}

.assistant-message.assistant {
  margin-right: 12px;
  padding: 0 4px;
}

.assistant-message.is-pending {
  color: var(--muted);
}

.assistant-form {
  padding: 14px 16px 12px;
  border-top: 1px solid var(--line);
}

.assistant-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.assistant-form textarea {
  width: 100%;
  min-height: 70px;
  max-height: 140px;
  resize: vertical;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface-soft);
}

.assistant-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.assistant-compose-actions>span {
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.6;
  max-width: 175px;
}

.assistant-compose-actions .primary {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
}

.assistant-disclosure {
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.5;
  margin: 10px 0 0;
}

.assistant-error {
  color: var(--danger);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  max-height: 100px;
  overflow-y: auto;
}

@media (max-width: 750px) {
  .sidebar {
    overflow: visible;
    flex-wrap: wrap;
  }

  .sidebar nav {
    flex-basis: 100%;
    align-items: start;
  }

  .nav-group {
    flex: 1;
    position: relative;
  }

  .sidebar .nav-group>summary {
    display: flex;
    width: 100%;
    justify-content: center;
  }

  .nav-group>summary .nav-chevron {
    margin-left: 0;
  }

  .nav-children {
    position: absolute;
    top: 100%;
    left: 0;
    width: max(180px, 100%);
    z-index: 80;
    margin: 6px 0 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .sidebar .nav-children .nav {
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 4px;
  }

  .sidebar-footer .profile-nav {
    flex: 1;
    width: auto;
    margin: 0;
    min-width: 0;
  }

  .sidebar-footer #settingsNav,
  .sidebar-footer #notificationsNav {
    width: auto;
    flex-direction: row;
    height: 40px;
    padding: 0 8px;
    gap: 6px;
    margin-top: 0;
    font-size: 11px;
  }

  .sidebar-footer .profile-info {
    min-width: 0;
  }

  .sidebar-footer .profile-info strong {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-footer .profile-info small {
    display: none;
  }

  .notification-preferences {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 580px) {
  .sidebar .nav-group>summary {
    flex-direction: row;
    height: 46px;
    font-size: 12px;
    gap: 6px;
    padding: 0 8px;
  }

  .sidebar nav>#tasksNav {
    flex-direction: row;
    height: 46px;
    font-size: 12px;
  }

  .sidebar .nav-group>summary svg {
    width: 16px;
    height: 16px;
  }

  .nav-children {
    min-width: 165px;
  }

  .sidebar-footer #settingsNav svg,
  .sidebar-footer #notificationsNav svg {
    width: 17px;
    height: 17px;
  }

  .sidebar-footer .profile-avatar {
    width: 27px;
    height: 27px;
  }

  .sidebar-footer .profile-nav {
    gap: 6px;
    padding: 4px;
  }

  .sidebar-footer .profile-info strong {
    max-width: 65px;
    font-size: 11px;
  }

  .notification-item {
    padding: 18px;
  }

  .notification-item.is-unread {
    padding-left: 16px;
  }

  .assistant-widget {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .assistant-panel {
    width: calc(100vw - 24px);
    height: min(620px, calc(100dvh - 100px));
    border-radius: 16px;
  }

  .assistant-launcher {
    padding: 13px;
  }

  .assistant-launcher span {
    display: none;
  }

  .assistant-form textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-chevron {
    transition: none;
  }
}

/* Consistent work surfaces; the existing Golos font remains unchanged. */
:root {
  --bg: #f4f6f9;
  --line: #e3e8ef;
  --shadow-soft: 0 2px 8px rgba(30, 45, 65, .025);
}

:root[data-theme="dark"] {
  --bg: #11151c;
  --line: #303745;
  --shadow-soft: none;
}

.topbar {
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.collector,
.settings-card,
.news-card,
.tg-mini-chart,
.tg-metric,
.notification-item {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-line);
}

.primary,
.secondary {
  font-weight: 500;
}

.primary:disabled:hover,
.secondary:disabled:hover {
  cursor: default;
}

summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.settings-fold,
.history {
  border-color: var(--line);
}

.page-head p,
.stats-heading p {
  line-height: 1.7;
}

main {
  padding-bottom: 90px;
}

/* Tasks: views, project navigation and a five-stage board. */
.task-eyebrow {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  margin-bottom: 8px;
}

.task-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.task-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.task-summary>span {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.task-summary>strong {
  display: block;
  font-size: 28px;
  letter-spacing: -.8px;
  font-weight: 600;
  margin-top: 8px;
}

.task-summary:hover {
  border-color: var(--accent-line);
  background: var(--surface-soft);
}

.task-summary.today>strong {
  color: var(--accent);
}

.task-summary.review>strong {
  color: var(--warning);
}

.task-summary.overdue>strong {
  color: var(--danger);
}

.task-workspace {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.task-work-nav {
  min-width: 0;
  padding-top: 0;
}

.task-scope-buttons {
  display: grid;
  gap: 4px;
}

.task-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 10px 11px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-scope>span:last-child {
  font-size: 11px;
  font-weight: 500;
}

.task-scope:hover {
  background: var(--hover);
  color: var(--text);
}

.task-scope.selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.task-directions-heading {
  margin: 28px 10px 10px;
}

.task-directions-heading h2 {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.task-project {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  margin-bottom: 4px;
}

.task-project:hover {
  background: var(--hover);
  color: var(--text);
}

.task-project.selected {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.task-project-line {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.5;
}

.task-project-line>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-project-line small {
  color: var(--subtle);
}

.task-project-progress {
  display: block;
  height: 3px;
  border-radius: 6px;
  background: var(--line);
  margin-top: 8px;
  overflow: hidden;
}

.task-project-progress>span {
  display: block;
  height: 100%;
  background: var(--success);
}

.task-nav-note {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.7;
  margin: 14px 10px;
}

.task-identity {
  border: 0;
  background: none;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--accent);
  text-align: left;
}

.task-work-main {
  min-width: 0;
}

.task-view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.task-view-heading h2 {
  font-size: 20px;
  font-weight: 600;
}

.task-view-heading p {
  font-size: 11px;
  line-height: 1.8;
  margin-top: 7px;
  max-width: 540px;
}

.task-view-switch {
  flex-shrink: 0;
}

.task-view-switch button {
  font-size: 11px;
  padding: 8px 14px;
  min-width: 60px;
}

#tasksPage .task-quick-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 12px;
}

#tasksPage .task-quick-form>span {
  color: var(--subtle);
  font-size: 22px;
  padding-left: 4px;
}

#tasksPage .task-quick-form input {
  flex: 1;
  width: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  font-size: 12px;
}

#tasksPage .task-quick-form .primary {
  flex-shrink: 0;
  min-width: 0;
  min-height: 34px;
  font-size: 11px;
  padding: 8px 13px;
}

#tasksPage .task-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

#tasksPage .task-toolbar>input {
  flex: 1 1 180px;
  min-width: 130px;
  width: 180px;
  max-width: none;
  font-size: 11px;
  padding: 10px 12px;
}

#tasksPage .task-toolbar>select {
  font-size: 11px;
  padding: 10px 26px 10px 10px;
  min-width: 0;
  max-width: 180px;
}

#taskVisibleCount {
  color: var(--subtle);
  font-size: 10px;
  margin-left: auto;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
  align-items: start;
  padding: 2px 2px 16px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.task-stage {
  min-width: 0;
  min-height: 350px;
  background: var(--inset);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px;
}

.task-stage.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.task-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 33px;
  margin-bottom: 9px;
}

.task-stage-heading h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
}

.task-stage-heading h3::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
}

.task-stage[data-status=doing] .task-stage-heading h3::before {
  background: var(--accent);
}

.task-stage[data-status=waiting] .task-stage-heading h3::before,
.task-stage[data-status=review] .task-stage-heading h3::before {
  background: var(--warning);
}

.task-stage[data-status=done] .task-stage-heading h3::before {
  background: var(--success);
}

.task-stage-heading h3 span {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 400;
}

.task-stage-add {
  border: 0;
  background: transparent;
  color: var(--subtle);
  font-size: 20px;
  width: 25px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}

.task-stage-add:hover {
  color: var(--text);
  background: var(--hover);
}

.task-stage-empty {
  color: var(--subtle);
  text-align: center;
  font-size: 10px;
  line-height: 1.7;
  padding: 24px 5px;
}

.work-task {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}

.work-task:hover {
  border-color: var(--line-strong);
}

.work-task.is-important {
  border-top: 2px solid var(--warning);
}

.work-task.is-dragging {
  opacity: .45;
}

.work-task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 24px;
  margin-bottom: 5px;
}

.work-task-project {
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.6;
}

.task-focus-button {
  border: 0;
  background: transparent;
  padding: 1px 4px;
  color: var(--subtle);
  font-size: 21px;
  line-height: 1;
}

.task-focus-button:hover,
.task-focus-button.selected {
  color: var(--accent);
}

.work-task-title {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
  padding: 0;
  overflow-wrap: anywhere;
}

.work-task-title:hover {
  color: var(--accent);
}

.work-task.is-done .work-task-title {
  color: var(--muted);
}

.work-task-description {
  font-size: 10px;
  line-height: 1.7;
  margin-top: 7px;
  color: var(--muted);
  white-space: pre-line;
}

.work-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.work-task-meta>span,
.work-task-meta>time {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 9px;
  line-height: 1.5;
}

.task-person-pill {
  background: var(--inset);
  color: var(--muted);
}

.task-priority-pill {
  background: var(--warning-soft);
  color: var(--warning);
}

.task-due-pill {
  color: var(--muted);
  background: var(--surface-soft);
}

.task-due-pill.is-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-carry-pill {
  color: var(--accent);
  background: var(--accent-soft);
}

.task-wait-note,
.task-review-note {
  font-size: 10px;
  line-height: 1.7;
  margin-top: 9px;
  padding-left: 8px;
  border-left: 2px solid var(--accent-line);
}

.task-wait-note {
  border-color: var(--warning);
  color: var(--warning);
}

.task-blocked-note {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 9px;
  line-height: 1.7;
  text-align: left;
  margin-top: 9px;
  overflow-wrap: anywhere;
}

.work-task-steps {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 11px;
}

.work-task-steps>summary {
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.work-task-steps .task-step-label {
  font-size: 10px;
  margin-top: 7px;
  gap: 7px;
}

.work-task-steps .task-step-label input {
  width: 13px;
  height: 13px;
  min-width: 13px;
}

.work-task-progress {
  height: 3px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--inset);
  margin-top: 8px;
}

.work-task-progress>span {
  display: block;
  height: 100%;
  background: var(--success);
}

.work-task-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.6;
}

.work-task-related .task-post-link {
  font-size: 9px;
  padding: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}

.work-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.task-stage-select {
  min-width: 0;
  max-width: 115px;
  padding: 5px 2px;
  font-size: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
}

.task-card-action {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 9px;
  padding: 5px 0;
  white-space: nowrap;
}

.task-list-group {
  margin-top: 18px;
}

.task-list-group>h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin: 0 0 10px 3px;
}

.task-list-group>h3 span {
  color: var(--subtle);
  font-weight: 400;
}

.work-task-list {
  padding: 17px 20px;
}

.work-task-list .work-task-title {
  font-size: 14px;
}

.work-task-list .work-task-description {
  max-width: 800px;
  font-size: 12px;
}

.work-task-list .work-task-project,
.work-task-list .work-task-meta>span,
.work-task-list .work-task-meta>time,
.work-task-list .task-stage-select,
.work-task-list .task-card-action,
.work-task-list .work-task-related,
.work-task-list .work-task-related .task-post-link {
  font-size: 11px;
}

.work-task-list .work-task-steps>summary,
.work-task-list .work-task-steps .task-step-label,
.work-task-list .task-blocked-note,
.work-task-list .task-wait-note,
.work-task-list .task-review-note {
  font-size: 11px;
}

/* Task detail: content on the left, responsibility and timing on the right. */
#taskEditor.task-detail-dialog {
  width: min(1000px, calc(100vw - 40px));
  max-width: 1000px;
  border-radius: 18px;
}

#taskEditor #taskForm {
  padding: 0;
}

#taskEditor .dialog-head {
  margin: 0;
  padding: 20px 26px;
}

#taskEditor .dialog-head h2 {
  font-size: 20px;
}

#taskEditor .dialog-head .task-eyebrow {
  margin-bottom: 5px;
}

.task-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
}

.task-detail-main {
  padding: 24px 26px;
  min-width: 0;
}

.task-detail-side {
  padding: 24px 22px;
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
  min-width: 0;
}

.task-detail-main>label,
.task-detail-side>label,
.task-extra>label,
.task-discussion>label,
.task-due-fields>label {
  display: block;
  font-size: 12px;
  margin-bottom: 18px;
}

#taskEditor input:not([type=checkbox]),
#taskEditor select,
#taskEditor textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  font-size: 12px;
}

#taskEditor textarea {
  line-height: 1.75;
  resize: vertical;
  min-height: 65px;
}

#taskEditor #taskTitle {
  font-size: 16px;
  font-weight: 500;
}

#taskEditor #taskOutcome {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.task-detail-side input,
.task-detail-side select,
.task-detail-side textarea {
  background: var(--surface);
}

.task-due-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
}

#taskEditor .task-due-fields input {
  padding: 10px 6px;
  font-size: 11px;
  min-width: 0;
}

.task-detail-side>button {
  width: 100%;
  margin-top: 12px;
  font-size: 11px;
}

.task-field-note {
  font-size: 10px;
  color: var(--subtle);
  line-height: 1.8;
  white-space: pre-line;
}

.task-detail-side .task-field-note {
  margin-top: 12px;
}

.task-extra {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.task-extra>summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  list-style: none;
}

.task-extra>summary::after {
  content: '+';
  color: var(--subtle);
  margin-left: auto;
}

.task-extra[open]>summary::after {
  content: '−';
}

.task-extra>summary span {
  font-size: 10px;
  color: var(--subtle);
}

#taskMaterialLinks {
  display: grid;
  gap: 6px;
  margin: -8px 0 18px;
  font-size: 11px;
  color: var(--accent);
  overflow-wrap: anywhere;
}

#taskPostLink {
  margin-top: -8px;
  margin-bottom: 18px;
}

.task-dependency-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
}

.task-dependency-heading h3 {
  font-size: 12px;
}

.task-dependency-heading span {
  font-size: 10px;
  color: var(--subtle);
}

.task-dependencies {
  max-height: 220px;
  overflow-y: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 12px;
}

.task-dependency-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 11px;
  line-height: 1.7;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.task-dependency-option:last-child {
  border: 0;
}

.task-dependency-option input {
  margin-top: 3px;
  flex-shrink: 0;
}

.task-dependency-option>span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-dependency-option small {
  font-size: 9px;
  color: var(--subtle);
}

.task-discussion {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.task-comment {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface-soft);
}

.task-comment-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  margin-bottom: 7px;
}

.task-comment-heading time {
  color: var(--subtle);
}

.task-comment>p {
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.task-discussion>label {
  margin-top: 18px;
}

.task-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.task-comment-actions>button {
  font-size: 11px;
}

.task-editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  background: var(--surface);
}

#taskEditor .task-editor-footer .dialog-footer {
  margin: 0;
  padding: 0;
}

#taskEditorMessage {
  font-size: 12px;
  line-height: 1.7;
  color: var(--danger);
  margin: 0 0 10px;
}

#taskEditorMessage:empty {
  display: none;
}

.task-danger-button {
  margin-right: auto;
  border: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 11px;
  color: var(--danger);
}

#taskEditor #taskSteps .task-edit-step input[type=text] {
  margin-top: 0;
}

#taskEditor .task-checklist-heading {
  margin-top: 22px;
}

@media (max-width: 1250px) {
  .task-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .task-work-nav {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
  }

  .task-scope-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .task-scope {
    width: auto;
    gap: 12px;
  }

  .task-directions-heading {
    display: none;
  }

  #taskProjects {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
  }

  .task-project {
    width: auto;
    margin: 0;
    padding: 7px 10px;
  }

  .task-project-line {
    gap: 10px;
  }

  .task-project-progress {
    display: none;
  }

  .task-nav-note {
    display: none;
  }

  .task-identity {
    margin-top: 7px;
    padding-bottom: 0;
  }

  .task-board {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
}

@media (max-width: 750px) {
  .task-overview {
    gap: 8px;
    margin-bottom: 20px;
  }

  .task-summary {
    padding: 13px 12px;
  }

  .task-summary>span {
    font-size: 10px;
  }

  .task-summary>strong {
    font-size: 24px;
  }

  .task-view-heading {
    flex-wrap: wrap;
  }

  .task-view-heading h2 {
    font-size: 18px;
  }

  .task-stage {
    min-height: 280px;
  }

  .task-detail-layout {
    grid-template-columns: 1fr;
  }

  .task-detail-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .task-detail-side>label,
  .task-due-fields>label {
    margin-bottom: 0;
  }

  .task-due-fields,
  #taskWaitingField {
    grid-column: 1 / -1;
  }

  .task-detail-side>.task-field-note,
  #taskEditorMeta {
    grid-column: 1 / -1;
    margin: 0;
  }

  .task-detail-side>button {
    margin: 0;
  }

  #taskEditor.task-detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .task-detail-main {
    padding: 20px;
  }

  #taskEditor .dialog-head {
    padding: 16px 20px;
  }

  .task-editor-footer {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .task-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .task-summary>strong {
    font-size: 24px;
    margin: 0;
  }

  .task-summary>span {
    max-width: 85px;
  }

  .task-scope {
    font-size: 11px;
    padding: 8px;
  }

  .task-head-actions {
    width: 100%;
  }

  .task-head-actions .primary {
    flex: 1;
  }

  #tasksPage .task-toolbar>select {
    flex: 1;
    max-width: none;
    width: 0;
  }

  #tasksPage .task-toolbar>input {
    flex-basis: 100%;
  }

  #taskVisibleCount {
    display: none;
  }

  .task-board {
    grid-template-columns: repeat(5, 250px);
  }

  .work-task-list {
    padding: 15px;
  }

  #taskEditor.task-detail-dialog {
    border-radius: 12px;
  }

  #taskEditor .task-editor-footer .dialog-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-danger-button {
    width: 100%;
    text-align: left;
  }

  #taskEditor .task-editor-footer .primary,
  #taskReviewAction {
    flex: 1;
    font-size: 11px;
  }

  #taskEditor input:not([type=checkbox]),
  #taskEditor select,
  #taskEditor textarea {
    font-size: 16px;
  }

  #taskEditor .task-due-fields input {
    font-size: 14px;
  }
}

/* Compact links between editorial work and tasks. */
.post-task-links {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

.post-task-links>summary {
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.post-task-links[open]>summary {
  margin-bottom: 14px;
}

#postTaskList {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.post-related-task {
  border: 0;
  background: var(--surface-soft);
  color: var(--accent);
  border-radius: 8px;
  text-align: left;
  padding: 9px 11px;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#postTaskMessage {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 12px;
}

#postTaskMessage:empty {
  display: none;
}

#postCreateTask {
  font-size: 11px;
}

#taskEditor .task-dependency-option {
  display: flex;
  margin: 0;
  font-weight: 400;
}

.task-view-switch {
  display: flex;
  width: auto;
  grid-template-columns: none;
}

.work-task-title {
  font-size: 13px;
}

.work-task-description {
  font-size: 11px;
}

.work-task-project,
.work-task-meta>span,
.work-task-meta>time,
.task-stage-select,
.task-card-action {
  font-size: 10px;
}

.task-stage-heading h3 {
  font-size: 12px;
}

/* Tasks use aligned rows; detailed content stays in the editor. */
#tasksPage .page-head {
  align-items: center;
  margin-bottom: 24px;
}

#tasksPage .task-workspace {
  gap: 24px;
}

#tasksPage .task-quick-form {
  min-height: 52px;
  padding: 8px 12px;
}

#tasksPage .task-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 166px 156px auto;
  gap: 10px;
  align-items: center;
}

#tasksPage .task-toolbar>input,
#tasksPage .task-toolbar>select {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 38px;
  margin: 0;
  font-size: 12px;
}

#taskVisibleCount {
  white-space: nowrap;
  text-align: right;
  min-width: 54px;
}

#taskList {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}

.task-col-plan {
  width: 36px;
}

.task-col-person {
  width: 104px;
}

.task-col-due {
  width: 100px;
}

.task-col-stage {
  width: 130px;
}

.task-col-steps {
  width: 60px;
}

.task-col-actions {
  width: 76px;
}

.task-table th {
  background: var(--surface-soft);
  color: var(--subtle);
  font-size: 10px;
  font-weight: 500;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.task-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
  vertical-align: middle;
  color: var(--muted);
}

.task-table tbody>tr:last-child>td {
  border-bottom: 0;
}

.task-table .task-cell-plan {
  padding-right: 0;
  padding-left: 10px;
}

.task-line:hover {
  background: var(--surface-soft);
}

.task-line-title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.task-line-title:hover {
  color: var(--accent);
}

.task-line.is-done .task-line-title {
  color: var(--muted);
}

.task-line-context {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: 10px;
  margin-top: 3px;
  line-height: 1.6;
}

.task-line-priority {
  color: var(--warning);
  font-weight: 600;
}

.task-line-blocker {
  color: var(--warning);
  border: 0;
  background: none;
  font-size: 14px;
  padding: 0;
}

.task-line .task-focus-button {
  font-size: 20px;
  padding: 2px;
}

.task-line .task-stage-select {
  display: block;
  width: 100%;
  max-width: none;
  height: 32px;
  min-height: 0;
  margin: 0;
  font-size: 11px;
  padding: 4px 3px;
  background: transparent;
  border-radius: 6px;
}

.task-line .task-stage-select[data-status=doing] {
  color: var(--accent);
}

.task-line .task-stage-select[data-status=waiting],
.task-line .task-stage-select[data-status=review] {
  color: var(--warning);
}

.task-line .task-stage-select[data-status=done] {
  color: var(--success);
}

.task-cell-due time {
  white-space: normal;
  font-size: 11px;
}

.task-cell-due time.is-overdue {
  color: var(--danger);
}

.task-cell-steps {
  text-align: center;
}

.task-line-empty {
  color: var(--subtle);
}

.task-line-progress {
  display: inline-block;
  min-width: 32px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.task-line-progress:hover {
  color: var(--accent);
}

.task-line-progress[aria-expanded=true] {
  color: var(--accent);
}

.task-line .task-card-action {
  font-size: 10px;
}

.task-line-detail>td {
  padding: 0 12px 14px 46px;
  background: var(--surface-soft);
}

.task-line-checklist {
  display: grid;
  gap: 5px;
}

.task-line-checklist .task-step-label {
  margin: 0;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 400;
}

.task-list-empty {
  padding: 32px 20px;
  text-align: center;
}

.task-list-empty p {
  font-size: 12px;
}

@media (max-width: 1100px) {
  #tasksPage .task-toolbar {
    grid-template-columns: minmax(150px, 1fr) 156px 148px;
  }

  #taskVisibleCount {
    display: none;
  }

  .task-col-person {
    width: 94px;
  }

  .task-col-due {
    width: 92px;
  }

  .task-col-stage {
    width: 122px;
  }
}

@media (max-width: 750px) {
  #tasksPage .task-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  #tasksPage .task-toolbar>input {
    grid-column: 1 / -1;
  }

  #tasksPage .task-toolbar>select {
    width: 100%;
  }

  .task-table,
  .task-table tbody {
    display: block;
    width: 100%;
  }

  .task-table colgroup {
    display: none;
  }

  .task-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .task-table tr.task-line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 110px;
    gap: 6px 9px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
  }

  .task-table tr.task-line:last-child {
    border-bottom: 0;
  }

  .task-table .task-line td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .task-cell-plan {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: start;
  }

  .task-cell-name {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .task-cell-person {
    grid-column: 2;
    grid-row: 2;
  }

  .task-cell-due {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
  }

  .task-cell-stage {
    grid-column: 2;
    grid-row: 3;
  }

  .task-cell-steps {
    grid-column: 3;
    grid-row: 3;
    text-align: right;
  }

  .task-cell-actions {
    grid-column: 2 / -1;
    grid-row: 4;
    text-align: right;
  }

  .task-cell-actions:empty {
    display: none !important;
  }

  .task-line-title {
    font-size: 13px;
  }

  .task-line .task-stage-select {
    width: 130px;
    height: 28px;
    padding: 2px 0;
  }

  .task-line-detail {
    display: block;
  }

  .task-line-detail>td {
    display: block;
    padding: 0 15px 14px 45px;
    border-bottom: 1px solid var(--line);
  }
}

.task-table th:nth-child(6) { text-align: center; }

/* Creation and filters share the heading; the list aligns with its navigation. */
.task-list-actions { display: flex; align-items: center; gap: 12px; margin: 0; }
.task-list-tools { display: flex; align-items: center; gap: 8px; }
.task-filter-menu { position: relative; }
.task-filter-menu > summary { display: flex; align-items: center; list-style: none; min-height: 40px; padding: 9px 14px; cursor: pointer; font-size: 12px; }
.task-filter-menu > summary::-webkit-details-marker { display: none; }
.task-filter-menu[open] > summary { border-color: var(--accent-line); color: var(--accent); }
.task-filter-popover { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 300px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
#tasksPage .task-filter-popover .task-toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; }
#tasksPage .task-filter-popover .task-toolbar > input { grid-column: auto; }
#tasksPage .task-filter-popover #taskVisibleCount { display: block; text-align: left; margin: 0; }
@media(max-width: 480px) {
  #tasksPage .page-head > div:first-child { width: 100%; }
  .task-list-actions { width: 100%; }
  .task-list-actions > #taskNew { flex: 1; min-width: 0; font-size: 12px; padding: 10px 12px; }
  .task-filter-menu > summary { padding: 9px 10px; }
  .task-filter-popover { width: min(300px, calc(100vw - 40px)); }
}

/* A compact inbox with a bell state and event-specific symbols. */
#notificationsNav.has-unread>svg {
  color: var(--accent);
}

#notificationsNav.has-unread>svg>path {
  fill: var(--accent-soft);
}

#notificationsNav .notification-alert-dot {
  fill: var(--accent);
  stroke: var(--sidebar);
  stroke-width: 2px;
}

#notificationsPage .page-head {
  margin-bottom: 24px;
}

#notificationsPage .notification-toolbar {
  margin: 0 0 18px;
  gap: 12px;
}

#notificationsPage .segmented {
  display: flex;
  width: auto;
}

#notificationsPage .segmented button {
  padding: 8px 14px;
  font-size: 12px;
}

.notification-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-tools>button,
.notification-options>summary {
  min-height: 38px;
  font-size: 11px;
}

.notification-refresh-icon {
  min-width: 38px;
  width: 38px;
  padding: 0;
  font-size: 21px !important;
}

.notification-options {
  position: relative;
}

.notification-options>summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 9px 12px;
}

.notification-options>summary::-webkit-details-marker {
  display: none;
}

.notification-options[open]>summary {
  color: var(--accent);
  border-color: var(--accent-line);
}

#notificationPreferences {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

#notificationPreferences label {
  margin: 0;
  font-size: 12px;
}

#notificationPerson {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 8px;
  padding: 10px 12px;
}

#notificationPreferences .checkbox {
  gap: 8px;
  align-items: center;
  font-weight: 400;
}

#notificationPreferences .primary {
  justify-self: start;
  font-size: 12px;
  padding: 9px 14px;
}

#notificationIdentityWarning {
  margin: 0;
  color: var(--warning);
  font-size: 11px;
}

#notificationList {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

#notificationList.is-empty {
  border: 0;
  background: transparent;
  overflow: visible;
}

#notificationList .notification-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 12px;
  margin: 0;
  padding: 17px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#notificationList .notification-item:last-child {
  border-bottom: 0;
}

#notificationList .notification-item.is-unread {
  padding-left: 20px;
  background: var(--surface-soft);
}

.notification-type-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 28px;
  color: var(--subtle);
}

.notification-type-icon svg {
  width: 21px;
  height: 21px;
}

.notification-item[data-kind=assigned]>.notification-type-icon,
.notification-item[data-kind=comment]>.notification-type-icon {
  color: var(--accent);
}

.notification-item[data-kind=deadline]>.notification-type-icon {
  color: var(--danger);
}

.notification-item[data-kind=review]>.notification-type-icon,
.notification-item[data-kind=returned]>.notification-type-icon,
.notification-item[data-kind=today]>.notification-type-icon {
  color: var(--warning);
}

.notification-item[data-kind=done]>.notification-type-icon {
  color: var(--success);
}

.notification-item:not(.is-unread)>.notification-type-icon {
  opacity: .65;
}

#notificationList .notification-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

#notificationList .notification-item-heading time {
  font-size: 10px;
  white-space: nowrap;
}

.notification-task-link {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  text-align: left;
  overflow-wrap: anywhere;
  margin-top: 3px;
}

.notification-task-link:hover {
  color: var(--accent);
}

#notificationList .notification-task-title {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.7;
}

.notification-detail {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 4px;
}

#notificationList .notification-read-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--subtle);
  padding: 0;
  font-size: 16px;
}

#notificationList .notification-read-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

#notificationList .notification-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 60px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#notificationList .notification-empty>.notification-type-icon {
  width: 36px;
  height: 36px;
}

#notificationList .notification-empty svg {
  width: 30px;
  height: 30px;
}

#notificationList .notification-empty p {
  color: var(--muted);
  font-size: 13px;
}

#notificationList .notification-empty .secondary {
  font-size: 12px;
}

@media(max-width: 580px) {
  .notification-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #notificationsPage .notification-toolbar {
    align-items: center;
    gap: 10px;
  }

  #notificationList .notification-item {
    gap: 9px;
    padding: 15px 12px;
    grid-template-columns: 24px minmax(0, 1fr) 26px;
  }

  #notificationList .notification-item.is-unread {
    padding-left: 12px;
  }

  #notificationList .notification-item-heading time {
    font-size: 9px;
  }

  .notification-task-link {
    font-size: 13px;
  }

  #notificationPreferences {
    width: min(320px, calc(100vw - 40px));
    right: -46px;
  }
}
