@font-face {
  font-family: Schibsted Grotesk;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/schibsted-grotesk.ttf') format('truetype');
}
@font-face {
  font-family: Instrument Serif;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/instrument-serif-italic.woff2') format('woff2');
}
:root {
  color-scheme: light;
  --paper: #f8f9fc;
  --surface: #fff;
  --ink: #222936;
  --muted: #626a75;
  --line: #e0e4e9;
  --accent: #222936;
  --accent-hover: #394458;
  --wash: #edf0f6;
  --soft: #596b88;
  --danger: #a72f37;
  --good: #27734c;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-width: 320px;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--soft);
  outline-offset: 4px;
}
img,
video {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
}
header,
main,
footer {
  width: min(1240px, calc(100% - 80px));
  margin-inline: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.brand svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wash);
}
.language-links {
  display: flex;
  gap: 5px;
  font-size: 12px;
  flex: none;
}
.language-links a {
  padding: 8px;
  text-decoration: none;
  color: var(--muted);
}
.language-links a[aria-current='page'] {
  font-weight: 600;
  color: var(--ink);
  background: var(--wash);
  border-radius: 7px;
}
.app-nav {
  display: flex;
  gap: 8px;
  margin-right: auto;
  margin-left: 42px;
}
.app-nav a {
  font-size: 14px;
  text-decoration: none;
  padding: 9px 13px;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
}
.app-nav a:hover,
.language-links a:hover {
  background: var(--wash);
  color: var(--ink);
}
.app-nav a[aria-current='page'] {
  background: var(--wash);
  color: var(--ink);
  font-weight: 600;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 12px;
  background: var(--ink);
  color: white;
  z-index: 100;
}
.skip-link:focus {
  top: 10px;
}
main {
  padding-block: 52px 80px;
  min-height: calc(100svh - 210px);
}
.heading {
  max-width: 820px;
  margin-bottom: 36px;
}
.heading-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
  margin-bottom: 34px;
}
.heading-row .heading {
  margin: 0;
}
h1 {
  font-size: 2.5rem;
  line-height: 1.09;
  letter-spacing: -0.04em;
  font-weight: 500;
  text-wrap: balance;
  margin: 0 0 18px;
}
h1 em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  color: var(--soft);
  font-size: 1.08em;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 12px;
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px;
}
p {
  margin: 0 0 18px;
  max-width: 70ch;
}
.lede {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 61ch;
}
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 54px;
}
.summary {
  padding-top: 6px;
}
.summary h2 {
  font-size: 1rem;
}
.summary dl {
  margin: 22px 0;
}
.summary dt {
  font-size: 12px;
  color: var(--muted);
  margin-top: 24px;
}
.summary dd {
  font-size: 14px;
  margin: 7px 0 0;
  overflow-wrap: anywhere;
}
.summary .note {
  font-size: 13px;
  color: var(--muted);
  margin-top: 32px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
}
.status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}
.status.good::before {
  background: var(--good);
}
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.sheet section {
  padding: 30px 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 25px;
}
.sheet section:first-child {
  border-top: 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.section-head .status {
  flex-shrink: 0;
}
.description {
  color: var(--muted);
  font-size: 14px;
}
.field {
  display: grid;
  gap: 8px;
  margin-top: 23px;
}
label {
  font-size: 14px;
  font-weight: 500;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #aeb7c4;
  border-radius: 9px;
  line-height: 1.5;
}
textarea {
  resize: vertical;
  min-height: 108px;
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--soft);
}
::placeholder {
  color: var(--muted);
}
input[type='file'] {
  border: 0;
  padding: 0;
  font-size: 13px;
}
input[type='file']::file-selector-button {
  padding: 12px 14px;
  margin-right: 14px;
  background: var(--wash);
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 25px 0;
  font-weight: 400;
  font-size: 14px;
}
.check input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 3px 0 0;
  accent-color: var(--accent);
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease-out;
}
button:hover,
.button:hover {
  background: var(--accent-hover);
  color: #fff;
}
button:active,
.button:active {
  background: #151b27;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.secondary:hover {
  background: var(--wash);
  color: var(--ink);
}
.text-link {
  font-size: 13px;
  color: var(--soft);
  white-space: nowrap;
}
.notice {
  padding: 16px 20px;
  border: 1px solid #b9c8df;
  border-radius: 10px;
  background: var(--wash);
  margin-bottom: 28px;
  font-size: 14px;
}
.error {
  color: var(--danger);
  border-color: #e9b8bc;
  background: #fff2f3;
}
.post-list {
  padding: 0;
  list-style: none;
  margin: 24px 0 0;
}
.post-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.post-info {
  min-width: 0;
}
.post-ref {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.post-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.post-list button {
  min-height: 40px;
  padding: 9px 14px;
  font-size: 13px;
}
.empty {
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}
.empty h2 {
  color: var(--ink);
}
footer {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 24px 30px;
  font-size: 12px;
  color: var(--muted);
}
footer p {
  margin: 0;
}
footer button {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  font-size: inherit;
  font-weight: 400;
}
footer button:hover {
  color: var(--ink);
  background: none;
}
.simple {
  max-width: 620px;
  margin: 45px auto;
  min-height: 42vh;
}
.simple h1 {
  margin-bottom: 24px;
}
.simple form {
  margin: 25px 0;
}
.ig-steps .button,
.ig-steps button {
  display: block;
  width: 100%;
  text-align: center;
}
.ig-steps form {
  margin: 22px 0 0;
}
.ig-steps .note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.ig-more {
  margin-top: 36px;
}
.ig-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.ig-more form {
  margin-top: 14px;
}
.preview {
  padding: 8px 16px;
  text-align: center;
  background: var(--wash);
  color: var(--soft);
  font-size: 12px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
.small a {
  color: var(--soft);
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}
.actions form {
  margin: 0;
}
.file-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}
.file-details > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-button {
  flex: none;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  color: var(--soft);
  background: none;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button:hover {
  color: var(--ink);
  background: none;
}
.file-preview {
  border-radius: 10px;
  max-height: 270px;
  width: 100%;
  object-fit: contain;
  background: var(--wash);
  margin-bottom: 12px;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.post-tile {
  min-width: 0;
  text-decoration: none;
  display: block;
}
.post-tile:hover .tile-image img {
  transform: scale(1.025);
}
.tile-image {
  position: relative;
  aspect-ratio: 1.25;
  background: var(--wash);
  border-radius: 12px;
  overflow: hidden;
}
.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease-out;
}
.tile-image .badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: var(--surface);
  max-width: calc(100% - 24px);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11px;
  background: var(--wash);
  color: var(--soft);
  line-height: 1.4;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.badge.published,
.badge.scheduled {
  color: var(--good);
}
.badge.failed,
.badge.investigation {
  color: var(--danger);
}
.tile-copy {
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-meta {
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}
.tile-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin: 0 0 27px;
  overflow: auto;
}
.tabs a {
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  padding: 8px 13px;
  color: var(--muted);
  border-radius: 8px;
}
.tabs a[aria-current='page'] {
  background: var(--ink);
  color: white;
}
.tabs a:hover {
  background: var(--wash);
  color: var(--ink);
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: start;
}
.detail-media {
  position: sticky;
  top: 24px;
}
.detail-media img,
.detail-media video {
  width: 100%;
  border-radius: 14px;
  max-height: 680px;
  object-fit: contain;
  background: var(--wash);
}
.detail-media .small {
  margin: 15px 0;
}
.caption-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.caption-block:first-child {
  padding-top: 0;
}
.caption-block h2 {
  font-size: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.caption-block p,
.report-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.75;
}
.caption-block small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.approval-box {
  margin-top: 26px;
  padding: 22px 24px;
  background: var(--wash);
  border-radius: 12px;
}
.approval-box p {
  font-size: 13px;
  color: var(--soft);
}
.approval-box button {
  width: 100%;
}
details {
  border-bottom: 1px solid var(--line);
  padding: 21px 0;
}
summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
details .field {
  margin-top: 16px;
}
details button {
  margin-top: 16px;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.legal-links a {
  color: var(--muted);
}
.legal-links a:hover {
  color: var(--ink);
}
.danger-zone h2 {
  color: var(--danger);
}
button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
button.danger:hover {
  background: #8c262d;
  border-color: #8c262d;
}
.cancel-button {
  background: none;
  border: 0;
  padding: 10px 0;
  color: var(--danger);
}
.cancel-button:hover {
  background: none;
  color: var(--danger);
  text-decoration: underline;
}
.review-item {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  max-width: 840px;
}
.review-item blockquote {
  margin: 18px 0;
  color: var(--muted);
  font-size: 15px;
}
.review-item .reply-draft {
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--wash);
  font-size: 14px;
  white-space: pre-wrap;
}
.review-item h2 {
  font-size: 17px;
}
.review-item .stars {
  color: var(--soft);
  font-size: 15px;
}
.report-item {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.report-item time {
  font-size: 12px;
  color: var(--muted);
}
.report-text {
  max-width: 78ch;
  margin-top: 16px;
}
.empty-illustration {
  width: 70px;
  height: 70px;
  margin-bottom: 22px;
  color: var(--soft);
}
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 940px;
  margin: 20px auto;
  gap: 90px;
  align-items: center;
}
.login-form {
  padding: 20px 0;
}
.login-portrait {
  height: 550px;
  background: #edf1f7;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  padding: 34px;
}
.login-portrait img {
  position: absolute;
  bottom: -110px;
  left: 50%;
  transform: translateX(-50%);
  height: 540px;
  max-width: none;
}
.login-portrait p {
  position: relative;
  z-index: 1;
  font-size: 25px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  color: var(--soft);
  line-height: 1.2;
  max-width: 200px;
}
.settings-nav {
  display: grid;
  gap: 5px;
  margin-bottom: 30px;
}
.settings-nav a {
  font-size: 14px;
  text-decoration: none;
  padding: 8px 0;
  color: var(--muted);
}
.settings-nav a:hover {
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
noscript {
  display: block;
  padding: 20px;
  background: var(--wash);
}
@media (min-width: 1600px) {
  header,
  main,
  footer {
    width: min(1360px, calc(100% - 120px));
  }
}
@media (max-width: 1050px) {
  header,
  main,
  footer {
    width: calc(100% - 48px);
  }
  header {
    flex-wrap: wrap;
    gap: 10px 20px;
  }
  .app-nav {
    order: 3;
    flex-basis: 100%;
    margin: 8px 0 -9px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .language-links {
    margin-left: auto;
  }
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    gap: 30px;
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .login-layout {
    gap: 45px;
  }
  .heading-row h1 {
    font-size: 2.6rem;
  }
}
@media (max-width: 760px) {
  header,
  main,
  footer {
    width: calc(100% - 36px);
  }
  header {
    padding: 18px 0 12px;
  }
  .brand {
    font-size: 21px;
  }
  .brand svg {
    width: 26px;
    height: 26px;
  }
  .app-nav {
    gap: 2px;
  }
  .app-nav a {
    padding: 9px 10px;
    font-size: 12px;
  }
  .language-links {
    gap: 0;
  }
  .language-links a {
    padding: 8px 6px;
    font-size: 11px;
  }
  main {
    padding-block: 30px 45px;
  }
  .heading {
    margin-bottom: 25px;
  }
  h1,
  .heading-row h1 {
    font-size: 2.35rem;
  }
  .heading-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
  }
  .heading-row .button {
    width: 100%;
  }
  .layout,
  .detail-grid,
  .login-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .summary {
    display: none;
  }
  .sheet section {
    padding: 24px 21px;
  }
  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 9px;
  }
  .post-list li {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .post-grid {
    gap: 22px 14px;
  }
  .tile-image {
    aspect-ratio: 1;
  }
  .tile-copy {
    font-size: 13px;
  }
  .tile-meta {
    display: block;
  }
  .tile-meta time {
    display: block;
    margin-top: 3px;
  }
  .tile-image .badge {
    left: 7px;
    bottom: 7px;
    padding: 4px 6px;
    font-size: 10px;
  }
  .detail-media {
    position: static;
  }
  .detail-media img,
  .detail-media video {
    max-height: 450px;
  }
  .login-layout {
    margin: 0;
  }
  .login-portrait {
    display: none;
  }
  .login-form {
    max-width: 480px;
    margin: auto;
  }
  .actions > .button,
  .actions > form {
    flex-grow: 1;
  }
  .actions form button {
    width: 100%;
  }
  .tabs {
    gap: 0;
  }
  .tabs a {
    padding: 8px 10px;
    font-size: 12px;
  }
  .text-link {
    font-size: 12px;
  }
  footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .simple {
    margin: 20px auto;
  }
  .preview {
    font-size: 11px;
  }
  .settings-nav {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.otp-input {
  font-size: 29px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  padding: 13px 16px;
  width: 100%;
  max-width: 300px;
}
.phone-sent {
  font-size: 18px;
  font-weight: 500;
  margin: 22px 0;
}
.login-form form {
  margin: 20px 0;
}
.resend-form button {
  min-height: 44px;
}
.login-form .check {
  max-width: 350px;
}
.login-form .actions button {
  width: 100%;
}
.tile-image > svg {
  width: 42px;
  height: 42px;
  margin: 35% auto;
}
.report-item:first-of-type {
  margin-top: 30px;
}
.login-portrait img {
  width: auto;
}

@media (max-width: 760px) {
  .app-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    gap: 2px;
    width: 100%;
  }
  .app-nav a {
    padding: 9px 6px;
    text-align: center;
    white-space: normal;
  }
}

/* ------------------------------------------------------------------
   Workspace shell and chat (WhatsApp-like, Tibbi's own design)
   ------------------------------------------------------------------ */
:root {
  --brand: #536684;
  --brand-hover: #44567a;
  --brand-wash: #e4e9f2;
  --chat-bg: #f4f6fa;
  --out-bg: #e6ebf4;
  --out-line: #d3dbe8;
  --rail-w: 84px;
  --panel-w: 392px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}
.icon {
  width: 22px;
  height: 22px;
  flex: none;
}
.brand-icon {
  width: 28px;
  height: 28px;
  flex: none;
}
.mark {
  width: 30px;
  height: 30px;
  fill: currentColor;
  flex: none;
}
.app-body {
  --accent: #536684;
  --accent-hover: #44567a;
  height: 100dvh;
  overflow: hidden;
  background: var(--chat-bg);
}
.post-list .brand-icon {
  width: 34px;
  height: 34px;
}
.post-list li:has(.brand-icon) {
  gap: 14px;
}
.post-list li:has(.brand-icon) .post-info {
  flex: 1;
}
.app-body main,
.app-shell .app-main {
  width: auto;
  margin: 0;
  padding: 0;
  min-height: 0;
}
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  height: 100dvh;
}
.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.app-shell.is-chat .app-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
}

/* Icon buttons reset the global button look. */
.app-body .icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  flex: none;
  cursor: pointer;
}
.app-body .icon-button:hover {
  background: var(--wash);
  color: var(--ink);
}

/* Rail */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 0 20px;
  background: #f8f9fc;
  border-right: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.rail-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 26px;
  color: var(--ink);
}
.rail-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  list-style: none;
  cursor: pointer;
  transition:
    background 0.15s ease-out,
    color 0.15s ease-out;
}
.rail-link::-webkit-details-marker {
  display: none;
}
.rail-link .icon {
  width: 26px;
  height: 26px;
}
.rail-link:hover {
  background: var(--brand-wash);
}
.rail-link[aria-current='page'] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(40, 56, 88, 0.55);
}
.rail-link[data-tip]:hover::after,
.rail-link[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}
.rail-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.rail-more,
.later {
  border: 0;
  padding: 0;
}
.rail-more {
  position: relative;
}
.rail-more > summary {
  border: 0;
}
.rail-more[open] > summary {
  background: var(--brand-wash);
}
.rail-more[open] > summary::after {
  display: none;
}
.menu-pop {
  position: absolute;
  left: calc(100% + 12px);
  bottom: 0;
  width: 248px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px -18px rgba(25, 33, 48, 0.35);
  display: grid;
  gap: 4px;
}
.menu-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.language-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.language-pills a {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}
.language-pills a:hover {
  color: var(--ink);
  border-color: var(--soft);
}
.language-pills a[aria-current] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.app-body .menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.app-body .menu-item:hover {
  background: var(--wash);
  color: var(--ink);
}
.menu-pop form,
.drawer form {
  margin: 0;
}

