:root {
  color-scheme: light;
  --bg: #eef7f9;
  --surface: #ffffff;
  --surface-2: #e7f2f1;
  --ink: #243133;
  --muted: #617174;
  --line: #d5e3e5;
  --line-strong: #b7cdd1;
  --accent: #e45f5f;
  --accent-2: #188a83;
  --accent-3: #4a6fae;
  --accent-4: #d18a2f;
  --danger: #c74457;
  --shadow: 0 18px 46px rgba(35, 74, 80, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eaf6f8 0%, #f9fcfb 46%, #f2f7f6 100%),
    linear-gradient(135deg, rgba(228, 95, 95, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 26px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.topbar-actions,
.month-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

#importFile {
  display: none;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.import-label {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  user-select: none;
}

.primary-btn {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.ghost-btn,
.import-label {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line-strong);
}

.ghost-btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.danger-btn {
  color: var(--danger);
  border-color: rgba(199, 68, 87, 0.32);
  background: rgba(199, 68, 87, 0.07);
}

.danger-btn.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.icon-btn {
  width: 40px;
  padding: 0;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
  font-size: 22px;
  line-height: 1;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.summary-strip article {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-strip span {
  display: block;
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.summary-strip p {
  margin: 8px 0 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.topic-panel,
.calendar-panel,
.pipeline-section,
.account-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topic-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.panel-heading,
.calendar-toolbar,
.pipeline-heading,
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 14px;
}

.topic-catalog {
  margin: 0 0 14px;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(232, 242, 241, 0.28);
}

.catalog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.catalog-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-btn {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(97, 113, 116, 0.82);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.text-btn:hover,
.text-btn:focus-visible,
.text-btn.is-active {
  border-color: rgba(24, 138, 131, 0.24);
  background: rgba(24, 138, 131, 0.08);
  color: var(--accent-2);
}

.topic-catalog-list {
  display: grid;
  gap: 7px;
}

.catalog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(35, 74, 80, 0.06);
}

.catalog-item.is-managing {
  grid-template-columns: minmax(0, 1fr) auto;
}

.catalog-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.catalog-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.catalog-main small,
.catalog-empty {
  color: var(--muted);
  font-size: 12px;
}

.catalog-delete-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(228, 95, 95, 0.78);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.catalog-delete-btn:hover,
.catalog-delete-btn:focus-visible {
  border-color: rgba(228, 95, 95, 0.28);
  background: rgba(228, 95, 95, 0.08);
  color: var(--accent);
}

.delete-popover {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(199, 68, 87, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(35, 74, 80, 0.18);
}

.delete-popover[hidden] {
  display: none;
}

.delete-popover strong {
  font-size: 14px;
}

.delete-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.delete-popover div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(24, 138, 131, 0.16);
}

.drop-zone {
  min-height: 280px;
  border: 1px dashed transparent;
  border-radius: 8px;
}

.pool-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pool-title small {
  color: rgba(97, 113, 116, 0.7);
  font-weight: 750;
}

.drop-zone.drag-over,
.day.drag-over {
  border-color: var(--accent-2);
  background: rgba(24, 138, 131, 0.08);
}

.topic-list {
  display: grid;
  gap: 10px;
}

.topic-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(35, 74, 80, 0.09);
}

.topic-card[draggable="true"],
.scheduled-item[draggable="true"],
.reminder-item[draggable="true"] {
  cursor: grab;
}

.topic-card.dragging,
.scheduled-item.dragging,
.reminder-item.dragging {
  opacity: 0.55;
}

.topic-card-head {
  display: flex;
  gap: 9px;
  align-items: stretch;
}

.drag-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  color: rgba(97, 113, 116, 0.52);
  font-weight: 900;
  writing-mode: vertical-rl;
}

.topic-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 5px;
}

.topic-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.topic-title-row strong {
  line-height: 1.28;
  word-break: break-word;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 26px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(228, 95, 95, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.topic-subline {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-card-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fcfb;
  color: var(--muted);
  font-weight: 900;
}

.meta-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip,
.status-pill,
.priority-pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid rgba(183, 205, 209, 0.68);
}

.status-pill {
  color: var(--ink);
}

.status-pill.blocked {
  color: var(--danger);
  background: rgba(199, 68, 87, 0.08);
}

.status-pill.done {
  color: var(--accent-2);
  background: rgba(24, 138, 131, 0.1);
}

.priority-pill.high {
  color: var(--danger);
}

.priority-pill.medium {
  color: var(--accent-4);
}

.priority-pill.low {
  color: var(--accent-2);
}

.topic-card-reason {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  line-height: 1.5;
}

.next-reminder {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1px dashed rgba(228, 95, 95, 0.36);
  border-radius: 8px;
  background: rgba(228, 95, 95, 0.06);
}

.next-reminder span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.next-reminder strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.calendar-panel {
  min-width: 0;
  padding: 18px;
  overflow: hidden;
}

.calendar-toolbar {
  margin-bottom: 14px;
}

#monthTitle {
  min-width: 190px;
  text-align: center;
  font-size: 18px;
}

.timeline-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.timeline-tools input {
  width: min(260px, 42vw);
  accent-color: var(--accent-2);
  padding: 0;
}

.timeline-tools strong {
  min-width: 38px;
  color: var(--accent-2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.legend-item {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.72);
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) rgba(232, 242, 241, 0.8);
}

.timeline-board {
  --day-width: 116px;
  --timeline-days: 92;
  min-width: 100%;
  width: max(100%, calc(var(--timeline-days) * var(--day-width)));
}

.timeline-month-row,
.timeline-week-row,
.timeline-weekday-row,
.timeline-day-row {
  display: grid;
  grid-template-columns: repeat(var(--timeline-days), var(--day-width));
}

.timeline-month-row,
.timeline-week-row,
.timeline-weekday-row {
  position: sticky;
  z-index: 3;
}

.timeline-month-row {
  top: 0;
}

.timeline-weekday-row {
  top: 82px;
}

.timeline-week-row {
  top: 39px;
}

.weekday,
.day {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weekday {
  background: var(--surface-2);
  min-height: 46px;
  padding: 8px 9px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.weekday span,
.weekday strong {
  display: block;
}

.weekday strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}

.weekday.today-heading {
  background: rgba(228, 95, 95, 0.1);
}

.timeline-month {
  min-height: 39px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f5fbfb, #e8f5f4);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
}

.timeline-week {
  min-height: 43px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline-week strong,
.timeline-week span {
  display: block;
}

.timeline-week strong {
  color: var(--ink);
  font-size: 13px;
}

.timeline-week span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.day {
  min-height: clamp(360px, 48vh, 520px);
  padding: 9px;
  background:
    linear-gradient(to bottom, rgba(183, 205, 209, 0.13) 1px, transparent 1px) 0 78px / 100% 86px,
    rgba(255, 255, 255, 0.74);
}

.timeline-day {
  min-width: var(--day-width);
}

.day.other-month {
  background: rgba(232, 242, 241, 0.48);
  color: rgba(36, 49, 51, 0.42);
}

.day.today {
  outline: 2px solid rgba(228, 95, 95, 0.42);
  outline-offset: -2px;
}

.month-tone-0.week-tone-0 {
  background-color: rgba(232, 245, 244, 0.74);
}

.month-tone-0.week-tone-1 {
  background-color: rgba(244, 251, 250, 0.88);
}

.month-tone-1.week-tone-0 {
  background-color: rgba(237, 243, 255, 0.78);
}

.month-tone-1.week-tone-1 {
  background-color: rgba(248, 250, 255, 0.9);
}

.month-tone-2.week-tone-0 {
  background-color: rgba(255, 244, 238, 0.78);
}

.month-tone-2.week-tone-1 {
  background-color: rgba(255, 250, 247, 0.9);
}

.month-tone-3.week-tone-0 {
  background-color: rgba(244, 240, 255, 0.78);
}

.month-tone-3.week-tone-1 {
  background-color: rgba(250, 248, 255, 0.9);
}

.timeline-day.week-start,
.weekday.week-start {
  border-left: 2px solid rgba(36, 49, 51, 0.16);
}

.timeline-day.month-start,
.weekday.month-start {
  border-left: 3px solid rgba(24, 138, 131, 0.5);
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  font-size: 13px;
  font-weight: 800;
}

.date-line small {
  color: var(--accent);
}

.quick-add-day {
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: 1px solid rgba(183, 205, 209, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-2);
  font-weight: 900;
  opacity: 0.62;
}

.timeline-day:hover .quick-add-day,
.quick-add-day:focus-visible {
  opacity: 1;
  border-color: var(--accent-2);
}

.empty-day-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 14px;
  padding: 0 10px;
  border: 1px dashed rgba(97, 113, 116, 0.22);
  border-radius: 8px;
  color: rgba(97, 113, 116, 0.62);
  background: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.empty-day-note:hover {
  border-color: rgba(24, 138, 131, 0.42);
  color: var(--accent-2);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.check-row input {
  width: auto;
}

.check-row span {
  margin: 0;
}

.quick-task-form [hidden] {
  display: none;
}

.scheduled-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.scheduled-item {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-left: 4px solid var(--accent-3);
  cursor: grab;
  overflow: hidden;
}

.scheduled-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.24;
  word-break: break-word;
}

.scheduled-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.doc-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.doc-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(24, 138, 131, 0.24);
  border-radius: 8px;
  background: rgba(24, 138, 131, 0.08);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.doc-link-btn:hover,
.doc-link-btn:focus-visible {
  border-color: rgba(24, 138, 131, 0.52);
  background: rgba(24, 138, 131, 0.14);
}

.scheduled-item .doc-link-btn,
.reminder-item .doc-link-btn {
  margin-top: 7px;
}

.account-panel {
  padding: 18px;
}

.account-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.account-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-card {
  display: grid;
  gap: 12px;
  min-height: 172px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
}

.account-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.account-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
}

.account-card strong,
.account-card small {
  display: block;
}

.account-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.account-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: auto;
}

.reminder-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.reminder-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px dashed rgba(228, 95, 95, 0.34);
  border-radius: 8px;
  background: rgba(228, 95, 95, 0.06);
  color: var(--ink);
  text-align: left;
}

.reminder-item span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.reminder-item strong {
  font-size: 12px;
  line-height: 1.25;
}

.reminder-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-item.done {
  border-color: rgba(24, 138, 131, 0.26);
  background: rgba(24, 138, 131, 0.06);
}

.reminder-item.done span {
  color: var(--accent-2);
}

.pipeline-section {
  margin-top: 16px;
  padding: 18px;
}

.pipeline-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.pipeline-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.pipeline-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-meta label span {
  margin: 0;
}

.pipeline-meta select {
  width: auto;
  min-width: 116px;
  min-height: 34px;
  padding: 0 34px 0 10px;
  font-size: 13px;
}

.pipeline-heading p {
  margin: 0;
  color: var(--muted);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(156px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
}

.stage-column {
  min-height: 160px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 242, 241, 0.55);
}

.stage-column h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.stage-stack {
  display: grid;
  gap: 8px;
}

.mini-card {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-card-main {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mini-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.25;
}

.mini-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mini-card .doc-link-btn {
  min-height: 24px;
  font-size: 11px;
}

dialog {
  width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(36, 49, 51, 0.32);
}

.topic-form {
  padding: 22px;
}

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

.full {
  display: block;
  margin: 16px 0 0;
}

fieldset {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.value-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
}

.value-grid input {
  width: auto;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.trash-dialog-body {
  display: grid;
  gap: 14px;
}

.trash-list {
  display: grid;
  gap: 8px;
  max-height: min(420px, 58vh);
  overflow: auto;
}

.trash-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.trash-item strong,
.trash-item small {
  display: block;
}

.trash-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.trash-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

body.team-mode .host-only,
body.team-mode .host-field {
  display: none;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .topbar,
  .workspace {
    display: block;
  }

  .topbar-actions {
    justify-content: flex-start;
    margin-top: 20px;
  }

  .topic-panel {
    position: static;
    max-height: none;
    margin-bottom: 16px;
  }

  .calendar-grid {
    max-height: 74vh;
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 1480px);
    padding-top: 10px;
  }

  .summary-strip,
  .filters,
  .form-grid,
  .value-grid {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar,
  .pipeline-heading,
  .panel-heading,
  .account-heading {
    display: block;
  }

  .month-controls {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .timeline-tools {
    flex-wrap: wrap;
  }

  #monthTitle {
    min-width: 150px;
    text-align: left;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}
