:root {
  --paper: #f7f5f0;
  --white: #fffefa;
  --ink: #302e2a;
  --muted: #77736a;
  --line: #dedbd3;
  --red: #9c453c;
  --rose: #f0e4df;
  --green: #5c6a58;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.6 "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  padding: 9px 14px;
}
button:hover {
  background: var(--rose);
}
.primary {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.primary:hover {
  background: #843a32;
}
.draft {
  padding: 8px 24px;
  text-align: center;
  background: #eae5dc;
  font-size: 12px;
  color: #625e55;
}
.shell {
  max-width: 1600px;
  min-height: calc(100vh - 35px);
  margin: auto;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
}
.sidebar {
  padding: 32px 22px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand {
  font:
    23px/1.4 "Songti SC",
    "STSong",
    serif;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  font: 10px/2 sans-serif;
  letter-spacing: 3px;
  color: var(--muted);
}
nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
nav button {
  text-align: left;
  background: none;
  border: 0;
  padding: 12px 16px;
}
nav button.active {
  background: var(--rose);
  color: var(--red);
  font-weight: 600;
}
nav .num {
  display: inline-block;
  width: 26px;
  font-size: 11px;
  opacity: 0.6;
}
.side-note {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.avatars {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
}
.avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--white);
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 38px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.topbar b {
  color: var(--ink);
  font-weight: 500;
}
.main {
  padding: 30px 38px 50px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--red);
  margin-bottom: 8px;
}
h1 {
  font:
    32px/1.3 "Songti SC",
    "STSong",
    serif;
  margin: 0 0 10px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
}
h3 {
  font-size: 15px;
  margin: 0 0 6px;
}
p {
  margin: 8px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  background: #eeeae2;
  color: #6f685a;
  border-radius: 4px;
}
.tag.red {
  color: var(--red);
  background: var(--rose);
}
.tag.green {
  color: var(--green);
  background: #e9ede5;
}
.facts {
  display: flex;
  gap: 0;
  border-block: 1px solid var(--line);
  margin-bottom: 28px;
}
.fact {
  padding: 15px 25px 15px 0;
  flex: 1;
}
.fact b {
  font-size: 17px;
  font-weight: 500;
  display: block;
}
.fact span {
  font-size: 11px;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
  align-items: start;
}
.focus {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  margin-bottom: 26px;
}
.focus-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.action-row:last-child {
  border: 0;
  padding-bottom: 0;
}
.index {
  font:
    italic 19px Georgia,
    serif;
  color: var(--red);
}
.action-row .text {
  flex: 1;
}
.link {
  border: 0;
  background: none;
  color: var(--red);
  padding: 5px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filters button {
  font-size: 12px;
  padding: 6px 12px;
  background: none;
}
.filters button.active {
  color: var(--red);
  background: var(--rose);
  border-color: #d7bcb4;
}
.timeline {
  margin-left: 11px;
  border-left: 1px solid #cdc8bc;
  padding-left: 27px;
}
.phase {
  position: relative;
  padding-bottom: 26px;
}
.phase:before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  background: #b7b1a4;
  border-radius: 50%;
  position: absolute;
  left: -33px;
  top: 7px;
}
.phase.current:before {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--rose);
}
.phase-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.phase-title h3 {
  margin: 0;
}
.task {
  display: block;
  text-align: left;
  width: 100%;
  padding: 13px 15px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: var(--white);
}
.task.selected {
  border-color: #b77d70;
  background: #fbf5f1;
}
.task-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.task-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.phase-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.details {
  background: var(--white);
  border: 1px solid var(--line);
  position: sticky;
  top: 20px;
}
.details-top {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.detail-body {
  padding: 22px;
}
.detail-body h2 {
  font:
    23px/1.5 "Songti SC",
    "STSong",
    serif;
}
.detail-fields {
  margin: 22px 0;
}
.field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin: 12px 0;
}
.field span:first-child {
  color: var(--muted);
}
.note {
  padding: 13px;
  background: var(--paper);
  font-size: 12px;
  margin: 15px 0;
}
.step {
  display: flex;
  gap: 10px;
  font-size: 12px;
  margin: 15px 0;
  align-items: start;
}
.step input {
  margin-top: 4px;
  accent-color: var(--red);
}
.full {
  width: 100%;
  margin-top: 12px;
}
.detail-close {
  display: none;
}
.reminder {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
  font-size: 12px;
  color: var(--muted);
}
.bottomnav {
  display: none;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.section-note {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 0.7fr 0.7fr 0.8fr;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.purchase-row.head {
  font-size: 11px;
  color: var(--muted);
  padding: 10px 0;
}
.purchase-row h3 {
  font-size: 14px;
}
.purchase-row p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0;
}
.purchase-row button {
  font-size: 11px;
  padding: 5px 9px;
}
.panel {
  background: var(--white);
  padding: 24px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.budgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.amount {
  font:
    34px/1.5 Georgia,
    serif;
}
.budget-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.budget-line:last-child {
  border: 0;
}
.chat {
  max-width: 760px;
  margin: auto;
}
.bubble {
  border: 1px solid var(--line);
  padding: 22px;
  margin: 20px 0;
  background: var(--white);
}
.chat-entry {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}
.chat-entry input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  padding: 13px;
  background: var(--white);
  border-radius: 6px;
}
.saved {
  padding: 16px;
  border: 1px dashed #bdad9b;
  margin-top: 20px;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--ink);
  color: white;
  z-index: 20;
  max-width: 90%;
  display: none;
}
.mobile-shade {
  display: none;
}
.empty {
  padding: 25px;
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1500px) {
  .main {
    padding-inline: 50px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .shell {
    grid-template-columns: 165px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 15px;
  }
  .main {
    padding-inline: 24px;
  }
  .topbar {
    padding-inline: 24px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .details {
    display: none;
  }
  .details.open {
    display: block;
    position: fixed;
    right: 20px;
    top: 70px;
    width: 340px;
    max-height: 80vh;
    overflow: auto;
    z-index: 11;
    box-shadow: 0 10px 50px #0002;
  }
  .details.open .detail-close {
    display: block;
  }
}
@media (max-width: 760px) {
  .draft {
    font-size: 10px;
    padding: 6px 10px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    padding: 16px 20px;
  }
  .topbar .desktop-only {
    display: none;
  }
  .main {
    padding: 23px 20px 95px;
  }
  h1 {
    font-size: 28px;
  }
  .intro {
    display: block;
    margin-bottom: 20px;
  }
  .intro > button {
    display: none;
  }
  .intro p {
    font-size: 12px;
  }
  .intro > button {
    font-size: 11px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .facts {
    margin-bottom: 22px;
  }
  .fact {
    padding: 12px 8px 12px 0;
  }
  .fact b {
    font-size: 14px;
  }
  .fact span {
    font-size: 10px;
  }
  .layout {
    display: block;
  }
  .focus {
    padding: 17px;
    margin-bottom: 24px;
  }
  .focus h2 {
    font-size: 16px;
  }
  .action-row {
    gap: 10px;
    padding: 12px 0;
  }
  .action-row h3 {
    font-size: 13px;
  }
  .action-row p {
    font-size: 11px;
    margin: 3px 0;
  }
  .focus-head .tag {
    font-size: 10px;
  }
  .filters {
    gap: 6px;
    margin-bottom: 23px;
  }
  .filters button {
    padding: 6px 10px;
    font-size: 11px;
  }
  .timeline {
    padding-left: 23px;
    margin-left: 7px;
  }
  .phase:before {
    left: -29px;
  }
  .task {
    padding: 12px;
  }
  .task-meta {
    gap: 8px;
  }
  .task-top {
    font-size: 13px;
  }
  .tag {
    font-size: 10px;
  }
  .details {
    display: none;
  }
  .details.open {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 87dvh;
    overflow: auto;
    z-index: 12;
    border-radius: 14px 14px 0 0;
  }
  .detail-close {
    display: block;
    border: 0;
    background: none;
    padding: 4px 10px;
    font-size: 18px;
  }
  .mobile-shade.open {
    display: block;
    position: fixed;
    inset: 0;
    background: #24211c66;
    z-index: 11;
  }
  .bottomnav {
    display: flex;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--white);
    border-top: 1px solid var(--line);
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .bottomnav .num {
    display: none;
  }
  .bottomnav button {
    border: 0;
    background: none;
    font-size: 12px;
    padding: 8px 12px;
    color: var(--muted);
  }
  .bottomnav button.active {
    color: var(--red);
    background: var(--rose);
  }
  .purchase-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 17px 0;
  }
  .purchase-row.head {
    display: none;
  }
  .purchase-row .quantity {
    font-size: 12px;
    color: var(--muted);
  }
  .purchase-row .status {
    grid-column: 2;
    grid-row: auto;
  }
  .budgets {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    padding: 19px;
  }
  .amount {
    font-size: 30px;
  }
  .chat-entry {
    gap: 6px;
  }
  .chat-entry button {
    padding: 9px;
  }
  .toast {
    bottom: 85px;
    font-size: 12px;
    width: max-content;
  }
  .budget-line {
    font-size: 12px;
  }
  .phase-title h3 {
    font-size: 14px;
  }
}

[hidden] {
  display: none !important;
}
.auth-wrap {
  max-width: 500px;
  margin: 8vh auto;
  padding: 30px;
}
.auth-wrap h1 {
  margin: 20px 0;
}
.auth-wrap .brand {
  color: var(--red);
}
label.input {
  display: block;
  font-size: 12px;
  margin: 15px 0;
  color: var(--muted);
}
label.input input,
label.input select,
label.input textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
}
label.input textarea {
  min-height: 85px;
  resize: vertical;
}
select {
  font: inherit;
}
.error {
  color: #993328;
  background: #fff0e9;
  padding: 12px;
  border: 1px solid #dfb4a8;
  border-radius: 5px;
  font-size: 12px;
  white-space: pre-wrap;
}
.error:empty {
  display: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.search {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 9px 12px;
  border-radius: 5px;
}
.dialog {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 0;
  width: min(640px, calc(100% - 28px));
  max-height: 90dvh;
  overflow: auto;
}
.dialog::backdrop {
  background: #29231d66;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.dialog-header h2 {
  margin: 0;
}
.dialog form {
  padding: 10px 24px 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
}
.confirm-list {
  white-space: pre-wrap;
}
.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.draft {
  background: #eee7dd;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 22px 0 8px;
}
.progress-track {
  height: 4px;
  background: var(--line);
}
.progress-track div {
  height: 100%;
  background: var(--red);
}
.expense {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.expense h3 {
  font-size: 14px;
}
.expense p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0;
}
.expense .money {
  font-size: 18px;
}
.purchase-row {
  cursor: pointer;
}
.purchase-row:hover {
  background: #eee8df55;
}
.sync {
  font-size: 11px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-actions button {
  padding: 4px 9px;
  font-size: 11px;
}
.activity {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fact b {
  overflow-wrap: anywhere;
}
.chat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-actions button {
  font-size: 12px;
}
.detail-body p,
.detail-body h2,
.task-top span,
.purchase-row h3 {
  overflow-wrap: anywhere;
}
.step {
  cursor: pointer;
}
.toast {
  white-space: pre-wrap;
}
.mobile-shade.open {
  display: none;
}
.flag {
  font-size: 11px;
  color: var(--red);
}
.heading-actions {
  display: flex;
  gap: 8px;
}
.check-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin: 12px 0;
}
.blank {
  padding: 35px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}
#connection {
  margin-bottom: 15px;
}
.form-note {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.status-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.inline-link {
  color: var(--red);
}
.chat-entry input[readonly] {
  background: var(--paper);
}
.budget-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}
.budget-totals b {
  display: block;
  font-size: 17px;
  font-weight: 500;
}
.budget-totals span {
  font-size: 11px;
  color: var(--muted);
}
.page-heading {
  margin-bottom: 24px;
}
.page-heading p {
  margin: 8px 0;
}
.dialog-body {
  padding: 22px;
}
.pending-changes {
  font-size: 12px;
  padding: 10px;
  background: var(--paper);
  white-space: pre-wrap;
}
.crop {
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .mobile-shade.open {
    display: block;
    position: fixed;
    inset: 0;
    background: #24211c66;
    z-index: 11;
  }
  .details.open {
    z-index: 12;
  }
}
@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .intro .heading-actions {
    margin-top: 12px;
  }
  .intro .heading-actions button {
    font-size: 12px;
    padding: 7px 11px;
  }
  .topbar {
    padding: 12px 20px;
  }
  .top-actions {
    gap: 8px;
  }
  .topbar b {
    font-size: 11px;
  }
  .main {
    padding-top: 22px;
  }
  .auth-wrap {
    margin: 25px auto;
    padding: 24px;
  }
  .dialog form {
    padding-inline: 18px;
  }
  .dialog-header {
    padding: 15px 18px;
  }
  .chat-entry {
    position: sticky;
    bottom: 65px;
    background: var(--paper);
    padding: 10px 0;
  }
  .budget-totals b {
    font-size: 15px;
  }
  .expense .money {
    font-size: 16px;
  }
  .form-actions {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    padding-block: 12px;
  }
  .fact b {
    font-size: 13px;
  }
  .purchase-row > button {
    grid-column: 2;
  }
  .mobile-shade.open {
    display: block;
  }
}

.budget-progress {
  appearance: none;
  border: 0;
  display: block;
  width: 100%;
  height: 4px;
  background: var(--line);
}
.budget-progress::-webkit-progress-bar {
  background: var(--line);
}
.budget-progress::-webkit-progress-value {
  background: var(--red);
}
.budget-progress::-moz-progress-bar {
  background: var(--red);
}

.dependency-list {
  border: 1px solid var(--line);
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  min-width: 0;
}
.dependency-list legend {
  font-size: 12px;
  color: var(--muted);
}
.dependency-list input {
  accent-color: var(--red);
}
.dependency-list span {
  overflow-wrap: anywhere;
}
.danger {
  color: #913a32;
  border-color: #cfa99d;
}
.comparison {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  background: var(--white);
}
#editor-danger {
  margin-top: 15px;
}
#editor-conflict .form-actions {
  position: static;
}
details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--red);
  margin-block: 12px;
}
.auth-wrap {
  min-height: 380px;
}
button {
  min-height: 36px;
}
button:disabled {
  pointer-events: none;
}
@media (max-width: 1100px) {
  body.detail-open {
    overflow: hidden;
  }
}
@media (max-width: 760px) {
  .top-actions .sync {
    max-width: 105px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .task-top .tag {
    flex-shrink: 0;
  }
  .details.open {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .amount {
    overflow-wrap: anywhere;
  }
  .fact {
    min-width: 0;
  }
  .heading-actions {
    flex-wrap: wrap;
  }
}

/* 固定身份与头像菜单：保持原有纸色/朱红，不让图片失败影响操作。 */
input[readonly] {
  background: var(--paper, #f4f1eb);
  color: var(--muted);
  cursor: default;
}
.account-menu {
  position: relative;
  flex-shrink: 0;
}
.account-menu summary {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  list-style: none;
  border-radius: 24px;
  padding: 3px;
}
.account-menu summary::-webkit-details-marker {
  display: none;
}
.account-menu summary:focus-visible {
  outline: 2px solid var(--red, #9c453c);
  outline-offset: 3px;
}
.user-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #efe4d8;
  color: #884133;
  font-size: 15px;
  border: 1px solid var(--line);
  vertical-align: middle;
}
.user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-avatar img[hidden] {
  display: none;
}
.avatars .user-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.account-chevron {
  color: var(--muted);
  font-size: 14px;
}
.account-panel {
  position: absolute;
  z-index: 25;
  top: calc(100% + 10px);
  right: 0;
  width: 208px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px #29241d1a;
  border-radius: 10px;
  padding: 17px;
  display: grid;
  gap: 7px;
  color: var(--ink);
}
.account-panel strong {
  font-size: 15px;
  font-weight: 500;
}
.account-panel button {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0 0;
  text-align: left;
  color: #9c453c;
  font-size: 13px;
}
.profile-error {
  margin: 3px 0;
  line-height: 1.5;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 760px) {
  .top-actions {
    gap: 7px;
  }
  .top-actions .sync {
    max-width: 80px;
  }
  .user-avatar {
    width: 36px;
    height: 36px;
  }
}

.catalog-dialog {
  width: min(850px, calc(100vw - 32px));
  max-height: min(90dvh, 900px);
  padding: 0;
}
.catalog-body {
  padding: 22px 26px;
  overflow-y: auto;
  max-height: calc(88dvh - 76px);
}
.catalog-body > p:first-child {
  margin-top: 0;
}
.catalog-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.catalog-toolbar label {
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.catalog-toolbar select {
  padding: 9px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.catalog-list {
  border-top: 1px solid var(--line);
}
.catalog-row {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  cursor: pointer;
}
.catalog-row > input {
  flex: 0 0 auto;
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: #9c453c;
}
.catalog-row > span,
.catalog-row > div {
  min-width: 0;
}
.catalog-row strong {
  display: inline;
  font-size: 14px;
  font-weight: 500;
  margin-right: 7px;
  overflow-wrap: anywhere;
}
.catalog-row .tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
}
.catalog-description {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.7;
}
.catalog-existing {
  background: #eee8df55;
}
.catalog-existing input {
  opacity: 0.5;
}
.catalog-summary {
  padding: 12px 0;
  font-size: 13px;
}
.catalog-preview .catalog-row {
  cursor: default;
}
.catalog-preview p {
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 0;
}
.catalog-body .form-actions {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .catalog-body {
    padding: 17px;
  }
  .catalog-toolbar {
    align-items: stretch;
  }
  .catalog-toolbar button {
    flex: 1 1 130px;
  }
  .catalog-body .form-actions button {
    flex: 1 1 100px;
  }
}

/* Ten destinations stay visible on phones in two rows; no tiny scrolling strip. */
@media (max-width: 760px) {
  #mobile-nav {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;padding:4px 4px calc(4px + env(safe-area-inset-bottom));}
  #mobile-nav button {min-width:0;min-height:44px;padding:7px 2px;font-size:12px;text-align:center;}
  .main {padding-bottom:calc(130px + env(safe-area-inset-bottom));}
}

/* Page editors stay in normal flow above the fixed mobile navigation. */
.vendors-page .form-actions,.day-plan .form-actions,.invitation-workspace .form-actions {position:static;flex-wrap:wrap;}