/* Chat column */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  background: var(--chat-bg);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  min-height: 84px;
  background: rgba(248, 249, 252, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 3;
}
.head-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-wash);
  border: 1px solid var(--line);
  object-fit: cover;
  flex: none;
}
.head-who {
  min-width: 0;
  flex: 1;
}
.head-who h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.head-who p {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-who p strong {
  color: var(--ink);
  font-weight: 500;
}
.chat-head .preview,
.page-top .preview {
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 12px;
  border-radius: 8px;
  background: #e8ebf1;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}
.panel-open {
  display: none !important;
}
.only-mobile {
  display: none !important;
}
.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.thread:focus {
  outline: none;
}
.thread-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.system-pill,
.day {
  align-self: center;
  margin: 10px 0;
  text-align: center;
}
.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: #fffbea;
  border: 1px solid #f1e6b8;
  color: #6a5d2a;
  font-size: 12.5px;
  max-width: 460px;
}
.system-pill .icon {
  width: 16px;
  height: 16px;
}
.day span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.msg {
  display: flex;
  margin-top: 14px;
}
.msg.is-pending,
.msg.is-typing,
.msg.is-new {
  animation: msg-in 0.28s var(--ease) both;
}
.is-preview button:disabled {
  opacity: 1;
  cursor: default;
}
.msg.is-cont {
  margin-top: 6px;
}
.msg--out {
  justify-content: flex-end;
}
.msg--out > .bubble {
  max-width: min(520px, 84%);
}
.msg-col {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: min(720px, 96%);
  min-width: 0;
}
.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--brand-wash);
  flex: none;
  object-fit: cover;
}
.msg.is-cont .msg-avatar {
  visibility: hidden;
  height: 0;
}
.msg-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  align-items: flex-start;
}
.bubble {
  display: flow-root;
  position: relative;
  padding: 11px 16px 9px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.bubble p {
  margin: 0;
  white-space: pre-line;
}
.bubble p + p {
  margin-top: 8px;
}
.bubble a:not(.doc):not(.quote):not(.chip):not(.media) {
  color: var(--brand);
}
.bubble--in {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(25, 33, 48, 0.04);
}
.msg.is-cont .bubble--in,
.msg-stack > .bubble--in + .draft-card {
  border-top-left-radius: 18px;
}
.bubble--out {
  background: var(--out-bg);
  border: 1px solid var(--out-line);
  border-top-right-radius: 6px;
}
.msg.is-cont .bubble--out {
  border-top-right-radius: 18px;
}
.bubble--media {
  padding: 8px 8px 8px;
}
.bubble--media > p {
  padding: 6px 8px 0;
}
.meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px -4px -3px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  user-select: none;
}
.bubble--media .meta {
  margin-right: 4px;
}
.ticks .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.media {
  display: block;
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background: var(--wash);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--large {
  /* Instagram's portrait frame: text cards and portrait photos show whole. */
  width: min(340px, 100%);
  aspect-ratio: 4 / 5;
}
.media--small {
  aspect-ratio: 4 / 5;
}
.media--video .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.media--video .play .icon {
  width: 52px;
  height: 52px;
  padding: 14px;
  border-radius: 50%;
  background: rgba(20, 26, 38, 0.6);
  color: #fff;
}
.quote {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: -3px -8px 8px;
  padding: 7px 10px 7px 8px;
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.quote img {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
}
.quote span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quote strong {
  display: block;
  color: var(--brand);
  font-weight: 600;
}
.doc {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px -6px 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--wash);
  color: var(--ink);
  text-decoration: none;
}
.doc:hover {
  background: var(--brand-wash);
}
.doc .icon {
  width: 30px;
  height: 30px;
}
.doc span {
  flex: 1;
  display: grid;
  line-height: 1.3;
}
.doc small {
  color: var(--muted);
  font-size: 12.5px;
}
.bubble--report {
  max-width: 520px;
}
.bubble--setup {
  max-width: 560px;
}
.bubble--setup form {
  margin-top: 12px;
}

/* Chips: quick replies and suggestions */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips form {
  margin: 0;
}
.bubble .chips {
  margin-top: 12px;
}
.app-body .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--out-line);
  background: var(--surface);
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease-out,
    border-color 0.15s ease-out;
}
.app-body .chip:hover {
  background: var(--brand-wash);
  border-color: var(--brand);
  color: var(--brand-hover);
}
.app-body .chip .icon {
  width: 18px;
  height: 18px;
}
.connect-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.connect-inline form {
  margin: 0;
}
.app-body .connect-tile {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
}
.app-body .connect-tile:hover {
  border-color: var(--brand);
  background: var(--brand-wash);
  color: var(--ink);
}

