:root {
  --navy: #10253f;
  --navy2: #173552;
  --ink: #162233;
  --muted: #68778a;
  --line: #dfe5eb;
  --bg: #f3f6f8;
  --blue: #2775c9;
  --teal: #148b86;
  --green: #18865b;
  --amber: #b97618;
  --red: #bf4b52;
  --white: #fff;
  --shadow: 0 16px 44px rgba(17, 37, 62, 0.12);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hidden {
  display: none !important;
}
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.4px !important;
  font-weight: 700;
  color: #718398;
  margin: 0 0 7px;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #1a9990;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  margin: 18px 0;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #ccd5de;
  border-radius: 6px;
  background: #fff;
  padding: 12px 13px;
  outline: none;
  transition: 0.18s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 117, 201, 0.12);
}
textarea {
  resize: vertical;
  min-height: 92px;
}
.form-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}
.primary {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary:hover {
  background: #1c65ae;
}
.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wide {
  width: 100%;
  min-height: 46px;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: var(--navy);
  color: #d5e0eb;
  padding: 26px 15px 18px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 28px;
}
.side-brand div:last-child {
  display: grid;
}
.side-brand b {
  font-size: 18px;
  color: #fff;
}
.side-brand small {
  font-size: 11px;
  color: #8299af;
  margin-top: 3px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #aebfd0;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.nav-item:hover,
.nav-item.active {
  background: #1b3a58;
  color: #fff;
}
.nav-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: #9eb2c5;
}
.side-user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 10px 0;
  color: #d5e0eb;
  font-size: 12px;
  line-height: 1.65;
}
.side-note small { color: #91a6ba; }
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2e5775;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.side-user > div:nth-child(2) {
  display: grid;
  min-width: 0;
}
.side-user b {
  font-size: 13px;
  color: #fff;
}
.side-user small {
  font-size: 11px;
  color: #91a6ba;
}
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #506276;
}
.side-user .icon-btn {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #aebfd0;
}
.workspace {
  grid-column: 2;
  padding: 0 clamp(20px, 3vw, 48px) 60px;
  min-width: 0;
}
.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar h1 {
  font-size: 25px;
  margin: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.actor-picker {
  display: grid;
  grid-template-columns: auto minmax(190px, 240px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.actor-picker select { height: 40px; padding: 8px 30px 8px 10px; }
.actor-picker select.selected { border-color: #75aaa4; background: #f1f9f8; }
.sync {
  display: grid;
  grid-template-columns: 10px auto;
  column-gap: 7px;
  align-items: center;
  margin-right: 8px;
}
.sync i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.sync span {
  font-size: 12px;
  font-weight: 700;
}
.sync small {
  grid-column: 2;
  color: #8794a2;
  font-size: 10px;
}
.top-actions .primary svg {
  width: 17px;
}
.mobile-account {
  display: none;
}
.panel {
  background: #fff;
  border: 1px solid #e6ebef;
  border-radius: 8px;
}
.import-notice {
  margin: -8px 0 14px;
  padding: 11px 14px;
  border: 1px solid #eed9a7;
  border-radius: 6px;
  background: #fff8e8;
  color: #815b14;
  font-size: 12px;
  font-weight: 650;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.stat-card {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #e6ebef;
  border-radius: 8px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 112px;
}
.stat-card:hover { border-color: var(--teal); background: #f3faf9; }
.stat-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.transfer-owner { margin-left: 8px; }
.stat-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.stat-card strong {
  font-size: 32px;
  align-self: end;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #edf4fb;
  color: var(--blue);
}
.stat-card:nth-child(2) .stat-icon {
  background: #eaf6f1;
  color: var(--green);
}
.stat-card:nth-child(3) .stat-icon {
  background: #fff3e7;
  color: var(--amber);
}
.stat-card:nth-child(4) .stat-icon {
  background: #f1effb;
  color: #6654b6;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  gap: 14px;
}
.weekly-panel,
.activity-panel {
  padding: 24px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}
.panel-head h2,
.workflow-band h2 {
  font-size: 18px;
  margin: 0;
}
.date-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 9px;
  background: #edf3f7;
  color: #587084;
  font-size: 11px;
  font-weight: 700;
}
.week-meta { display: flex; align-items: center; gap: 8px; }
.node-count {
  white-space: nowrap;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}
.narrative {
  font-family: "Songti SC", STSong, serif;
  border-left: 3px solid var(--teal);
  padding: 1px 0 1px 18px;
  margin: 24px 0;
  line-height: 1.85;
  font-size: 15px;
  color: #344557;
}
.narrative p {
  margin: 0 0 10px;
}
.highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.source-note {
  margin: -8px 0 16px;
  color: #788898;
  font-size: 11px;
}
.weekly-timeline {
  position: relative;
  display: grid;
  gap: 0;
  padding-left: 18px;
  border-left: 1px solid #d7e2e8;
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 8px;
}
.weekly-node {
  position: relative;
  display: grid;
  grid-template-columns: 138px minmax(110px, .7fr) minmax(180px, 1.6fr);
  gap: 10px 14px;
  padding: 0 0 18px;
  cursor: pointer;
}
.weekly-node::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px #e5f4f2;
}
.weekly-node time { color: var(--teal); font-size: 11px; font-weight: 700; }
.weekly-node b { font-size: 12px; }
.weekly-node p { margin: 0; color: #526579; font-size: 12px; line-height: 1.5; }
.weekly-node small { grid-column: 2 / -1; color: #8b98a6; font-size: 10px; }
.highlight {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}
.highlight b {
  font-size: 13px;
}
.highlight p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 6px 0;
}
.highlight small {
  font-size: 10px;
  color: #8b98a6;
}
.text-btn {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 3px;
  font-size: 12px;
}
.activity-list {
  margin-top: 15px;
}
.activity {
  position: relative;
  padding: 4px 0 18px 20px;
  border-left: 1px solid #dbe3e9;
  margin-left: 5px;
}
.activity:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px #e5f4f2;
}
.activity b {
  font-size: 12px;
}
.activity p {
  font-size: 12px;
  color: #586a7d;
  line-height: 1.55;
  margin: 5px 0;
}
.activity small {
  font-size: 10px;
  color: #98a4b0;
}
.workflow-band {
  margin-top: 14px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  align-items: center;
}
.report-rhythm {
  margin-top: 14px;
  padding: 17px 22px;
  border: 1px solid #dce5eb;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.report-download { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.report-download svg { width: 16px; height: 16px; }
.report-purpose { margin: 7px 4px 0; color: #748496; font-size: 11px; line-height: 1.5; }
.report-rhythm h2 {
  margin: 0;
  font-size: 16px;
}
.rhythm-items {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #586a7d;
  font-size: 12px;
}
.rhythm-items span {
  white-space: nowrap;
}
.rhythm-items b {
  color: var(--teal);
  font-size: 13px;
}
.rhythm-items i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #aab8c4;
}
.workflow-band > div:first-child > p:last-child {
  font-size: 12px;
  color: #9cb0c3;
}
.workflow-band .eyebrow {
  color: #63bbb5;
}
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flow-diagram > div {
  display: grid;
  justify-items: center;
  text-align: center;
}
.flow-diagram svg {
  color: #63bbb5;
  margin-bottom: 7px;
}
.flow-diagram b {
  font-size: 12px;
}
.flow-diagram small {
  font-size: 10px;
  color: #91a6ba;
  margin-top: 4px;
}
.flow-diagram > i {
  font-style: normal;
  color: #547089;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
  gap: 10px;
  background: #fff;
  border: 1px solid #e3e9ee;
  padding: 12px;
  border-radius: 8px;
}
.search {
  position: relative;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 18px;
  color: #788898;
}
.search input {
  padding-left: 38px;
}
.toolbar select,
.toolbar input {
  height: 42px;
}
.todo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.todo-check input {
  width: 16px;
  height: 16px;
}
.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 19px 2px 10px;
  font-size: 12px;
}
.list-meta p {
  margin: 0;
}
.records-list {
  background: #fff;
  border: 1px solid #e2e8ed;
  border-radius: 8px;
  overflow: hidden;
}
.record-head,
.record-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 100px 120px minmax(190px, 1.6fr) 110px 36px;
  gap: 14px;
  align-items: center;
}
.record-head {
  padding: 12px 18px;
  background: #f8fafb;
  color: #748496;
  font-size: 11px;
  font-weight: 700;
}
.record-row {
  padding: 16px 18px;
  border-top: 1px solid #edf0f3;
  cursor: pointer;
  transition: 0.15s;
}
.record-row:hover {
  background: #f8fbfd;
}
.record-customer {
  min-width: 0;
}
.record-customer b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-customer small,
.record-next small {
  font-size: 10px;
  color: #8795a4;
}
.record-owner,
.record-next {
  font-size: 12px;
}
.record-next {
  min-width: 0;
}
.record-next span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-summary {
  font-size: 12px;
  color: #5e6e7e;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.status-pill.pending {
  background: #fff3dc;
  color: #9c6411;
}
.stale-badge {
  margin-left: 5px;
  padding-left: 5px;
  border-left: 1px solid currentColor;
  font-style: normal;
  font-size: 9px;
}
.status-pill.won,
.status-pill.resolved {
  background: #e8f5ee;
  color: #14734c;
}
.status-pill.lost {
  background: #faeaea;
  color: #a53f46;
}
.status-pill.processing {
  background: #e8f1fb;
  color: #2868a5;
}
.empty {
  text-align: center;
  padding: 70px;
  color: #82909f;
}
.empty svg {
  width: 34px;
  height: 34px;
}
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 22, 36, 0.46);
  z-index: 30;
}
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(620px, 100%);
  background: #fff;
  z-index: 31;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 0.24s ease;
  overflow: auto;
}
.drawer.open {
  transform: none;
}
.drawer-head {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 22px 25px 16px;
  z-index: 3;
}
.drawer-title-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.drawer-head h2 {
  font-size: 22px;
  margin: 8px 0 5px;
}
.drawer-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.drawer-body {
  padding: 22px 25px 110px;
}
.section-title {
  font-size: 13px;
  margin: 25px 0 10px;
  display: flex;
  justify-content: space-between;
}
.summary-box {
  padding: 14px;
  background: #f5f8fa;
  border-radius: 6px;
  line-height: 1.7;
  font-size: 13px;
}
.record-dates {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 7px 10px;
  margin: 12px 0 0;
  padding: 12px 14px;
  background: #fbfcfd;
  border: 1px solid #e5eaee;
  border-radius: 6px;
  font-size: 11px;
}
.record-dates dt { color: #7b8998; }
.record-dates dd { margin: 0; font-weight: 650; }
.reminder-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-left: 3px solid var(--amber);
  background: #fff7e8;
  color: #8a5d17;
  font-size: 11px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-grid label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  margin: 9px 0;
}
.evidence-list {
  display: grid;
  gap: 8px;
}
.evidence {
  padding: 11px 13px;
  border-left: 3px solid #8da3b8;
  background: #f7f9fb;
  font-size: 12px;
}
.evidence span {
  color: #607387;
}
.timeline {
  border-left: 1px solid #d9e1e8;
  margin-left: 6px;
}
.timeline-item {
  position: relative;
  padding: 0 0 17px 18px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8aa1b4;
}
.timeline-item p {
  font-size: 12px;
  line-height: 1.6;
  margin: 3px 0;
}
.timeline-item small {
  color: #8b98a5;
  font-size: 10px;
}
.comment-row {
  display: flex;
  gap: 8px;
}
.comment-row textarea {
  min-height: 60px;
}
.comment-row button {
  align-self: stretch;
}
.drawer-actions {
  position: fixed;
  bottom: 0;
  right: 0;
  width: min(620px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  padding: 14px 25px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.secondary {
  border: 1px solid #cfd8e1;
  background: #fff;
  border-radius: 6px;
  padding: 10px 15px;
  font-weight: 650;
}
.danger-note,
.conflict {
  padding: 11px 13px;
  border-radius: 6px;
  background: #fff1f0;
  color: #9f3e44;
  font-size: 12px;
  line-height: 1.6;
}
.conflict {
  margin-bottom: 12px;
}
.modal {
  position: fixed;
  z-index: 41;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, calc(100% - 30px));
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 {
  font-size: 19px;
  margin: 0;
}
.modal form {
  margin-top: 18px;
}
.modal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #152b42;
  color: #fff;
  padding: 11px 16px;
  border-radius: 6px;
  z-index: 60;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.bottom-nav {
  display: none;
}
.skeleton {
  min-height: 130px;
}
@media (max-width: 1050px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .activity-panel {
    display: block;
  }
  .workflow-band {
    grid-template-columns: 1fr;
  }
  .report-rhythm {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .rhythm-items {
    width: 100%;
    justify-content: space-between;
    gap: 7px;
  }
  .toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .search {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  html,
  body {
    padding-bottom: 70px;
    overflow-x: hidden;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .workspace {
    padding: 0 14px 24px;
  }
  .topbar {
    min-height: 90px;
  }
  .topbar .eyebrow {
    display: none;
  }
  .topbar h1 {
    font-size: 21px;
  }
  .sync {
    display: none;
  }
  .top-actions > .icon-btn {
    display: none;
  }
  .actor-picker {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 73px;
    z-index: 18;
    grid-template-columns: 48px 1fr;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 5px 18px rgba(17, 37, 62, .08);
  }
  .workspace { padding-top: 54px; }
  .top-actions > .mobile-account {
    display: grid;
  }
  .top-actions .primary {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0;
  }
  .top-actions .primary svg {
    width: 19px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .stat-card {
    min-height: 96px;
    padding: 14px;
  }
  .stat-card strong {
    font-size: 27px;
  }
  .weekly-panel {
    padding: 18px;
  }
  .panel-head {
    align-items: center;
  }
  .panel-head h2 {
    font-size: 16px;
  }
  .date-chip {
    font-size: 9px;
  }
  .narrative {
    padding-left: 13px;
    font-size: 14px;
  }
  .highlights {
    grid-template-columns: 1fr;
  }
  .weekly-node { grid-template-columns: 1fr; gap: 4px; }
  .weekly-node small { grid-column: auto; }
  .weekly-timeline { max-height: 440px; }
  .week-meta { align-items: flex-end; flex-direction: column; gap: 4px; }
  .rhythm-items {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: initial;
    gap: 8px;
  }
  .rhythm-items span { white-space: normal; line-height: 1.5; }
  .rhythm-items i { display: none; }
  .report-download { width: 100%; justify-content: center; }
  .workflow-band {
    padding: 19px;
    gap: 14px;
  }
  .flow-diagram {
    overflow: auto;
    justify-content: flex-start;
    gap: 12px;
    padding-bottom: 5px;
  }
  .flow-diagram > div {
    min-width: 85px;
  }
  .toolbar {
    grid-template-columns: 1fr 1fr;
    padding: 9px;
  }
  .search {
    grid-column: 1/-1;
  }
  .todo-check {
    height: 40px;
  }
  .record-head {
    display: none;
  }
  .records-list {
    background: transparent;
    border: 0;
    display: grid;
    gap: 9px;
  }
  .record-row {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .record-summary {
    grid-column: 1/-1;
  }
  .record-owner {
    grid-row: 1;
    grid-column: 2;
    text-align: right;
  }
  .record-next {
    grid-column: 1/-1;
    border-top: 1px solid #edf0f3;
    padding-top: 10px;
  }
  .record-row > svg {
    position: absolute;
    right: 12px;
  }
  .bottom-nav {
    position: fixed;
    display: flex;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--line);
    z-index: 20;
    justify-content: space-around;
  }
  .bottom-nav button {
    border: 0;
    background: none;
    color: #778898;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-width: 60px;
    font-size: 10px;
  }
  .bottom-nav button.active {
    color: var(--blue);
  }
  .bottom-nav svg {
    width: 19px;
  }
  .drawer-head {
    padding: 18px 17px 14px;
  }
  .drawer-body {
    padding: 17px 17px 120px;
  }
  .drawer-actions {
    padding: 12px 17px calc(12px + env(safe-area-inset-bottom));
  }
  .drawer-actions button {
    flex: 1;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .record-dates { grid-template-columns: auto 1fr; }
  .form-grid .full {
    grid-column: auto;
  }
  .comment-row {
    display: grid;
  }
  .modal {
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 400px) {
  .toolbar {
    grid-template-columns: 1fr;
  }
  .search {
    grid-column: auto;
  }
  .workflow-band {
    display: none;
  }
}

/* Complete, scrollable customer activity and maintenance-safe forms. */
.activity-panel { align-self: start; }
#activityList { max-height: 1000px; overflow-y: auto; padding-right: 8px; }
.activity-customer { display: block; padding: 0; border: 0; background: transparent; color: #176c86; font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.activity .activity-meta { display: block; margin: 6px 0; color: #62768a; font-size: 11px; }
.activity .activity-content { font-size: 13px; line-height: 1.7; color: #2e455e; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity .activity-next { padding: 8px 10px; background: #f0f7f7; border-radius: 6px; color: #36665e; white-space: pre-wrap; }
.activity .activity-change { color: #735624; }
.activity .status-pill { font-size: 11px; padding: 3px 7px; }
.activity-all { max-height: 62vh; overflow: auto; padding-right: 8px; }
.draft-note { color: #536e7a; background: #eef6f8; padding: 10px; font-size: 12px; border-radius: 6px; }
.rename-customer { margin-bottom: 10px; }
@media(max-width:700px) { #activityList { max-height: 700px; } }
