:root {
  --bg: #f2f1ed;
  --surface: #f7f7f4;
  --soft: #ebeae5;
  --line: #e1e0db;
  --text: #26251f;
  --muted: #7f7f79;
  --accent: #ff6065;
  --interaction-border: #E46E6A;
  --white: #fff;
  --radius: 6px;
  --radius-small: 4px;
  --button-gap: 20px;
  font-family:
    "PitchOS UI",
    "Alibaba PuHuiTi 3.0",
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--text);
  font-size: 12px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  min-width: 1100px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 16px;
}
button:hover:not(:disabled) {
  background: var(--soft);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: white;
  min-width: 0;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--interaction-border);
  box-shadow: none;
}
textarea {
  resize: vertical;
  line-height: 1.7;
}
input[type="checkbox"] {
  accent-color: var(--text);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 16px;
  line-height: 24px;
}
h2 {
  font-size: 14px;
  line-height: 20px;
}
h3 {
  font-size: 13px;
}
a {
  color: inherit;
  text-decoration: none;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 12px;
  height: 12px;
}
.icon img {
  display: block;
  max-width: none;
}
.nav-icon {
  width: 18px;
  height: 18px;
}
.dark {
  background: var(--text);
  color: #fff;
}
.dark:hover:not(:disabled) {
  background: #454439;
}
.danger {
  background: var(--accent);
  color: #fff;
}
.danger:hover:not(:disabled) {
  background: #ef4c53;
}
.light {
  border-color: var(--line);
}
.quiet {
  background: transparent;
}
.small-button {
  height: 24px;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: white;
  font-size: 12px;
  line-height: 12px;
  white-space: nowrap;
}
.small-button.active,
.small-button.active:hover:not(:disabled) {
  background: var(--text);
  border-color: var(--text);
  color: white;
}
button.small,
.icon-button {
  border-radius: var(--radius-small);
}
.icon-button {
  height: 26px;
  padding: 6px;
  min-width: 26px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: var(--button-gap);
}
.between {
  justify-content: space-between;
}
.full {
  width: 100%;
}
.hidden {
  display: none !important;
}
.boot {
  display: grid;
  place-items: center;
  height: 100vh;
}
.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}
.shell.sidebar-collapsed {
  grid-template-columns: 60px minmax(0, 1fr);
}
.sidebar {
  position: relative;
  background: var(--surface);
  border-right: 1px solid var(--soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 13px 13px 13px 14px;
}
.brand {
  display: flex;
  align-items: flex-start;
  height: 60px;
}
.brand img {
  display: block;
  width: auto;
  height: 36px;
  flex: none;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav button {
  justify-content: flex-start;
  gap: 24px;
  height: 34px;
  font-size: 13px;
  padding: 6px;
}
.nav .active {
  background: var(--soft);
}
.nav button:disabled {
  opacity: 0.5;
}
.sidebar-bottom {
  position: absolute;
  left: 14px;
  right: 13px;
  bottom: 19px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user {
  border-top: 1px solid var(--soft);
  padding-top: 12px;
  gap: 14px;
}
.avatar {
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  padding: 0;
  overflow: hidden;
  flex: none;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
}
.sidebar-collapsed .sidebar .brand {
  justify-content: center;
}
.sidebar-collapsed .sidebar .brand img {
  width: 21.113px;
  height: 22.747px;
  margin-top: 8px;
}
.sidebar-collapsed .sidebar {
  padding: 13px 13px 155px 14px;
}
.sidebar-collapsed .nav {
  gap: 12px;
}
.sidebar-collapsed .nav button {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  gap: 0;
}
.sidebar-collapsed .nav .label,
.sidebar-collapsed .user .label {
  display: none;
}
.sidebar-collapsed .sidebar-bottom .nav {
  gap: 12px;
}
.sidebar-collapsed .user {
  grid-template-columns: 26px;
  gap: 0;
}
.sidebar-collapsed .user .logout {
  display: none;
}
.list-panel {
  background: white;
  margin: 10px;
  border-radius: var(--radius);
  overflow: auto;
  min-width: 0;
}
.list-content {
  max-width: 1500px;
  padding: 20px 80px 50px;
  margin: auto;
}
.ad-slot {
  height: 160px;
  background: var(--surface);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: #99988f;
  font-size: 12px;
}
.ad-slot--offer {
  justify-content: start;
  padding: 22px 32px;
  overflow: hidden;
  color: var(--text);
  background-color: #efe8df;
  background-image: linear-gradient(90deg, #f6f1eb 0%, #f6f1ebee 31%, #f6f1eb00 64%), url("./assets/pitchos-proposal-offer.jpg");
  background-size: cover;
  background-position: center;
}
.ad-offer-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.15;
}
.ad-offer-eyebrow {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.ad-offer-copy strong {
  font-size: 29px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ad-offer-copy strong span {
  margin-left: 8px;
}
.ad-offer-badge {
  padding: 4px 9px;
  border: 1px solid #c65b48;
  border-radius: var(--radius-small);
  color: #a33e31;
  font-size: 11px;
  font-weight: 500;
}
.list-toolbar .push button,
.list-panel .empty > button {
  height: 30px;
  min-height: 30px;
}
.list-toolbar {
  display: flex;
  align-items: center;
  gap: var(--button-gap);
  margin-bottom: 20px;
  height: 32px;
}
.list-toolbar select,
.search {
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: var(--radius);
  width: 278px;
}
.search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.list-toolbar .push {
  margin-left: auto;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.project-card {
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: #bab7ab;
  background: #f4f3ef;
}
.project-card h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  padding-right: 40px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.7fr;
  gap: 12px;
  margin-top: 28px;
}
.card-meta dt {
  font-size: 12px;
  color: #666;
  margin-bottom: 3px;
}
.card-meta dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card footer {
  color: #666;
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.card-delete {
  position: absolute;
  right: 9px;
  top: 10px;
  opacity: 0;
}
.project-card:hover .card-delete,
.card-delete:focus {
  opacity: 1;
}
.client-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.client-card {
  height: 158px;
  padding: 20px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
}
.client-mark {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e8e7e1;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 20px;
  font-weight: 500;
}
.client-card .row {
  justify-content: center;
  gap: 10px;
}
.client-card h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-card footer {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 11px;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 70px 25px;
  color: var(--muted);
}
.empty h2 {
  color: var(--text);
  margin-bottom: 10px;
  font-size: 16px;
}
.empty p {
  line-height: 1.8;
  margin-bottom: 20px;
}
.workspace-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 60px;
  padding: 8px 20px 8px 30px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.topbar h1 {
  max-width: 65vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.workspace-body .topbar h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}
.save-state:not(.save-error) {
  display: none;
}
.save-state {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0;
}
.workspace-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: 360px minmax(380px, 1fr) 240px;
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.outline-panel,
.editor-panel {
  background: white;
  border-radius: var(--radius);
  min-height: 0;
  min-width: 0;
}
.outline-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--soft);
  border-radius: var(--radius);
  padding: 4px;
  flex: none;
}
.tabs button {
  height: 30px;
  padding: 0 8px;
  background: transparent;
  white-space: nowrap;
}
.tabs .active {
  background: white;
  box-shadow: 1px 1px 5px #0000000d;
}
.outline-filter {
  display: flex;
  gap: 10px;
  padding: 10px 0 20px;
  border-bottom: 1px solid var(--soft);
  margin-bottom: 20px;
}
.outline-filter .search {
  width: auto;
  flex: 1;
  border: 1px solid transparent;
}
.outline-filter select {
  width: 62px;
  padding: 5px;
  background: var(--surface);
  border: 0;
  font-size: 12px;
}
.outline-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  margin-right: -12px;
  padding-right: 12px;
}
.chapter {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 10px;
}
.chapter-head {
  padding: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  height: 32px;
  justify-content: flex-start;
  font-weight: 500;
  line-height: 20px;
}
.chapter-head:hover:not(:disabled) {
  background: transparent;
}
.chapter-head .chapter-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}
.chapter-head .count {
  font-size: 12px;
  background: white;
  padding: 0 4px;
  font-weight: 400;
  white-space: nowrap;
}
.chapter-description {
  font-size: 12px;
  color: #7f7f79;
  line-height: 16px;
  margin: 10px 0;
}
.page-link {
  display: flex;
  width: 100%;
  text-align: left;
  justify-content: space-between;
  padding: 4px 9px;
  min-height: 32px;
  background: white;
  border: 1px solid var(--soft);
  border-radius: var(--radius-small);
  margin-top: 10px;
  font-size: 12px;
}
.page-link span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-link.active {
  border-color: var(--accent);
  color: #f65358;
  background: white;
}
.outline-footer {
  border-top: 1px solid var(--soft);
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.editor-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.page-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.page-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.page-title h2 {
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
.page-header .muted {
  font-size: 12px;
}
.page-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  border-radius: var(--radius);
  background: var(--soft);
  padding: 8px 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.page-meta > span + span {
  border-left: 1px solid #aaa99f;
  padding-left: 12px;
}
.page-meta button {
  padding: 0;
  background: transparent;
  margin-left: auto;
}
.page-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 10px 20px;
  margin: 0 -6px 0 0;
  scrollbar-gutter: stable;
}
.content-blocks {
  display: grid;
  gap: 22px 26px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  line-height: 1.8;
  font-size: 13px;
}
.content-blocks.layout-text {
  grid-template-columns: 1fr;
}
.content-blocks.layout-list {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.content-blocks.layout-path {
  grid-template-columns: 1fr;
}
.content-block {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 4px;
  position: relative;
  cursor: text;
}
.content-block:hover {
  border-color: transparent;
  background: var(--surface);
}
.content-block h3 {
  font-size: 16px;
  margin: 0 0 8px;
  font-weight: 500;
}
.content-block p {
  white-space: pre-wrap;
}
.content-block ul,
.content-block ol {
  padding-left: 20px;
  margin: 0;
}
.content-block.callout {
  grid-column: 1/-1;
  background: var(--surface);
  padding: 12px;
}
.content-block.image-brief {
  border: 1px dashed var(--line);
  background: var(--surface);
  padding: 18px;
  min-height: 140px;
}
.content-block.steps ol {
  list-style: decimal;
}
.content-block.steps li {
  padding: 8px 0;
  border-bottom: 1px solid var(--soft);
}
.prompt-area {
  flex: none;
  margin-top: 10px;
}
.page-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.page-tools > button[data-action="generate-page"] {
  margin-left: auto;
  background: var(--soft);
}
.page-tools > button[data-action="generate-page"]:hover:not(:disabled) {
  background: #deddd7;
}
.page-tools details {
  position: relative;
}
.page-tools summary {
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.page-tools summary::-webkit-details-marker {
  display: none;
}
.page-tools .add-page-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 30px;
  padding: 0 10px;
  line-height: 16px;
  gap: 5px;
}
.page-tools .add-page-tool:hover:not(:disabled) {
  background: var(--soft);
}
.dropdown {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 0;
  min-width: 130px;
  z-index: 5;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 3px 14px #0000000d;
  border-radius: var(--radius);
  padding: 5px;
  display: grid;
  gap: 5px;
}
.dropdown button {
  border-radius: var(--radius-small);
  height: 26px;
  min-height: 26px;
  padding: 5px;
  justify-content: flex-start;
  white-space: nowrap;
  background: transparent;
}
.dropdown button.active {
  background: var(--soft);
}
.prompt-box {
  height: 120px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  box-shadow: 1px 1px 10px #00000016;
  display: flex;
  flex-direction: column;
  padding: 10px;
}
.prompt-box textarea {
  flex: 1;
  resize: none;
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}
.prompt-bottom {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.send {
  background: transparent;
  padding: 0;
  width: 26px;
  height: 26px;
}
.send:hover:not(:disabled) {
  background: transparent;
  opacity: 0.8;
}
.send .icon {
  width: 26px;
  height: 26px;
}
.right-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}
.status-panel {
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  min-height: 136px;
}
.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--soft);
  min-width: 0;
}
.status-card strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.4;
}
.status-card strong .icon {
  transform: translateY(0);
}
.status-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-card.running {
  background: #fff4d9;
  border-color: #f2dba4;
}
.status-card.done {
  background: #e9f4e8;
  border-color: #c9e4c7;
}
.status-card.error {
  background: #fff0f0;
  border-color: #f4c2c2;
}
.history-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.history-list {
  overflow: auto;
  min-height: 0;
  flex: 1;
  margin-right: -6px;
  padding-right: 6px;
}
.history-item {
  background: white;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}
.history-item header {
  display: flex;
  align-items: center;
  gap: 5px;
}
.history-item strong {
  font-size: 12px;
  min-width: 0;
}
.history-item time {
  font-size: 12px;
  color: #b1b0a9;
  margin-left: auto;
  flex: none;
  white-space: nowrap;
}
.history-item .history-page {
  color: #fa6567;
  margin-top: 6px;
  display: block;
  text-align: left;
  padding: 0;
  background: transparent;
  font-size: 12px;
}
.history-item p {
  font-size: 12px;
  line-height: 16px;
  color: #88877f;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.history-item.superseded {
  opacity: 0.65;
}
.side-ad {
  height: 67px;
  min-height: 67px;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}
.side-ad img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-footer {
  padding: 8px 10px 0;
  min-height: 65px;
}
.brand-footer .brand {
  height: 26px;
}
.brand-footer .brand img {
  width: 74px;
  height: auto;
}
.settings-content {
  overflow: auto;
  padding-top: 20px;
  flex: 1;
}
.settings-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
}
.settings-card p {
  line-height: 1.6;
  color: var(--muted);
  margin: 10px 0;
  white-space: pre-wrap;
}
.settings-card .card-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 15px 0 0;
}
.settings-card .card-meta > div {
  min-width: 0;
}
.settings-add-button {
  height: 30px;
  padding: 0 12px;
  white-space: nowrap;
}
.materials {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.file-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.file-icon {
  background: transparent;
  color: #666;
  font-size: 8px;
  border-radius: var(--radius-small);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: none;
}
.file-main {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-weight: 500;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.file-main input,
.file-main select {
  font-size: 12px;
  width: 100%;
  padding: 3px 5px;
  margin-top: 4px;
}
.file-actions {
  display: flex;
  flex-direction: row;
  flex: none;
  gap: 5px;
}
.file-actions button,
.file-actions a {
  padding: 0;
  background: transparent;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
}
.file-warning {
  font-size: 12px;
  color: #9b7737;
  margin-top: 4px;
  line-height: 1.5;
}
.upload-zone {
  border: 1px dashed #999;
  border-radius: var(--radius);
  text-align: center;
  padding: 20px 8px 14px;
  background: white;
  min-height: 127px;
}
.upload-zone.dragover {
  background: #fff3f3;
  border-color: var(--accent);
}
.upload-zone p {
  margin-top: 10px;
  line-height: 1.5;
}
.upload-zone .small {
  font-size: 9px;
  margin-top: 6px;
}
.upload-zone input {
  display: none;
}
.upload-progress-list:empty {
  display: none;
}
.upload-progress-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.upload-progress-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}
.upload-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11px;
}
.upload-progress-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-status {
  flex: none;
  color: var(--muted);
}
.upload-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: var(--radius-small);
  background: var(--soft);
}
.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 120ms ease;
}
.upload-progress-item.error .upload-progress-status {
  color: #d54b46;
}
.reference-choice {
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-top: 10px;
}
.reference-choice label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 7px 0;
  font-size: 11px;
}
.generation {
  padding: 40px 25px;
  line-height: 1.8;
  text-align: center;
  margin: auto;
  max-width: 560px;
}
.generation h2 {
  font-size: 20px;
  margin-bottom: 14px;
}
.generation p {
  color: var(--muted);
  margin-bottom: 18px;
}
.generation-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--button-gap);
}
.spinner {
  height: 24px;
  width: 24px;
  border: 1px solid var(--soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 15px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.outline-summary {
  padding: 25px 10px;
  overflow: auto;
  flex: 1;
}
.outline-summary .chapter-preview {
  padding: 15px 0;
  border-bottom: 1px solid var(--soft);
}
.outline-summary li {
  margin: 8px 0;
  color: #666;
}
.phase-banner {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.auth {
  height: 100vh;
  display: grid;
  place-items: center;
}
.auth-card {
  width: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 30px;
}
.auth-card .brand {
  justify-content: center;
}
.auth-card h1 {
  text-align: center;
  margin: 10px 0 25px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.field > span {
  font-weight: 500;
  font-size: 13px;
}
.field textarea {
  min-height: 110px;
}
.auth-card button {
  margin-top: 10px;
}
.error-text {
  color: #bb303b;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 10px 0;
}
.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
dialog {
  padding: 20px;
  border: 1px solid #d9d9d9;
  border-radius: var(--radius);
  background: var(--surface);
  width: 700px;
  max-height: 90vh;
  max-width: 90vw;
  color: var(--text);
  overflow: auto;
}
dialog::backdrop {
  background: #0003;
}
dialog.narrow {
  width: 360px;
}
dialog.confirm {
  width: 344px;
  min-height: 244px;
  text-align: center;
  padding: 30px 24px 28px;
}
dialog.confirm h2 {
  font-size: 16px;
  line-height: 16px;
  margin: 0;
}
dialog.wide {
  width: 780px;
}
dialog h2 {
  font-size: 16px;
  margin-bottom: 20px;
}
dialog .close {
  position: absolute;
  right: 10px;
  top: 10px;
  background: transparent;
  font-size: 18px;
  padding: 0 5px;
}
.dialog-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dialog-section {
  background: white;
  border-radius: var(--radius);
  padding: 10px;
  min-width: 0;
  min-height: 400px;
}
.dialog-section h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.dialog-section .field {
  margin-bottom: 16px;
}
.dialog-section .field span {
  font-size: 14px;
}
.dialog-section textarea {
  width: 100%;
  min-height: 120px;
}
.dialog-columns .dialog-section > h3:not(:first-child) {
  margin-top: 20px;
}
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.form-row > * {
  min-width: 0;
  flex: 1;
}
.types {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
.type-description {
  color: #737373;
  font-size: 11px;
  margin-bottom: 20px;
  min-height: 28px;
}
.dialog-footer {
  display: flex;
  gap: var(--button-gap);
  justify-content: center;
  margin-top: 20px;
}
.dialog-footer button {
  padding: 0 20px;
}
.confirm-symbol {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.confirm > p:not(.error-text) {
  font-size: 12px;
  line-height: 20px;
  min-height: 40px;
  margin: 24px 0 0;
  white-space: pre-line;
}
.confirm .dialog-footer {
  gap: 20px;
  margin-top: 26px;
}
.confirm .dialog-footer button {
  width: 68px;
  min-height: 30px;
  padding: 0;
}
.confirm .dialog-footer .light {
  background: var(--soft);
  border-color: var(--soft);
}
.confirm .error-text:empty {
  display: none;
}
.edit-block {
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  margin: 10px 0;
}
.edit-block textarea {
  width: 100%;
  min-height: 110px;
  margin-top: 8px;
}
.edit-block select {
  max-width: 150px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  background: var(--text);
  color: white;
  box-shadow: 0 5px 20px #0002;
  border-radius: var(--radius);
  padding: 12px 20px;
  max-width: 600px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 20;
  white-space: pre-wrap;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%);
}
#toast.error {
  background: #9c3039;
}
.inline-notice {
  padding: 10px 0;
  color: #8c7442;
  line-height: 1.6;
}
.trash-row {
  padding: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.cancel-generation {
  margin-top: 12px;
}
.save-error {
  color: #b93842;
  cursor: pointer;
}
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-thumb {
  background: #d9d9d980;
  border-radius: var(--radius-small);
}
@media (max-width: 1270px) {
  .workspace-grid {
    grid-template-columns: 300px minmax(380px, 1fr) 220px;
  }
  .outline-panel {
    padding: 15px;
  }
  .editor-panel {
    padding: 15px;
  }
  .list-content {
    padding-left: 35px;
    padding-right: 35px;
  }
  .list-toolbar .search {
    width: 220px;
  }
  .client-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1750px) {
  .workspace-grid {
    grid-template-columns: 380px minmax(0, 1fr) 260px;
  }
  .content-blocks.layout-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Explicit PostScript names avoid installed MiSans weight metadata mapping
   CSS 400 to Medium (380) rather than Regular (330). */
@font-face {
  font-family: "PitchOS UI";
  src: local("MiSans-Regular");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "PitchOS UI";
  src: local("MiSans-Medium");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "PitchOS UI";
  src: local("MiSans-Semibold");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Ubuntu;
  src: local("Ubuntu Light");
  font-weight: 300;
}
@font-face {
  font-family: Ubuntu;
  src: local("Ubuntu Medium");
  font-weight: 500;
}
.integrity-report li {
  line-height: 1.8;
  margin: 6px 0;
}
.integrity-report ul {
  padding-left: 20px;
}

h1,
h2,
h3,
strong {
  font-weight: 500;
}
.sidebar .brand {
  height: 73px;
}
.sidebar-collapsed .sidebar .brand {
  height: 77px;
}
.sidebar {
  padding-bottom: 19px;
}
.sidebar-collapsed .sidebar-bottom {
  gap: 12px;
}
.tabs button.active:hover {
  background: white;
}
.page-header > .row {
  flex: none;
  gap: 10px;
}
.page-header > div:first-child {
  min-width: 0;
}
.page-title h2 {
  overflow-wrap: anywhere;
}

/* Component states from the Figma control variants. */
[hidden] {
  display: none !important;
}
.shell.sidebar-expanded {
  grid-template-columns: 200px minmax(0, 1fr);
}
.sidebar-heading {
  position: relative;
}
.sidebar-toggle {
  position: absolute;
  right: -8px;
  top: 31px;
  padding: 3px;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.sidebar-expanded .sidebar-heading {
  display: flex;
  align-items: center;
  height: 36px;
  margin-bottom: 41px;
}
.sidebar-expanded .sidebar-toggle {
  position: static;
  margin-left: auto;
}
.sidebar-collapsed .sidebar-toggle {
  right: 3px;
  top: 42px;
}
.sidebar-expanded .sidebar {
  padding: 13px 13px 165px 14px;
}
.sidebar-expanded .nav {
  gap: 12px;
}
.sidebar-expanded .nav button {
  width: 100%;
  height: 32px;
}
.sidebar-expanded .sidebar .brand {
  height: 36px;
}
.outline-filter {
  position: relative;
  gap: 10px;
}
.outline-filter .search {
  flex: 1;
  min-width: 0;
}
.outline-filter input {
  min-width: 0;
  width: 100%;
}
.search-clear {
  padding: 0;
  width: 16px;
  height: 16px;
  flex: none;
  font-size: 16px;
}
.outline-filter details {
  position: relative;
  flex: none;
}
.outline-filter summary {
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.outline-filter summary::-webkit-details-marker {
  display: none;
}
.outline-filter details[open] summary {
  background: var(--text);
}
.outline-filter details[open] summary img {
  filter: brightness(0) invert(1);
}
.outline-filter .dropdown {
  top: calc(100% + 5px);
  bottom: auto;
  left: auto;
  right: 0;
  min-width: 100px;
  padding: 5px;
  gap: 5px;
}
.outline-filter .dropdown button {
  font-size: 12px;
  gap: 5px;
}
.filter-chip {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0 10px;
  white-space: nowrap;
}
.filter-chip button {
  padding: 0;
  width: 12px;
  font-size: 16px;
}
.outline-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding-top: 10px;
}
.outline-footer > button {
  align-self: flex-start;
  background: var(--soft);
  font-size: 12px;
  line-height: 16px;
}
.outline-footer > button:hover:not(:disabled) {
  background: #deddd7;
}
.outline-prompt {
  background: white;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 1px 1px 10px #00000016;
  height: 46px;
  display: flex;
  flex-direction: column;
  transition: height 0.15s ease, border-color 200ms ease;
}
.outline-prompt textarea {
  resize: none;
  border: 0;
  background: transparent;
  padding: 3px 0;
  width: 100%;
  height: 24px;
  min-height: 24px;
  box-shadow: none;
  font-size: 12px;
}
.outline-prompt .prompt-bottom {
  display: none;
}
.outline-prompt:focus-within,
.outline-prompt.has-draft {
  height: 120px;
}
.outline-prompt:focus-within textarea,
.outline-prompt.has-draft textarea {
  flex: 1;
}
.outline-prompt:focus-within .prompt-bottom,
.outline-prompt.has-draft .prompt-bottom {
  display: flex;
}
.page-meta {
  flex: none;
}
.page-meta .meta-toggle {
  width: 16px;
  height: 20px;
}
.page-meta .meta-toggle .icon {
  transform: rotate(-90deg);
  transition: transform 0.15s;
}
.page-meta.expanded .meta-toggle .icon {
  transform: rotate(0);
}
.page-description {
  flex-basis: 100%;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  line-height: 1.8;
  font-size: 12px;
  white-space: pre-wrap;
}
#inlinePageTitle {
  width: 100%;
  min-width: 120px;
  padding: 0 3px;
  height: 24px;
  font: inherit;
}
.page-title h2:has(input) {
  flex: 1;
}
.page-tools .dropdown {
  top: calc(100% + 5px);
  bottom: auto;
  min-width: 102px;
  padding: 5px;
  gap: 5px;
}
.page-tools .dropdown button {
  font-size: 12px;
  gap: 5px;
}
.page-tools details[data-menu="structure"] .dropdown {
  min-width: 108px;
}
.page-tools details[open] summary {
  background: var(--soft);
}
.page-tools .dropdown.flip-up {
  top: auto;
  bottom: calc(100% + 5px);
}
.confirm-symbol .icon {
  width: 24px;
  height: 24px;
}
@media (prefers-reduced-motion: reduce) {
  .outline-prompt,
  .meta-toggle .icon {
    transition: none;
  }
}

/* Project/client list filter popovers, Figma Frame 35 (660:9743). */
.list-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.list-filter details {
  position: relative;
}
.list-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 90px;
  height: 30px;
  padding: 0 10px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.list-filter summary::-webkit-details-marker {
  display: none;
}
.list-filter summary > span:first-child {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-filter .dropdown {
  top: calc(100% + 6px);
  bottom: auto;
  min-width: 100%;
  width: max-content;
  max-width: 260px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px 5px;
  gap: 5px;
  border: 1px solid var(--soft);
  border-radius: var(--radius);
  box-shadow: none;
}
.list-filter .dropdown button {
  min-width: 80px;
  height: 26px;
  min-height: 26px;
  padding: 5px;
  line-height: 12px;
  font-size: 12px;
  border-radius: var(--radius-small);
  white-space: nowrap;
  text-align: left;
}
.list-filter .dropdown button:hover,
.list-filter .dropdown button.active,
.list-filter .dropdown button:focus-visible {
  background: var(--surface);
}
.list-filter .dropdown.flip-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.list-filter .filter-reset {
  padding: 0;
  width: 16px;
  height: 24px;
}
.list-filter .dropdown button { border: 0; }

/* Project creation: match Figma 609:7357's 320 × 400 panels. */
dialog:has(#projectForm) > h2 { line-height: 16px; }
#projectForm .dialog-columns { height: 438px; }
#projectForm .dialog-section { min-height: 0; }
#projectForm .dialog-section:nth-child(2) { display: flex; flex-direction: column; overflow: hidden; }
#projectForm .dialog-section:nth-child(2) > h3,
#projectForm .dialog-section:nth-child(2) > .upload-zone { flex: none; }
#projectForm .file-list-region { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
#projectForm .field { gap: 10px; margin-bottom: 10px; }
#projectForm .field > span { line-height: 16px; }
#projectForm input, #projectForm select { height: 32px; }
#projectForm .form-row { margin-bottom: 20px; }
#projectForm .dialog-section > h3 { font-size: 14px; line-height: 16px; margin: 0 0 10px; }
#projectForm .dialog-section:first-child > h3 { padding: 10px 0; margin: 0; }
#projectForm .types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
#projectForm .types button { height: 24px; padding: 5px 0; }
#projectForm .type-description { font-size: 12px; line-height: 12px; min-height: 12px; margin-bottom: 20px; }
#projectForm .dialog-section:first-child > .field:last-child { gap: 0; margin-bottom: 0; }
#projectForm .dialog-section:first-child > .field:last-child > span { padding: 10px 0; }
#projectForm .field textarea { min-height: 122px; }
#projectForm .upload-zone { padding: 23px 8px 8px; }
#projectForm .upload-zone > button { height: 32px; }
#projectForm .upload-zone > p { font-size: 12px; line-height: 16px; margin-top: 15px; }
#projectForm .upload-zone > .small { font-size: 12px; line-height: 16px; margin-top: 5px; color: #999; }
dialog:has(#projectForm) > .error-text:empty { display: none; }

/* Keep the footer visible in short windows; only main navigation scrolls. */
.sidebar-heading { flex: none; }
.sidebar > .nav { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar .nav button { flex-shrink: 0; }

.list-filter .filter-empty { font-size: 12px; line-height: 12px; padding: 5px; }
.sidebar .user { display: grid; width: 100%; height: 45px; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: 32px; gap: 12px; padding: 12px 0 0 3px; align-items: center; }
.sidebar-collapsed .user { grid-template-columns: 26px; gap: 0; }
.sidebar .user .avatar { align-self: center; }
.sidebar-expanded .user .label { min-width: 0; }
.sidebar-expanded .user .logout { justify-self: end; margin-left: auto; }

/* Figma project client control: 120 × 32, matching the name input inset. */
#projectForm .form-row > .project-client-picker { flex: 0 0 120px; }
#projectForm .form-row > input[name="pageCount"] { flex: 0 0 52px; width: 52px; padding: 0 6px; }
#projectForm .form-row > .project-density-picker { flex: 0 0 80px; }
#projectForm .project-density-picker summary { width: 80px; padding: 0 5px; gap: 2px; }
#projectForm .project-density-picker .dropdown { min-width: 90px; }
#projectForm input { border-width: 1px; padding: 0 10px; line-height: 12px; }
.project-client-picker details { position: relative; }
.project-client-picker summary { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 120px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); list-style: none; cursor: pointer; line-height: 12px; }
.project-client-picker summary::-webkit-details-marker { display: none; }
.project-client-picker summary > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-client-picker .dropdown { top: calc(100% + 5px); bottom: auto; min-width: 120px; max-width: 300px; max-height: 180px; overflow-y: auto; gap: 5px; padding: 10px 5px; }
.project-client-picker .dropdown button { border: 0; line-height: 12px; }
.project-client-picker .filter-empty { padding: 5px; font-size: 12px; line-height: 12px; }
.project-client-picker .dropdown.flip-up { top: auto; bottom: calc(100% + 5px); }

.file-icon img { display: block; width: 24px; height: 24px; }
.file-icon-fallback { background: var(--soft); }

.file-role { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.file-role label { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; white-space: nowrap; }
.file-main .file-role input[type="radio"], #projectForm .file-role input[type="radio"] {
  width: 12px; height: 12px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--text);
}

@font-face {
  font-family: "PitchOS UI";
  src: local("MiSans-Bold");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
dialog:has(#projectForm) #modalTitle {
  font-weight: 700;
}

#projectForm [aria-invalid="true"],
#projectForm [aria-invalid="true"]:focus {
  border-color: #D54B46;
  outline-color: #D54B46;
  box-shadow: none;
}

.project-card .card-meta dt {
  font-size: 12px;
  color: #999;
}

.outline-generating p:first-of-type {
  margin-bottom: 6px;
}

.project-card .card-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.project-card .card-meta > div { min-width: 0; }
.project-card .card-meta dt,
.project-card .card-meta dd {
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}
.project-card .card-meta dd {
  white-space: nowrap;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

#clientForm input[name="industry"] {
  padding-right: 28px;
  background-image: url("./assets/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}
#clientForm input[name="industry"]::-webkit-calendar-picker-indicator {
  opacity: 0;
}
#clientForm .upload-zone > .small {
  font-size: 12px;
  line-height: 16px;
}

#clientForm .form-row > .industry-picker { flex: 0 0 100px; min-width: 0; }
.industry-picker summary { width: 100px; height: 34px; background: #fff; }
.industry-picker .dropdown { min-width: 100px; }
.industry-picker .dropdown button { font-size: 12px; }

.client-mark { position: relative; }
.client-logo { position: absolute; inset: 0; width: 60px; height: 60px; object-fit: contain; background: var(--surface); border-radius: 50%; padding: 4px; }

.client-card footer { align-items: center; }
.client-card footer > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 16px;
}
.client-card footer > span > .icon { flex: none; }

.project-card .card-delete {
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search input {
  height: 16px;
  line-height: 16px;
  font-weight: 400;
  caret-color: var(--text);
  cursor: text;
}
.search input:focus::placeholder { opacity: 0; }
.search input:focus { box-shadow: none; }

.chapter-head .count { background: transparent; }
.chapter-head > span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 20px;
}

.brand-footer { padding: 8px 10px 0; min-height: 98px; }
.brand-footer .brand { margin-bottom: 12px; }
.official-links { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: #737373; }
.official-links button { padding: 0; border: 0; font-size: 12px; line-height: 16px; color: inherit; background: transparent; }
.official-links a { font-size: 12px; line-height: 16px; color: inherit; }
.official-links a:hover { color: var(--interaction-border); text-decoration: none; }
.official-links > span { font-size: 12px; }
.brand-footer .registration { margin-top: 4px; color: #999; font-size: 11px; line-height: 16px; }

.shell.sidebar-floating { grid-template-columns: 60px minmax(0, 1fr); }
.sidebar-floating > .sidebar {
  width: 200px;
  z-index: 50;
  box-shadow: 6px 0 20px #26251f18;
}

.sidebar-floating > .sidebar {
  animation: sidebar-peek 140ms ease-out;
}
@keyframes sidebar-peek {
  from { opacity: 0.94; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-floating > .sidebar { animation: none; }
}
.sidebar > .nav {
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar > .nav::-webkit-scrollbar { display: none; }
/* During outline review the editing instruction lives below the center preview. */
.outline-review-prompt { padding: 0 10px 10px; }
.outline-review-prompt > p { margin: 0 0 8px; line-height: 1.5; }
.outline-review-prompt .outline-prompt { max-width: 100%; }

/* Personal accounts use the workbench's existing palette and spacing. */
body:has(.user-auth) {min-width:0}
.user-auth {margin:auto;display:flex;align-items:center;justify-content:center;height:auto;min-height:100dvh;padding:40px 24px}
.login-brand .brand {height:44px;justify-content:flex-start}
.login-brand .brand img {height:44px}
.eyebrow {font-size: 12px;letter-spacing:2px;color:var(--muted)}
.user-login {height:500px;display:flex;flex-direction:column;overflow-y:auto;width:430px;max-width:100%;background:var(--surface);border:1px solid var(--line);padding:32px;border-radius: var(--radius);box-shadow:0 12px 40px #26251f06}
.user-login h2 {font-size:24px;font-weight:500;margin:0 0 10px}
.user-login .tabs {margin:24px 0 20px;flex:none;display:flex}.user-login .tabs button{flex:1}
.login-body {flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center}.user-login .login-mode-switch {font-size:12px}.user-login form {display:grid;gap:16px}#userLoginForm{height:100%;display:flex;flex-direction:column;gap:16px}#userLoginForm .login-submit{margin-top:auto;flex:none}.login-legal{margin-top:44px;min-height:36px;flex:none;font-size:12px;line-height:18px;color:var(--muted)}.login-legal a{color:var(--text);text-decoration:underline;text-underline-offset:3px}.code-input {display:flex;gap:8px}.code-input input{flex:1;width:0}.code-input button{min-width:104px}
.dev-login {margin-top:24px;padding-top:16px;border-top:1px solid var(--line);color:var(--muted)}.dev-login summary{cursor:pointer}.dev-login form{margin-top:16px}
.qr-placeholder {min-height:270px;display:grid;place-content:center;text-align:center;border:1px dashed var(--line);margin-bottom:16px}.qr-placeholder .brand img{height:48px}.wechat-frame{width:100%;height:270px;border:0;display:block}.wechat-login{text-align:center}
.account-panel {padding:0;overflow:auto;min-width:0;height:100vh}
.account-panel .topbar h1 {font-size:18px;font-weight:700;line-height:24px}
.account-page-content {max-width:1040px;margin:0 auto;padding:56px 56px 80px}
.account-layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:16px}.account-card{background:var(--white);border:1px solid var(--line);border-radius: var(--radius);padding:28px}.account-card h2{font-size:16px;font-weight:700;margin:0 0 12px}.account-card form{display:grid;gap:16px}.account-card .field{max-width:440px}.account-card form>button{justify-self:start}.account-card p{line-height:1.6}
.account-nav{align-self:start;padding:24px 12px;display:flex;flex-direction:column;gap:6px;text-align:center}.account-nav h3{font-size:14px;margin:8px 0 0;overflow-wrap:anywhere}.account-nav p{margin:0 0 20px}.account-nav button{justify-content:flex-start;padding:12px 16px}.account-nav button.active{background:var(--soft);color:var(--accent)}
.account-avatar{padding:0;border:0;overflow:hidden;width:52px;height:52px;display:grid;place-content:center;border-radius:50%;background:var(--soft);font-size:22px;margin:auto}.account-content{display:grid;gap:16px;align-content:start}.account-metrics{display:grid;grid-template-columns:1fr 1fr;gap:16px}.metric{font-size:38px;font-weight:700;line-height:1.3!important;margin:20px 0;font-variant-numeric:tabular-nums}.metric small{font-size:16px;font-weight:400}.points-card .metric{color:var(--accent)}
.account-avatar img{display:block;object-fit:cover;width:52px;height:52px;border-radius:50%}
.identity-row{display:flex;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.identity-row .badge{margin-left:auto}.bind-details{margin-top:20px}.bind-details summary{cursor:pointer}.bind-details form{margin-top:18px}.amount-options{display:flex;gap:8px}.amount-options button{min-width:75px}.payment-methods{display:flex;gap:12px}.payment-method{padding:16px;border:1px solid var(--line);border-radius:var(--radius);display:flex;align-items:center;gap:12px;background:white;min-width:210px;cursor:pointer}.payment-method:has(input:checked){border-color:var(--accent)}.payment-method small{display:block;margin-top:4px}.payment-logo{font-size:18px;color:white;display:grid;place-content:center;width:34px;height:34px;border-radius:var(--radius)}.payment-logo.wechat{background:#22ab65}.payment-logo.alipay{background:#1688ed}
.table-scroll{overflow:auto}.payment-history table{width:100%;border-collapse:collapse;text-align:left}.payment-history th{color:var(--muted);font-weight:400;padding:16px 12px;border-bottom:1px solid var(--line)}.payment-history td{padding:18px 12px;border-bottom:1px solid var(--line)}.order-id{font-family:monospace;font-size: 12px}.order-status{padding:4px 8px;border-radius:var(--radius-small);background:var(--soft)}.order-status.paid{color:#27794d;background:#e5efe5}.order-status.pending{color:#916123;background:#f2eadc}.account-empty{text-align:center;padding:48px 16px}.account-empty>span{font-size:28px;color:var(--muted)}.account-empty h3{font-weight:500}.payment-overlay{position:fixed;inset:0;z-index:100;background:#26251f60;display:grid;place-content:center}.payment-dialog{width:370px;text-align:center;box-shadow:0 12px 60px #0002}.payment-dialog img{display:block;margin:20px auto;border-radius:var(--radius)}.payment-dialog h2{margin:0}.payment-dialog .full{width:100%}
@media(max-width:1200px){.account-page-content{padding:56px 32px 80px}.account-layout{grid-template-columns:170px minmax(0,1fr);gap:16px}.payment-method{min-width:180px}}
@media(max-width:700px){body:has(.user-auth){min-width:0}.user-auth{padding:24px;min-height:100dvh}.user-login{margin:0;padding:28px 24px}.account-metrics{grid-template-columns:1fr}}
.user-login .field,.account-card .field{margin-bottom:0}.user-login button{margin-top:0}.user-login .form-message:empty,.account-card .form-message:empty{display:none}

/* Workspace theme: retain the same measurements and type scale in both modes. */
.theme-toggle {
  width: 40px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  justify-content: flex-start;
}
.theme-toggle .icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px #0002;
  transition: transform 160ms ease, background 160ms ease;
}
.theme-toggle .icon img { width: 14px; height: 14px; }
.theme-toggle:hover:not(:disabled) { background: var(--line); }

.help-body { min-width: 0; overflow: auto; }
.help-body .topbar h1 { font-size: 18px; font-weight: 700; line-height: 24px; }
.help-content { max-width: 1040px; margin: 0 auto; padding: 56px 56px 80px; }
.help-intro { margin-bottom: 30px; }
.help-intro h2 { font-size: 28px; line-height: 1.3; font-weight: 700; margin: 8px 0 10px; }
.help-intro p, .help-contact p { color: var(--muted); line-height: 1.7; }
.help-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 16px; }
.help-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.help-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.help-card .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.help-card .field > span { font-weight: 500; }
.help-card textarea { resize: vertical; min-height: 160px; }
.help-card .form-message { min-height: 20px; margin-bottom: 10px; }
.help-contact { display: flex; flex-direction: column; gap: 16px; }
.help-contact a { color: var(--accent); display: inline-block; margin-top: 12px; font-weight: 600; }
.help-contact .support-qr { display: block; width: 150px; height: 150px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161b22;
  --surface: #222933;
  --soft: #2d3540;
  --line: #3c4652;
  --text: #eef2f6;
  --muted: #abb6c2;
  --accent: #ff7279;
  --white: #222933;
}
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .theme-toggle { background: #394553; }
:root[data-theme="dark"] .theme-toggle .icon { transform: translateX(16px); background: #62758b; }
:root[data-theme="dark"] .theme-toggle .icon img { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .icon img { filter: brightness(0) invert(.85); }
:root[data-theme="dark"] .danger .icon img,
:root[data-theme="dark"] .send .icon img { filter: none; }
:root[data-theme="dark"] .dark .icon img { filter: brightness(0) saturate(100%); }
:root[data-theme="dark"] .brand img { filter: invert(1) hue-rotate(180deg) brightness(1.4); }
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .status-panel,
:root[data-theme="dark"] .history-panel,
:root[data-theme="dark"] .list-panel,
:root[data-theme="dark"] .outline-panel,
:root[data-theme="dark"] .editor-panel,
:root[data-theme="dark"] .settings-card,
:root[data-theme="dark"] .help-card,
:root[data-theme="dark"] .account-card,
:root[data-theme="dark"] .account-panel,
:root[data-theme="dark"] dialog { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .prompt-box,
:root[data-theme="dark"] .outline-prompt,
:root[data-theme="dark"] .search,
:root[data-theme="dark"] .dropdown,
:root[data-theme="dark"] .upload-zone,
:root[data-theme="dark"] .dialog-section { background: #1c232c; color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #8794a2; }
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus { border-color: var(--interaction-border); box-shadow: none; }
:root[data-theme="dark"] button:not(.danger):not(.dark):not(.send):not(.history-page):hover:not(:disabled),
:root[data-theme="dark"] .project-card:hover { background: #343e4b; }
:root[data-theme="dark"] .dark,
:root[data-theme="dark"] .small-button.active { background: #e8eef4; color: #17202a; border-color: #e8eef4; }
:root[data-theme="dark"] .dark:hover:not(:disabled),
:root[data-theme="dark"] .small-button.active:hover:not(:disabled) { background: #fff; }
:root[data-theme="dark"] .small-button,
:root[data-theme="dark"] .tabs .active,
:root[data-theme="dark"] .chapter-head .count,
:root[data-theme="dark"] .page-link,
:root[data-theme="dark"] .history-item,
:root[data-theme="dark"] .file-row,
:root[data-theme="dark"] .upload-progress-item,
:root[data-theme="dark"] .client-card,
:root[data-theme="dark"] .project-card,
:root[data-theme="dark"] .content-block { background: #29313c; color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .page-link.active { background: #303840; color: #ff868d; border-color: var(--accent); }
:root[data-theme="dark"] .chapter-description,
:root[data-theme="dark"] .card-meta dt,
:root[data-theme="dark"] .card-meta dd,
:root[data-theme="dark"] .file-icon,
:root[data-theme="dark"] .official-links,
:root[data-theme="dark"] .brand-footer .registration { color: var(--muted); }
:root[data-theme="dark"] .status-card.running { background: #493c25; border-color: #795c32; }
:root[data-theme="dark"] .status-card.done { background: #263e36; border-color: #3b6652; }
:root[data-theme="dark"] .status-card.error { background: #482e36; border-color: #80505a; }
:root[data-theme="dark"] .client-mark { background: #3a4450; }
:root[data-theme="dark"] .ad-slot--offer { background-color: #222933; background-image: linear-gradient(90deg, #222933 0%, #222933ee 31%, #22293300 64%), url("./assets/pitchos-proposal-offer.jpg"); }
:root[data-theme="dark"] .file-warning { color: #e3bd79; }
:root[data-theme="dark"] .error-text { color: #ff8990; }
:root[data-theme="dark"] .upload-zone.dragover { background: #3b3038; }
:root[data-theme="dark"] .side-ad img { filter: brightness(.75); }
:root[data-theme="dark"] .payment-overlay { background: #070b10aa; }
:root[data-theme="dark"] .content-block:hover { border-color: transparent; background: #35404d; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle .icon { transition: none; }
}

/* Highlight the outer control in both palettes. */
:root .theme-toggle:hover:not(:disabled),
:root .prompt-box:has(textarea:focus),
:root .outline-prompt:has(textarea:focus),
:root .search:focus-within {
  border-color: var(--interaction-border);
}
:root .prompt-box textarea:focus,
:root .outline-prompt textarea:focus,
:root .search input:focus {
  box-shadow: none;
}

input,
textarea,
.prompt-box,
.search {
  transition: border-color 200ms ease;
}
#projectForm [aria-invalid="true"]:focus {
  border-color: var(--interaction-border);
}

.history-page { height: auto; }
.account-nav button { padding-top: 0; padding-bottom: 0; }

.history-item .history-page:hover:not(:disabled) { background: transparent; }

.sidebar-toggle,
.sidebar .user .logout {
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: var(--radius-small);
  color: var(--muted);
}
.sidebar-toggle .icon,
.sidebar .user .logout .icon,
.sidebar-toggle .icon img,
.sidebar .user .logout .icon img {
  width: 14px;
  height: 14px;
}
.sidebar .user-name {
  height: 32px;
  padding: 0;
  display: block;
  text-align: left;
  background: transparent;
  border-color: transparent;
  line-height: 16px;
}
.sidebar .user-name strong {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .user-name > span { display: block; }
:root .sidebar .user-name:hover:not(:disabled),
:root[data-theme="dark"] .sidebar .user-name:hover:not(:disabled) { background: transparent; }

.sidebar .avatar img {object-fit:cover;width:26px;height:26px;border-radius:50%}

.recharge-preview{padding:14px 16px;border-radius:12px;background:var(--soft);color:var(--accent);font-weight:600;font-variant-numeric:tabular-nums}

/* Account recharge controls share a single spacing and selection rhythm. */
.account-nav button.account-avatar {
  width:52px;height:52px;min-width:52px;padding:0;gap:0;
  display:grid;place-items:center;justify-content:center;grid-template-columns:52px;
}
.account-nav button.account-avatar img {width:52px;height:52px;margin:0;object-position:center}
.recharge-card .recharge-intro {margin-bottom:24px}
#userRechargeForm {gap:20px}
.recharge-section {display:grid;gap:12px}
#userRechargeForm .field {max-width:none;gap:8px}
#userRechargeForm .field > span,.recharge-label {font-weight:600}
#userRechargeForm .amount-options {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#userRechargeForm .amount-options button {min-width:0;background:var(--white);transition:border-color 200ms,color 200ms,background 200ms}
#userRechargeForm .amount-options button[aria-pressed="true"] {border-color:var(--interaction-border);color:var(--accent);background:var(--white)}
#userRechargeForm .recharge-preview {display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:16px 20px;border-radius:6px;background:var(--surface);border:1px solid var(--line);font-weight:400}
.recharge-preview > div {display:grid;gap:6px}
.recharge-preview > div + div {border-left:1px solid var(--line);padding-left:20px}
.recharge-preview span {color:var(--muted);font-size:12px}
.recharge-preview strong {font-size:22px;line-height:28px;font-weight:700}
.recharge-preview small {font-size:12px;font-weight:400}
#userRechargeForm .payment-methods {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#userRechargeForm .payment-method {min-width:0;padding:14px 16px;gap:12px;background:var(--white);transition:border-color 200ms,background 200ms}
#userRechargeForm .payment-method:has(input:checked):not(.unavailable) {border-color:var(--interaction-border);background:var(--surface)}
#userRechargeForm .payment-method input {accent-color:var(--accent);flex:none}
#userRechargeForm .payment-method strong {font-weight:600}
#userRechargeForm .payment-logo {width:30px;height:30px;font-size:16px;flex:none}
#userRechargeForm .payment-method.unavailable {cursor:default;opacity:.5}
#userRechargeForm .recharge-note {line-height:1.7}
.recharge-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding-top:20px}
@media(max-width:800px) {#userRechargeForm .payment-methods {grid-template-columns:1fr}.recharge-footer {align-items:flex-start;flex-direction:column}}

.profile-intro {margin-bottom:24px}
#userProfileForm {gap:24px}
.profile-section {border:0;padding:0;margin:0;min-width:0}
.profile-section legend {font-size:13px;font-weight:700;margin-bottom:14px;padding:0}
.profile-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px}
.profile-section:first-child .profile-fields > .field:first-child {grid-column:1 / -1}
#userProfileForm .field {max-width:none;min-width:0;gap:8px}
#userProfileForm .field > span {display:flex;align-items:center;justify-content:space-between;font-weight:500}
.optional-label {font-size:11px;color:var(--muted);font-weight:400}
#userProfileForm select {height:34px;background:var(--white);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:0 10px;transition:border-color 200ms}
#userProfileForm select:focus {border-color:var(--interaction-border);outline:none}
.section-description {margin-top:-6px;margin-bottom:14px}
.profile-account-info {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:20px;padding:16px 20px;background:var(--surface);border:1px solid var(--line);border-radius:6px}
.profile-account-info span {font-size:12px;color:var(--muted)}
.profile-account-info p {font-size:12px;margin-top:6px;overflow-wrap:anywhere}
.profile-footer {display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:20px;gap:12px}
@media(max-width:800px) {.profile-fields,.profile-account-info {grid-template-columns:1fr}}

#userRechargeForm {display:grid;gap:20px}
#userRechargeForm .amount-options {grid-template-columns:repeat(6,minmax(0,1fr))}
.recharge-pay-buttons {display:flex;flex-wrap:wrap;gap:10px}
.recharge-pay-buttons .recharge-pay {height:30px;padding:0 10px;gap:8px}
#userRechargeForm .recharge-pay .payment-logo {width:18px;height:18px;font-size:12px;border-radius:4px}
.account-metrics .metric-link {height:24px;padding:0 8px;font-size:11px;border-radius:4px}
.points-increase {color:var(--accent)}
.payment-dialog {position:relative;width:380px;padding:32px;text-align:center;border-radius:6px}
.payment-dialog .payment-close {position:absolute;right:12px;top:12px;width:24px;height:24px;padding:0;font-size:24px;line-height:24px}
.payment-brand {display:flex;align-items:center;justify-content:center;gap:10px;font-size:20px;margin-bottom:24px}
.payment-brand .payment-logo {width:28px;height:28px;font-size:18px}
.payment-dialog .payment-prompt {font-size:16px;margin-bottom:12px}
.payment-dialog .payment-amount {font-size:44px;line-height:1.2;font-weight:700;margin:0 0 24px}
.payment-amount small {font-size:24px;font-weight:600}
.payment-qr {width:264px;padding:12px;border:1px solid var(--line);border-radius:6px;margin:0 auto 24px;background:white}
.payment-dialog .payment-qr img {width:240px;height:240px;margin:0;border-radius:0}
.payment-dialog .payment-expiry {line-height:1.8;margin-bottom:12px}
@media(max-width:1000px) {#userRechargeForm .amount-options {grid-template-columns:repeat(3,minmax(0,1fr))}}

#userRechargeForm .amount-options {grid-template-columns:repeat(6,minmax(0,1fr))}
#userRechargeForm .amount-options button {height:72px;display:flex;flex-direction:column;gap:8px;padding:12px 4px;border-radius:6px}
.tier-amount {position:relative;font-size:22px;font-weight:700;line-height:24px;white-space:nowrap;font-variant-numeric:tabular-nums}
.tier-amount small {position:absolute;right:calc(100% + 2px);bottom:0;font-size:12px;font-weight:400}
.tier-points {font-size:11px;line-height:14px;color:var(--muted);white-space:nowrap}
.payment-inline {width:264px;max-width:100%;text-align:center;padding-top:12px}
.payment-inline .payment-brand {font-size:14px;gap:8px;margin-bottom:12px}
.payment-inline .payment-brand .payment-logo {width:20px;height:20px;font-size:12px}
.payment-inline .payment-prompt {display:none}
.payment-inline .payment-amount {font-size:20px;font-weight:700;margin:0 0 12px}
.payment-inline .payment-amount small {font-size:12px}
.payment-inline .payment-qr {width:244px;max-width:100%;margin:0 auto 12px;padding:11px;background:white}
.payment-inline .payment-qr img {width:220px;height:220px;margin:0;display:block}
.payment-inline .payment-expiry {font-size:12px;line-height:1.7;margin-bottom:8px}
.payment-inline .account-empty {padding:20px 0}
@media(max-width:1200px) {#userRechargeForm .amount-options {grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:800px) {#userRechargeForm .amount-options {grid-template-columns:repeat(3,minmax(0,1fr))}}

#userRechargeForm .recharge-pay {
  width:166px;height:52px;padding:13px 28px;justify-content:flex-start;background:#fff;border:1px solid var(--line);
  transition:border-color 200ms;
}
#userRechargeForm .recharge-pay:hover:not(:disabled) {background:#fff;border-color:var(--interaction-border)}
.payment-brand-image {display:block;height:24px;width:auto;object-fit:contain;flex:none}
.payment-inline .payment-brand {width:max-content;max-width:100%;margin:0 auto 12px;padding:5px 10px;background:#fff;border-radius:4px}

/* Shared footer for auxiliary pages; it follows long content and rests at the bottom of short pages. */
.help-body,.account-panel {display:flex;flex-direction:column;min-height:100dvh}
.help-body > .topbar,.account-panel > .topbar {flex:none}
.help-content,.account-page-content {width:100%;flex:none}
.page-footer {margin-top:auto;padding:20px 24px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px 24px;color:var(--muted);font-size:11px;line-height:18px;flex:none}
.page-footer nav {display:flex;gap:16px}
.page-footer a {color:inherit;text-decoration:none}
.page-footer a:hover {color:var(--text)}
.help-grid > .help-card {display:flex;flex-direction:column}
#supportForm {display:flex;flex-direction:column;gap:16px;flex:1}
#supportForm .field {margin:0;max-width:none}
#supportForm .field:nth-child(2) {flex:1}
#supportForm textarea {min-height:100px;flex:1;resize:vertical}
#supportForm .form-message:empty {display:none}
#supportForm .form-message {min-height:0;margin:0}
#supportForm button {align-self:flex-start}
@media(max-width:800px) {.help-grid {grid-template-columns:1fr}.help-content {padding:32px 24px 48px}.page-footer {gap:8px 16px;padding:16px}}

#accountPaymentDialog {padding:28px;width:380px;max-width:calc(100vw - 32px);text-align:center}
#accountPaymentDialog .payment-inline {width:100%;margin:0;max-width:none;text-align:center}
#accountPaymentDialog .payment-prompt {display:block}
#accountPaymentDialog .payment-qr img {width:220px;height:220px;margin:0}
#accountPaymentDialog .payment-qr {margin:20px auto}
#accountPaymentDialog .payment-actions {display:flex;justify-content:center;gap:12px;margin-top:20px}
.payment-waiting {display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);margin:20px 0}
.payment-spinner {width:18px;height:18px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:payment-spin 900ms linear infinite}
@keyframes payment-spin {to {transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce) {.payment-spinner {animation:none}}

/* Platform settings reuse the personal account page's spacing and cards. */
.account-preferences .settings-row {display:flex;align-items:center;justify-content:space-between;gap:32px}
.account-preferences .settings-row > div {max-width:640px}
.account-preferences .settings-row p {margin:0}
.account-preferences .settings-row > button {flex-shrink:0}
.account-preferences .settings-consent-note {margin:20px 0 0;padding-top:20px;border-top:1px solid var(--line)}
.account-preferences a {color:inherit;text-underline-offset:3px}
.settings-switch {width:44px;height:26px;padding:3px;border-radius:20px;background:var(--muted);justify-content:flex-start;transition:background .18s}
.settings-switch span {width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .18s}
.settings-switch[aria-checked="true"] {background:var(--accent)}
.settings-switch[aria-checked="true"] span {transform:translateX(18px)}
.settings-switch:hover:not(:disabled) {background:var(--muted)}
.settings-switch[aria-checked="true"]:hover:not(:disabled) {background:var(--accent)}
.settings-switch:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
.settings-danger-button {color:var(--accent);border-color:var(--line)}
.settings-delete-dialog {max-width:480px;width:calc(100% - 48px);padding:32px}
.settings-delete-dialog h2 {font-size:18px;margin:12px 0 20px}
.settings-delete-dialog p {line-height:1.8}
.settings-step {color:var(--muted);font-size:12px}
.settings-warning {padding:12px;background:var(--soft);border-radius:var(--radius)}
.settings-delete-dialog .field {display:grid;gap:8px;margin-top:24px}
.settings-delete-dialog .error-text:empty {display:none}

/* Message center shares the account page's layout, surfaces and theme tokens. */
.message-nav-heading{padding:4px 0 12px;display:grid;justify-items:center}
.message-nav-heading>.icon{width:28px;height:28px;margin-bottom:4px}
.message-nav-heading>.icon img{width:28px;height:28px}
.message-nav-heading p{margin:8px 0 0}
.message-nav button{justify-content:space-between;gap:8px}
.message-count{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.message-list-card{padding:0;overflow:hidden}
.message-toolbar{padding:24px;display:flex;justify-content:space-between;align-items:center;gap:16px;border-bottom:1px solid var(--line)}
.message-toolbar h2{margin-bottom:6px}
.message-toolbar p{margin:0}
.message-toolbar .row{gap:8px;flex-shrink:0}
.message-delete{color:var(--muted)}
.message-list{display:grid}
button.message-row{position:relative;height:auto;width:100%;display:flex;align-items:flex-start;gap:12px;padding:24px;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left;white-space:normal;color:var(--text)}
button.message-row:last-child{border-bottom:0}
button.message-row:hover{background:var(--soft)}
.message-status{position:absolute;left:10px;top:31px;width:6px;height:6px;border-radius:50%;background:transparent}
.message-status.unread{background:var(--accent)}
.message-row-content{display:grid;gap:9px;min-width:0;flex:1}
.message-row-title{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.message-row-title strong{font-size:13px;font-weight:500}
.is-unread .message-row-title strong{font-weight:700}
.message-type{background:var(--soft);border:1px solid var(--line);border-radius:4px;padding:2px 6px;font-size:10px;line-height:16px;color:var(--muted);white-space:nowrap}
.message-summary{font-size:12px;color:var(--muted);line-height:1.7}
.message-sender{font-size:11px;color:var(--muted)}
.message-row-end{display:grid;justify-items:end;gap:24px;color:var(--muted);font-size:10px;flex:none}
.message-detail .message-back{height:auto;padding:6px 10px;margin-left:-10px;margin-bottom:24px;color:var(--muted)}
.message-detail-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;color:var(--muted);font-size:11px;margin-bottom:16px}
.message-detail h2{font-size:20px;line-height:1.5;margin-bottom:24px}
.message-detail-body{border-top:1px solid var(--line);padding-top:24px;font-size:13px;overflow-wrap:anywhere}
.message-detail-body p{line-height:1.9;margin:0 0 18px}
.message-detail-body p:last-child{margin:28px 0 0;color:var(--muted)}
.message-empty{padding:64px 24px}
.message-empty>.icon{margin:0 auto 16px;width:32px;height:32px}
.message-empty>.icon img{width:32px;height:32px}
.message-empty h3{font-size:14px;margin-bottom:10px}
@media(max-width:1000px){.message-toolbar{align-items:flex-start;flex-direction:column}.message-row-end{max-width:96px}.message-row-end time{line-height:1.6;text-align:right}}

.account-preferences .settings-nav h3 {text-align:left;margin:0 16px 18px;font-size:14px}
.account-preferences .settings-nav button {width:100%}
.account-preferences .settings-scope {margin:24px 0;padding:20px;background:var(--soft);border-radius:var(--radius)}
.account-preferences .settings-scope h3 {font-size:12px;font-weight:600;margin:0 0 8px}
.account-preferences .settings-scope h3:not(:first-child) {margin-top:20px}
.account-preferences .settings-scope p {margin:0;line-height:1.8}
.account-preferences .settings-detail-actions {display:flex;justify-content:flex-end;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}

#userLoginForm .login-mode-switch {align-self:flex-end;height:auto;min-height:0;padding:0;border:0;border-radius:0;background:transparent;color:var(--muted);font-size:12px;line-height:18px;text-decoration:underline;text-underline-offset:3px}
#userLoginForm .login-mode-switch:hover {color:var(--text);background:transparent}

.identity-row .identity-bind {margin-left:auto;font-size:12px;color:var(--accent);text-decoration:underline;text-underline-offset:3px;flex:none}
.identity-binding summary {cursor:pointer;list-style:none}
.identity-binding summary::-webkit-details-marker {display:none}
.identity-binding .userBindForm {display:grid;gap:16px;padding:20px 0;border-bottom:1px solid var(--line)}

.record-filters {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 12px;margin:24px 0 16px;padding-bottom:20px;border-bottom:1px solid var(--line)}
.record-filters label {display:flex;flex-direction:column;gap:7px;min-width:0;font-size:11px;color:var(--muted)}
.record-filters input,.record-filters select {width:100%;min-width:0;height:32px;color:var(--text);font-size:12px}
.record-filter-actions {display:flex;align-items:flex-end;gap:8px}
.record-filter-actions button {flex:1;min-width:0}
.record-pagination {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px;margin-top:20px;font-size:11px}
.record-pagination > div {display:flex;align-items:center;gap:8px}
.record-pagination button {font-size:11px;padding:0 8px}
.payment-history .order-id {display:block;max-width:200px;overflow-wrap:anywhere}
.payment-history .order-status {white-space:nowrap}
.payment-history td:not(:first-child) {min-width:70px}
@media(max-width:1100px) {.record-filters {grid-template-columns:repeat(2,minmax(0,1fr))}}

.help-library {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:start}
.help-library h2 {font-size:16px;font-weight:700;margin:0 0 16px}
.help-article-list a {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0;border-top:1px solid var(--line);color:var(--text);text-decoration:none}
.help-article-list h3 {font-size:13px;font-weight:600;margin:0 0 6px}
.help-article-list p {font-size:12px;color:var(--muted);line-height:1.6;margin:0}
.help-article-list a > span {font-size:20px;color:var(--muted)}
.help-article-list a:hover h3,.help-back:hover {color:var(--accent)}
.help-article-list a:focus-visible,.help-feedback-link:focus-visible {outline:2px solid var(--accent);outline-offset:4px}
.help-feedback-callout {margin-top:24px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 24px;background:var(--white);border:1px solid var(--line);border-radius:6px}
.help-feedback-callout strong {font-size:13px;font-weight:600}
.help-feedback-callout p {margin:6px 0 0;font-size:12px}
.help-feedback-link {flex:none;display:inline-flex;align-items:center;padding:0 14px;height:30px;border:1px solid var(--line);border-radius:4px;color:var(--text);text-decoration:none;font-size:12px}
.help-feedback-link:hover {border-color:var(--interaction-border);color:var(--accent)}
.help-back {display:inline-block;margin-bottom:20px;color:var(--muted);text-decoration:none;font-size:12px}
.help-article h2 {font-size:22px;line-height:1.5;margin:0 0 12px;font-weight:700}
.help-article figure {margin:24px 0}
.help-article figure img {display:block;width:100%;height:auto;border-radius:6px}
.help-article figcaption {margin-top:8px;font-size:11px;color:var(--muted);text-align:center}
.help-article ol {padding-left:22px;margin:0}
.help-article li {padding-left:8px;margin-top:24px;line-height:1.8}
.help-article li h3 {margin:0 0 8px;font-size:14px}
.help-article li p,.help-article-text {font-size:13px;line-height:1.9;margin:0}
.help-article-text {margin-top:24px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:1100px) {.help-library {grid-template-columns:1fr}}

/* Home: resume work first, then discover product news and guidance. */
.home-panel {min-width:0;height:100dvh;overflow:auto;display:flex;flex-direction:column}
.home-panel > .topbar {flex:none}
.home-panel .topbar h1 {font-size:18px;font-weight:700;line-height:24px}
.home-content {width:100%;max-width:1200px;margin:0 auto;padding:44px 48px 40px}
.home-welcome {display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:28px}
.home-date {color:var(--muted);font-size:11px;margin:0 0 10px}
.home-welcome h2 {font-size:28px;line-height:1.3;font-weight:700;margin:0 0 12px}
.home-welcome .muted {font-size:12px;line-height:1.7;margin:0}
.home-start-actions {display:flex;gap:10px;flex:none}
.home-start-actions button {padding:0 14px}
.home-overview {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:30px}
.home-overview > div {background:var(--white);border:1px solid var(--line);border-radius:6px;padding:20px 24px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px 16px}
.home-overview span {font-size:12px;color:var(--muted)}
.home-overview strong {grid-row:span 2;font-size:30px;line-height:1;font-weight:700;font-variant-numeric:tabular-nums}
.home-overview > div:first-child strong {color:var(--accent)}
.home-overview small {font-size:11px;color:var(--muted);line-height:1.6}
.home-columns {display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
.home-main-column,.home-side-column {display:grid;gap:24px;min-width:0}
.home-section {min-width:0;background:var(--white);border:1px solid var(--line);border-radius:6px;padding:24px}
.home-section-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.home-section-heading h2,.home-shortcuts > h2 {font-size:16px;font-weight:700;margin:0;line-height:1.5}
.home-section-heading p {font-size:11px;color:var(--muted);margin:6px 0 0;line-height:1.7}
.home-section-heading a {display:inline-flex;align-items:center;gap:2px;font-size:11px;white-space:nowrap;color:var(--muted);text-decoration:none}
.home-section-heading a:hover,.home-text-link:hover {color:var(--accent)}
.home-project-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.home-project {border:1px solid var(--line);border-radius:6px;padding:18px;min-width:0;display:flex;flex-direction:column;align-items:flex-start;transition:border-color 200ms}
.home-project:hover {border-color:var(--interaction-border)}
.home-project-top {width:100%;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px;margin-bottom:14px}
.home-stage {color:var(--accent);font-size:10px;line-height:18px}
.home-project h3 {font-size:14px;font-weight:700;line-height:1.6;margin:0 0 7px;overflow-wrap:anywhere}
.home-project-client {font-size:11px;color:var(--muted);margin:0 0 18px;line-height:1.6}
.home-project-next {font-size:11px;line-height:1.7;margin:0 0 18px;color:var(--muted)}
.home-project-bottom {width:100%;margin-top:auto;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;font-size:10px}
.home-project-bottom button,.home-demo button {font-size:11px;padding:0 8px;height:26px}
.home-project-bottom .icon {width:12px;height:12px}
.home-tag,.home-demo-badge {font-size:10px;color:var(--muted);padding:2px 6px;border:1px solid var(--line);border-radius:4px;white-space:nowrap}
.home-model-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
.home-model-role {font-size:10px;color:var(--muted)}
.home-model-grid h3 {font-size:14px;font-weight:600;line-height:1.5;margin:6px 0;overflow-wrap:anywhere}
.home-model-grid p {font-size:11px;line-height:1.7;margin:0;color:var(--muted)}
.home-model-preview {display:flex;gap:12px;align-items:flex-start;margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.home-model-preview p {font-size:11px;line-height:1.8;color:var(--muted);margin:0}
.home-update-list article {padding:18px 0;border-top:1px solid var(--line)}
.home-update-list article > div {display:flex;align-items:center;gap:7px;font-size:10px;color:var(--muted);margin-bottom:9px}
.home-update-dot {width:5px;height:5px;border-radius:50%;background:var(--accent)}
.home-update-number {margin-left:auto;font-variant-numeric:tabular-nums}
.home-update-list h3 {font-size:13px;font-weight:600;line-height:1.7;margin:0 0 6px}
.home-update-list p {font-size:11px;color:var(--muted);line-height:1.8;margin:0}
.home-text-link {display:flex;gap:6px;align-items:center;color:var(--muted);font-size:11px;text-decoration:none;padding-top:12px}
.home-shortcuts {padding-bottom:10px}
.home-shortcuts > h2 {font-size:14px;margin-bottom:12px}
.home-shortcuts a {display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none;padding:14px 0;border-top:1px solid var(--line)}
.home-shortcuts a > span {flex:none;align-self:flex-start;color:var(--muted)}
.home-shortcuts a > .icon {margin-left:auto;width:12px;height:12px;flex:none}
.home-shortcuts strong {display:block;font-size:11px;font-weight:500;margin-bottom:5px}
.home-shortcuts small {display:block;font-size:10px;color:var(--muted);line-height:1.7}
.home-shortcuts a:hover strong {color:var(--accent)}
.home-tip {padding:0 4px}
.home-tip > span {font-size:10px;color:var(--muted)}
.home-tip h3 {font-size:13px;font-weight:600;margin:10px 0}
.home-tip p {font-size:11px;color:var(--muted);line-height:1.9;margin:0}
.home-empty {text-align:center;padding:24px 12px 32px;border:1px dashed var(--line);border-radius:6px}
.home-empty-mark {display:block;width:28px;height:28px;margin:0 auto 14px;color:var(--muted)}
.home-empty-mark .icon,.home-empty-mark img {width:28px;height:28px}
.home-empty h3 {font-size:15px;font-weight:600;margin:0 0 10px}
.home-empty p {font-size:12px;color:var(--muted);line-height:1.8;margin:0 0 20px}
.home-demo-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin:24px 0 12px;font-size:11px;color:var(--muted)}
.home-demo h3 {margin-top:10px}
.home-panel .page-footer {margin-top:auto}
.home-section-heading a .icon,.home-project-bottom .icon,.home-text-link .icon,.home-shortcuts a > .icon {transform:rotate(-90deg)}
@media(max-width:1200px) {.home-content {padding:36px 32px}.home-columns {grid-template-columns:minmax(0,1fr) 280px;gap:16px}.home-section {padding:20px}.home-welcome {align-items:flex-start}.home-start-actions {flex-direction:column}.home-overview > div {padding:18px}}
@media(max-width:900px) {.home-columns {grid-template-columns:1fr}.home-overview {grid-template-columns:1fr}.home-project-grid {grid-template-columns:1fr}.home-welcome {flex-direction:column}.home-start-actions {flex-direction:row}}