/* Draft card */
.draft-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px 20px 18px;
  box-shadow: 0 1px 2px rgba(25, 33, 48, 0.04);
}
.draft-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 -4px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-body .draft-tabs button {
  position: relative;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.app-body .draft-tabs button:hover {
  background: var(--wash);
  color: var(--ink);
}
.app-body .draft-tabs button[aria-selected='true'] {
  color: var(--ink);
  font-weight: 600;
}
.app-body .draft-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}
.draft-tabs .brand-icon {
  width: 24px;
  height: 24px;
}
.draft-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.draft-pane[hidden] {
  display: none;
}
.draft-pane + .draft-pane {
  margin-top: 18px;
}
.draft-channel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 16px;
}
.draft-account {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.draft-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
  max-height: 22em;
  overflow-y: auto;
}
.draft-extra {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brand-wash);
  color: var(--ink);
  font-size: 14px;
}
.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.draft-actions form {
  margin: 0;
}
.draft-actions--quiet {
  padding-top: 10px;
  margin-top: 10px;
}
.app-body .draft-actions .button,
.app-body .draft-actions button.button {
  min-height: 46px;
  padding: 11px 20px;
  font-size: 16px;
  gap: 10px;
  border-radius: 10px;
}
.app-body .draft-actions .button:not(.secondary),
.app-body .bubble--setup .button,
.app-body .later-custom .button {
  background: var(--brand);
  border-color: var(--brand);
}
.app-body .draft-actions .button:not(.secondary):hover,
.app-body .later-custom .button:hover {
  background: var(--brand-hover);
}
.app-body .draft-actions .secondary {
  border-color: #c9d0db;
}
.draft-actions .icon {
  width: 20px;
  height: 20px;
}
.draft-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.draft-hint .icon {
  width: 16px;
  height: 16px;
}
.draft-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--wash);
  font-size: 14px;
  font-weight: 500;
}
.draft-state .icon {
  width: 18px;
  height: 18px;
}
.draft-state a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.draft-state.is-done {
  background: #e9f5ee;
  color: var(--good);
}
.draft-state.is-planned {
  background: #eef2fa;
  color: var(--brand-hover);
}
.draft-state.is-alert {
  background: #fff2f3;
  color: var(--danger);
}
.draft-state.is-muted {
  color: var(--muted);
}
.draft-details {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
.draft-details:hover {
  color: var(--brand);
  text-decoration: underline;
}
.draft-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.draft-foot form {
  margin: 14px 0 0;
}
.draft-foot .draft-details {
  margin-top: 14px;
}
.draft-undo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.draft-undo .icon {
  width: 16px;
  height: 16px;
}
.draft-undo:hover {
  color: var(--brand);
}
.versions ol {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.version {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.version.is-current {
  background: var(--wash);
}
.version img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}
.version div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 13px;
}
.version div span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.version form {
  margin: 0;
}
.version button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: none;
}
.app-body .text-button {
  min-height: 40px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.app-body .text-button:hover {
  background: transparent;
  color: var(--danger);
}

/* "Post later" popover */
.later {
  position: relative;
  margin: 0;
}
.later > summary {
  list-style: none;
  white-space: nowrap;
}
.later > summary::-webkit-details-marker {
  display: none;
}
.later[open] > summary {
  background: var(--wash);
}
.later-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 10;
  width: 320px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 44px -20px rgba(25, 33, 48, 0.4);
}
.later-pop > p {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 15px;
}
.later-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.later-quick form {
  margin: 0;
}
.app-body .later button {
  margin: 0;
}
.later-pop label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.later-custom {
  display: flex;
  gap: 8px;
}
.later-custom input {
  min-width: 0;
  padding: 9px 10px;
  font-size: 14px;
}
.app-body .later-custom .button {
  min-height: 0;
  padding: 9px 14px;
  white-space: nowrap;
}

/* Composer */
.composer-wrap {
  padding: 10px 28px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(244, 246, 250, 0), var(--chat-bg) 26%);
}
.composer-wrap > .composer,
.composer-wrap > .composer-note {
  max-width: 900px;
  margin-inline: auto;
}
.app-body .composer {
  display: block;
  margin: 0 auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid #d5dbe4;
  border-radius: 18px;
  box-shadow: 0 6px 24px -16px rgba(25, 33, 48, 0.35);
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}
.app-body .composer:focus-within {
  border-color: var(--brand);
  box-shadow:
    0 0 0 3px rgba(83, 102, 132, 0.16),
    0 6px 24px -16px rgba(25, 33, 48, 0.35);
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.app-body .composer .attach {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--wash);
  cursor: pointer;
}
.app-body .composer .attach:hover {
  background: var(--brand-wash);
}
.app-body .composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 180px;
  padding: 12px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  resize: none;
  font-size: 17px;
  line-height: 1.4;
  outline: none;
}
.app-body .composer textarea:focus-visible {
  outline: none;
}
.app-body .composer .send {
  width: 52px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border-radius: 12px;
  margin: 0;
  border: 0;
  background: var(--brand);
  color: #fff;
  flex: none;
}
.app-body .composer .send:hover {
  background: var(--brand-hover);
}
.composer .send .icon {
  width: 24px;
  height: 24px;
}
.composer[aria-busy='true'] .send {
  opacity: 0.6;
}
.recorder {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.recorder[hidden] {
  display: none;
}
.recorder .icon-button {
  width: 48px;
  height: 48px;
  color: var(--danger);
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-pulse 1.2s ease-in-out infinite;
}
.rec-label {
  font-size: 15px;
  color: var(--muted);
}
.recorder time {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.rec-wave {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 28px;
  min-width: 0;
  overflow: hidden;
  padding-right: 4px;
}
.rec-wave i {
  height: 12%;
  transition: height 0.1s linear;
}
.rec-wave:not(.is-live) i {
  animation: rec-wave 1.1s ease-in-out infinite;
}
.rec-wave:not(.is-live) i:nth-child(3n + 1) {
  animation-delay: 0.2s;
}
.rec-wave:not(.is-live) i:nth-child(3n + 2) {
  animation-delay: 0.45s;
}
@keyframes rec-pulse {
  50% {
    opacity: 0.25;
  }
}
@keyframes rec-wave {
  50% {
    height: 70%;
  }
}
@media (max-width: 860px) {
  .rec-label {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot,
  .rec-wave i,
  .typing b,
  .voice-text.is-working {
    animation: none !important;
  }
  .voice-text.is-working {
    color: var(--muted);
    background: none;
  }
}
.composer-status {
  margin: 8px 8px 2px;
  font-size: 13px;
  color: var(--muted);
}
.composer-status.error {
  color: var(--danger);
  background: none;
}
.composer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 6px;
  font-size: 13px;
  color: var(--muted);
}
.composer-note .icon {
  width: 18px;
  height: 18px;
}
.attach-tray:empty {
  display: none;
}
.attach-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.attach-tray .file-preview {
  width: 72px;
  height: 72px;
  margin: 0;
  border-radius: 12px;
  object-fit: cover;
  background: var(--wash);
  border: 0;
}
.attach-tray .file-details {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 14px;
}
.attach-tray .file-details > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 8px 8px 12px;
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: var(--wash);
}
.reply-bar[hidden] {
  display: none;
}
.reply-thumb img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}
.reply-text {
  flex: 1;
  min-width: 0;
  display: grid;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}
.reply-text strong {
  color: var(--brand);
}
.reply-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat.is-dragging::after {
  content: attr(data-drop-label);
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--brand);
  border-radius: 20px;
  background: rgba(228, 233, 242, 0.88);
  color: var(--brand-hover);
  font-size: 18px;
  font-weight: 600;
  z-index: 30;
  pointer-events: none;
}
.bubble--typing {
  padding: 15px 18px;
}
.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 14px;
}
.typing b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.35;
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing b:nth-child(2) {
  animation-delay: 0.16s;
}
.typing b:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-5px);
    opacity: 0.85;
  }
}
.head-typing {
  display: none;
}
.chat-head.is-typing .head-who p {
  display: none;
}
.chat-head.is-typing .head-who p.head-typing {
  display: block;
  color: var(--brand);
  font-weight: 500;
}
.msg.is-pending .meta .spinner {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}
.bubble--voice {
  min-width: min(280px, 100%);
}
.voice {
  display: flex;
  align-items: center;
  gap: 10px;
}
.voice-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  flex: none;
}
.voice-icon .icon {
  width: 18px;
  height: 18px;
}
.voice-wave {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  height: 28px;
  min-width: 0;
  overflow: hidden;
}
.voice-wave i,
.rec-wave i {
  flex: none;
  width: 3px;
  border-radius: 2px;
  background: var(--brand);
}
.voice-wave i {
  opacity: 0.6;
}
:is(.voice-wave, .rec-wave) i[data-h='1'] {
  height: 10%;
}
:is(.voice-wave, .rec-wave) i[data-h='2'] {
  height: 18%;
}
:is(.voice-wave, .rec-wave) i[data-h='3'] {
  height: 27%;
}
:is(.voice-wave, .rec-wave) i[data-h='4'] {
  height: 36%;
}
:is(.voice-wave, .rec-wave) i[data-h='5'] {
  height: 45%;
}
:is(.voice-wave, .rec-wave) i[data-h='6'] {
  height: 54%;
}
:is(.voice-wave, .rec-wave) i[data-h='7'] {
  height: 64%;
}
:is(.voice-wave, .rec-wave) i[data-h='8'] {
  height: 74%;
}
:is(.voice-wave, .rec-wave) i[data-h='9'] {
  height: 86%;
}
:is(.voice-wave, .rec-wave) i[data-h='10'] {
  height: 100%;
}
.voice-len {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.bubble .voice-text {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--out-line);
  font-size: 15px;
}
.bubble .voice-text.is-working {
  color: transparent;
  background: linear-gradient(
      90deg,
      var(--muted) 0%,
      var(--muted) 40%,
      var(--brand-wash) 50%,
      var(--muted) 60%,
      var(--muted) 100%
    )
    0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -150% 0;
  }
}
.toast {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 12px 30px -14px rgba(25, 33, 48, 0.6);
  animation: toast 4.5s var(--ease) both;
  pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast.error {
  background: var(--danger);
  color: #fff;
}

/* Business panel */
.panel {
  min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  padding: 26px 26px 32px;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.panel-close {
  display: none !important;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--wash);
  margin-bottom: 14px;
}
.app-body .segmented button {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}
.app-body .segmented button:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}
.app-body .segmented button[aria-selected='true'] {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(40, 56, 88, 0.6);
}
.js .seg-pane[data-inactive] {
  display: none;
}
.seg-pane h3 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
}
.channel-list,
.report-actions,
.report-history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.channel-row,
.report-actions li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.channel-row .brand-icon {
  width: 38px;
  height: 38px;
}
.channel-name {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.channel-name strong {
  font-size: 17px;
  font-weight: 500;
}
.channel-name span {
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-name .alert-text {
  color: var(--danger);
}
.channel-row form,
.report-actions form {
  margin: 0;
}
.connected {
  color: var(--good);
  font-size: 15px;
  font-weight: 500;
}
.reconnect .icon-button {
  width: 34px !important;
  height: 34px !important;
  color: var(--muted) !important;
}
.reconnect .icon {
  width: 17px;
  height: 17px;
}
.app-body .small-button {
  min-height: 40px;
  padding: 7px 16px;
  font-size: 15px;
  border-color: #b9c1cd;
  border-radius: 10px;
  white-space: nowrap;
}
.app-body .small-button.is-alert {
  color: var(--danger);
  border-color: #e9b8bc;
}
.panel-hint {
  margin: 18px 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.profile-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.profile-card p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.profile-card .text-link {
  font-size: 14px;
  color: var(--brand);
}
.report-actions li > .icon {
  width: 30px;
  height: 30px;
  color: var(--ink);
}
.report-actions li > div {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.35;
}
.report-actions strong {
  font-size: 16px;
  font-weight: 500;
}
.report-actions span {
  font-size: 13px;
  color: var(--muted);
}
.report-history li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.report-history time {
  font-size: 12.5px;
  color: var(--muted);
}
.report-history p {
  margin: 4px 0 6px;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.report-history .text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--brand);
}
.report-history .icon {
  width: 16px;
  height: 16px;
}
.panel-empty {
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* Drawers (mobile menu, panel overlay) work with :target, JS only adds polish. */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 86vw);
  padding: 18px 18px max(20px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 50px -30px rgba(25, 33, 48, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(-105%);
  visibility: hidden;
  transition:
    transform 0.28s var(--ease),
    visibility 0s linear 0.28s;
}
.drawer:target,
.drawer.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.28s var(--ease);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.drawer-nav {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
}
.drawer-nav a:hover {
  background: var(--wash);
}
.drawer-nav a[aria-current='page'] {
  background: var(--brand);
  color: #fff;
}
.drawer-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(22, 28, 40, 0.38);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease-out,
    visibility 0s linear 0.25s;
}
.drawer:target ~ .scrim--menu,
.drawer.is-open ~ .scrim--menu {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease-out;
}

/* Other workspace pages inside the shell */
.page-top {
  display: none;
}
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
}
.page {
  width: min(1120px, calc(100% - 72px));
  margin-inline: auto;
  padding: 48px 0 80px;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  8%,
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}

/* Mid-size: the business panel slides over the chat. */
@media (max-width: 1239px) {
  .app-shell.is-chat .app-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel-open,
  .panel-close {
    display: inline-grid !important;
  }
  .panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(var(--panel-w), 100vw);
    z-index: 60;
    box-shadow: -20px 0 50px -30px rgba(25, 33, 48, 0.5);
    transform: translateX(105%);
    visibility: hidden;
    transition:
      transform 0.3s var(--ease),
      visibility 0s linear 0.3s;
  }
  .panel:target,
  .panel.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.3s var(--ease);
  }
  .panel:target ~ .scrim,
  .panel.is-open ~ .scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease-out;
  }
}

/* Phone: full-screen chat like a messenger. */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  .only-mobile {
    display: inline-grid !important;
  }
  .chat-head {
    gap: 10px;
    min-height: 64px;
    padding: 8px 8px 8px 6px;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .head-avatar {
    width: 42px;
    height: 42px;
  }
  .head-who h1 {
    font-size: 1.15rem;
  }
  .head-who p {
    font-size: 13px;
  }
  .head-who p span {
    display: none;
  }
  .draft-actions .later > summary,
  .app-body .draft-actions > .button {
    gap: 8px;
    padding-inline: 10px;
  }
  .head-who p strong {
    font-weight: 400;
    color: var(--muted);
  }
  .chat-head .preview {
    display: none;
  }
  .thread-inner {
    padding: 12px 10px 18px;
  }
  .msg-avatar {
    width: 30px;
    height: 30px;
  }
  .msg-col {
    gap: 8px;
    max-width: 100%;
  }
  .msg--out > .bubble {
    max-width: 88%;
  }
  .bubble {
    font-size: 15.5px;
    padding: 9px 13px 8px;
  }
  .bubble--media {
    padding: 5px;
  }
  .draft-card {
    padding: 4px 14px 14px;
    border-radius: 16px;
  }
  .draft-pane {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .media--small {
    aspect-ratio: 16 / 10;
  }
  .draft-text {
    font-size: 15.5px;
  }
  .app-body .draft-tabs button {
    font-size: 15px;
    min-height: 48px;
    padding: 8px 10px;
  }
  .draft-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .draft-actions > form:first-child {
    grid-column: 1 / -1;
  }
  .draft-actions > form > .button,
  .draft-actions > .button,
  .draft-actions .later > summary {
    width: 100%;
  }
  .app-body .draft-actions .button {
    font-size: 15px;
    padding: 10px 12px;
  }
  .draft-actions--quiet {
    display: flex;
  }
  .later {
    position: static;
  }
  .later[open] > summary::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(22, 28, 40, 0.38);
    cursor: default;
  }
  .later-pop {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    z-index: 70;
    padding: 18px 16px;
    border-radius: 20px;
    box-shadow: 0 -10px 60px -10px rgba(25, 33, 48, 0.45);
  }
  .composer-wrap {
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  }
  .app-body .composer {
    border-radius: 16px;
    padding: 6px;
  }
  .app-body .composer .attach {
    width: 44px;
    height: 44px;
  }
  .app-body .composer .send {
    width: 44px;
    height: 44px;
  }
  .app-body .composer textarea {
    min-height: 44px;
    padding: 10px 6px;
    font-size: 16px;
  }
  .composer-note {
    justify-content: center;
    margin-top: 6px;
    font-size: 12px;
  }
  .composer-note .icon {
    width: 15px;
    height: 15px;
  }
  .panel {
    width: 100vw;
    padding: 18px 18px max(24px, env(safe-area-inset-bottom));
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .panel-head h2 {
    font-size: 1.5rem;
  }
  .toast {
    top: 74px;
  }
  .page-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    padding: 8px 6px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .page-top-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.03em;
    text-decoration: none;
  }
  .page-top-brand .mark {
    width: 24px;
    height: 24px;
  }
  .page {
    width: calc(100% - 32px);
    padding: 26px 0 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg,
  .toast,
  .spinner,
  .typing b {
    animation: none !important;
  }
  .drawer,
  .panel,
  .scrim,
  .thread {
    transition: none !important;
    scroll-behavior: auto;
  }
}

/* Page changes cross-fade instead of flashing white (Safari 18.2+, Chrome 126+);
   the navigation stays still. Other browsers navigate as before. */
@view-transition {
  navigation: auto;
}
.rail {
  view-transition-name: rail;
}
.page-top {
  view-transition-name: page-top;
}
::view-transition-group(rail),
::view-transition-group(page-top),
::view-transition-old(rail),
::view-transition-new(rail),
::view-transition-old(page-top),
::view-transition-new(page-top) {
  animation: none;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.16s;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
.design-preview {
  margin: 4px 0 20px;
}
.design-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--brand-wash);
}
.design-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.design-form input[type='color'] {
  width: 100%;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.logo-field .small {
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-field .small .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.logo-field form {
  margin: 0 0 8px;
}
.form-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 14px;
}

/* The owner's own words: per-platform text editing on a draft. */
.pane-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: 8px;
}
.pane-tools .text-button,
.add-channels span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.pane-tools .text-button .icon {
  width: 15px;
  height: 15px;
}
.pane-tools .text-button:hover {
  color: var(--brand);
}
.pane-tools form {
  margin: 0;
}
.own-edit {
  flex-basis: 100%;
}
.own-edit summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
}
.own-edit summary::-webkit-details-marker {
  display: none;
}
.own-edit[open] summary {
  color: var(--ink);
}
.own-edit textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
}
.own-edit textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.own-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.own-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.add-channels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.add-channels form {
  margin: 0;
}
.add-channels .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.add-channels .chip svg {
  width: 16px;
  height: 16px;
}
.own-toggle {
  flex-basis: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.own-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.profile-open {
  margin: 2px 0 0;
}
.profile-open .text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 2px 0;
  font-size: 12.5px;
  color: var(--brand);
}
.profile-open .text-button .icon {
  width: 14px;
  height: 14px;
}
/* While editing, the text box replaces the shown text. */
.draft-copy:has(.own-edit[open]) .draft-text {
  display: none;
}
.own-edit summary.text-button {
  text-decoration: none;
}
