* {
  box-sizing: border-box;
}
:root {
  --bg: #f5f6f8;
  --paper: #fff;
  --ink: #202938;
  --muted: #7b8390;
  --line: #e8ebee;
  --blue: #4262df;
  --blue-soft: #edf1ff;
  --nav: #182336;
  --green: #278d73;
  --red: #b74646;
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
body {
  margin: 0;
  background: var(--bg);
  font: 14px/1.65 var(--font);
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button,
a,
input,
textarea,
select {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #93a7ff;
}
input,
textarea,
select {
  border: 1px solid #dce1e8;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.2s;
}
input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: #7890ee;
  box-shadow: 0 0 0 3px #edf1ff;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.85;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.7px;
  line-height: 1.5;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
}
small {
  font-size: 12px;
}
a {
  color: var(--blue);
  text-decoration: none;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: var(--nav);
  color: #acb7c9;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  padding: 34px 18px 22px;
  z-index: 20;
}
/* The menu scrolls on its own so every entry stays reachable on short
   windows (1366 × 768 laptops, or a resized app window). */
.nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  scrollbar-width: thin;
  scrollbar-color: #33435f transparent;
}
.nav-label-gap {
  margin-top: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px 38px;
  color: white;
}
.brand-mark {
  background: #7f9bff;
  color: #15244c;
  border-radius: 11px;
  width: 37px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 23px;
  font-weight: 800;
}
.brand strong {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 3px;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: #8392ac;
  line-height: 1.2;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #64738c;
  margin: 8px 15px 10px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: none;
  color: inherit;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  margin: 3px 0;
  font-weight: 500;
}
.nav:hover {
  color: #fff;
  background: #23324b;
}
.nav.active {
  background: #344c8a;
  color: #fff;
}
.nav.active svg {
  color: #acc1ff;
}
.nav .count {
  margin-left: auto;
  font-size: 11px;
  background: #344056;
  padding: 0 6px;
  border-radius: 4px;
}
.sidebar-footer {
  flex: 0 0 auto;
  padding: 16px 12px 0;
}
.dot.off {
  background: #e0a35c;
}
.local-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #b3c5df;
  font-size: 12px;
}
.dot {
  width: 6px;
  height: 6px;
  background: #64d7ac;
  border-radius: 50%;
  display: inline-block;
}
.sidebar-footer p {
  font-size: 10px;
  color: #71829b;
  margin-top: 6px;
}
.main {
  margin-left: 220px;
  width: calc(100% - 220px);
}
.topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  color: #8a909b;
  font-size: 12px;
}
.crumb b {
  font-weight: 500;
  color: #3e4758;
  margin-left: 9px;
}
.top-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #f1ede6;
  color: #8a6e46;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.content {
  max-width: 1510px;
  margin: auto;
  padding: 30px 38px 50px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  gap: 16px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #8a94a5;
  margin-bottom: 5px;
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}
.date-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 9px 14px;
  border-radius: 8px;
  color: #5a6576;
  font-size: 12px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.metric {
  padding: 20px 23px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric .value {
  font-size: 28px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.metric .value small {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: #9299a5;
  margin-left: 6px;
}
.metric .caption {
  color: #8c95a3;
  font-size: 11px;
  margin-top: 4px;
}
.metric .icon-box {
  padding: 10px;
  background: var(--blue-soft);
  color: #6a81d8;
  border-radius: 10px;
}
.metric:nth-child(2) .icon-box {
  background: #edf7f1;
  color: #5ca88b;
}
.metric:nth-child(3) .icon-box {
  background: #fff5e8;
  color: #c7a26a;
}
.workflow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 22px;
  font-size: 12px;
  color: #9aa2af;
}
.workflow .step {
  display: flex;
  gap: 7px;
  align-items: center;
}
.step i {
  font-style: normal;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8ebf2;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.step.on {
  color: var(--blue);
}
.step.on i {
  background: #e6ecff;
}
.workflow .rule {
  width: 42px;
  border-top: 1px solid #dce1eb;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 23px;
  align-items: start;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 21px 24px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.panel-head h2 {
  font-size: 16px;
}
.panel-body {
  padding: 22px 24px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: #f4f6fa;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.tab {
  background: none;
  color: #7c8698;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 6px;
  flex: 1;
}
.tab.selected {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px #1d2b4a12;
  font-weight: 600;
}
.raw-input {
  min-height: 300px;
  border-color: #e2e6ef;
  background: #fcfdff;
  padding: 17px;
  font-size: 14px;
}
.raw-input::placeholder {
  color: #a8afbb;
}
.input-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9aa3b0;
  font-size: 11px;
  margin-top: 10px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.row label {
  margin-top: 0;
}
.spacer {
  height: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  background: #fff;
  border: 1px solid #dce2ec;
  border-radius: 8px;
  color: #5c687a;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
.btn:hover {
  background: #f6f8fc;
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 3px 7px #4262df20;
}
.btn.primary:hover {
  background: #3656ce;
}
.btn.dark {
  background: #283d64;
  color: white;
  border-color: #283d64;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.btn.danger {
  color: var(--red);
  border-color: #f0d8d8;
}
.btn.small {
  padding: 5px 10px;
  font-size: 11px;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.full {
  width: 100%;
}
.tip {
  display: flex;
  gap: 10px;
  background: #f4f7fc;
  border-radius: 8px;
  padding: 13px 14px;
  margin-top: 17px;
  color: #8b95a6;
  font-size: 11px;
}
.tip svg {
  width: 16px;
  height: 16px;
  color: #8d9bb3;
  margin-top: 2px;
}
.pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #f1f3f7;
  color: #8190a4;
  display: inline-block;
}
.pill.blue {
  background: #edf2ff;
  color: #617bce;
}
.pill.green {
  background: #eaf7ef;
  color: #439375;
}
.pill.amber {
  background: #fff6e5;
  color: #aa8440;
}
.preview-empty {
  min-height: 405px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 30px;
  color: #a1aabb;
}
.preview-empty .outline-icon {
  width: 69px;
  height: 69px;
  border-radius: 20px;
  background: #f5f7fc;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #b2bfd5;
}
.preview-empty .outline-icon svg {
  width: 30px;
  height: 30px;
}
.preview-empty h3 {
  color: #8591a3;
  font-weight: 500;
}
.preview-empty p {
  font-size: 12px;
  max-width: 270px;
  margin-top: 7px;
}
.panel-foot {
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fdfdfe;
}
.field-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  border-color: transparent;
  padding-left: 0;
}
.preview-field {
  border-color: #edf0f4;
  font-size: 13px;
  min-height: 75px;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #60718b;
  margin-top: 17px;
  margin-bottom: 7px;
}
.section-label:before {
  content: "";
  width: 3px;
  height: 12px;
  background: #88a0df;
  border-radius: 2px;
}
.hint {
  font-size: 11px;
  color: #8c96a5;
}
.hint.warning {
  color: #ad7a29;
  background: #fff8e8;
  border-radius: 6px;
  padding: 9px 12px;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.chip {
  background: #f3f5f9;
  border: 1px solid #e3e8f0;
  color: #718098;
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 6px;
}
.chip.checked {
  background: #edf2ff;
  border-color: #b9c8f5;
  color: #4e6bcc;
}
.bottom-note {
  font-size: 11px;
  color: #a5acb7;
  text-align: center;
  margin-top: 25px;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: #9ba5b4;
}
.empty h3 {
  color: #687990;
  font-weight: 500;
  margin-bottom: 8px;
}
.empty p {
  font-size: 12px;
  margin-bottom: 16px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.log-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  cursor: pointer;
}
.log-card:hover {
  border-color: #b5c5ee;
  box-shadow: 0 3px 12px #26385c08;
}
.log-card h3 {
  margin: 6px 0 5px;
}
.log-card p {
  color: #8993a2;
  font-size: 12px;
  max-height: 42px;
  overflow: hidden;
}
.log-card .meta {
  font-size: 10px;
  color: #a2aab7;
  display: flex;
  gap: 12px;
}
.history-layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  gap: 23px;
}
.calendar {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-self: start;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
  text-align: center;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 7px;
  background: #fff;
  color: #7a8493;
  font-size: 11px;
  padding: 3px;
}
.cal-day.has {
  background: #eef3ff;
  color: #506bc1;
}
.cal-day.current {
  outline: 1px solid #657ee0;
}
.cal-day.selected {
  background: var(--blue);
  color: white;
}
.cal-day.has:after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  bottom: 3px;
  left: calc(50% - 1.5px);
}
.weekday {
  color: #a5aebb;
  font-size: 10px;
  padding: 5px 0;
}
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.filters input {
  flex: 1;
}
.filters select {
  width: 130px;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.goal-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.progress {
  height: 6px;
  border-radius: 6px;
  background: #edf1f7;
  overflow: hidden;
  margin: 20px 0 9px;
}
.progress div {
  height: 100%;
  background: #7992e3;
  border-radius: 6px;
}
.goal-values {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8d99ac;
}
.goal-card h3 {
  margin: 12px 0 5px;
}
.goal-card .actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
}
.chat-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
}
.chat-side {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-self: start;
}
.conversation {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 10px;
  margin-top: 6px;
  border-radius: 7px;
  background: #f8f9fc;
  font-size: 12px;
  color: #718098;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation.active {
  color: var(--blue);
  background: var(--blue-soft);
}
.messages {
  height: 480px;
  overflow: auto;
  padding: 24px;
  background: #fcfdff;
}
.message {
  margin-bottom: 20px;
  max-width: 88%;
  font-size: 13px;
  white-space: pre-wrap;
}
.message.user {
  margin-left: auto;
  background: #edf2ff;
  color: #445d9a;
  padding: 13px 16px;
  border-radius: 12px 12px 2px 12px;
}
.message.assistant {
  color: #667184;
  line-height: 1.95;
}
.message .sender {
  display: block;
  color: #a2abba;
  font-size: 10px;
  margin-bottom: 4px;
}
.chat-compose {
  padding: 20px;
  border-top: 1px solid var(--line);
}
.chat-compose textarea {
  min-height: 80px;
  margin-bottom: 10px;
}
.month-grid {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 22px;
}
.report-paper {
  padding: 34px 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.report-paper h1 {
  font-size: 24px;
}
.report-section {
  padding-top: 24px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.report-section h3 {
  color: #597098;
  margin-bottom: 12px;
}
.report-item {
  margin-bottom: 14px;
  font-size: 13px;
  color: #68768a;
}
.evidence {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.evidence button {
  font-size: 10px;
  color: #7a8aa8;
  background: #f2f5fa;
  border-radius: 4px;
  padding: 2px 6px;
}
.report-edit {
  width: 100%;
  border: 1px solid #edf0f6;
  font-size: 13px;
  min-height: 72px;
}
.snapshot {
  background: #f8f9fc;
  border-radius: 8px;
  padding: 16px;
}
.snapshot .row {
  margin-bottom: 8px;
}
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.file-drop {
  border: 1px dashed #cbd6e8;
  border-radius: 9px;
  background: #fafcff;
  padding: 26px 18px;
  text-align: center;
}
.file-drop input {
  margin-top: 12px;
  font-size: 12px;
  background: white;
}
.notice {
  padding: 15px 18px;
  border-radius: 8px;
  background: #eff4ff;
  color: #7182a6;
  font-size: 12px;
  margin-bottom: 20px;
}
.danger-notice {
  background: #fff4f1;
  color: #a56451;
}
.mapping {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.mapping label {
  margin: 0;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 500;
  background: #f7f9fc;
  color: #8694a8;
}
td {
  color: #647187;
}
.chart {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 180px;
  padding: 22px 5px 30px;
}
.bar {
  flex: 1;
  min-height: 3px;
  background: #93a8eb;
  border-radius: 3px 3px 0 0;
  position: relative;
}
.bar span {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #9aa7bc;
  margin-top: 6px;
}
.settings-layout {
  max-width: 800px;
}
.online-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
  max-width: 1120px;
}
@media (max-width: 1050px) {
  .online-layout {
    grid-template-columns: 1fr;
  }
}
.settings-layout .panel {
  margin-bottom: 22px;
}
.boot {
  display: grid;
  place-content: center;
  min-height: 100vh;
  font-size: 34px;
  letter-spacing: 5px;
  color: #5c74cc;
}
.boot span {
  font-size: 13px;
  letter-spacing: 0;
  color: #8592ac;
  margin-top: 14px;
}
dialog {
  border: 1px solid #e2e8f2;
  box-shadow: 0 25px 80px #18233630;
  border-radius: 14px;
  padding: 0;
  width: min(760px, calc(100vw - 40px));
  max-height: 88vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #14223b66;
  backdrop-filter: blur(2px);
}
.modal-head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.modal-body {
  padding: 23px 26px;
  max-height: 65vh;
  overflow: auto;
}
.modal-foot {
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: white;
}
.close {
  background: none;
  color: #93a1b6;
  font-size: 21px;
  padding: 0 5px;
}
.version-card {
  padding: 15px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  margin-bottom: 12px;
}
.version-card pre {
  font-family: var(--font);
  font-size: 11px;
  white-space: pre-wrap;
  color: #8995a7;
  max-height: 130px;
  overflow: auto;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.compare pre {
  font: 12px/1.9 var(--font);
  white-space: pre-wrap;
  background: #f8f9fc;
  border-radius: 8px;
  padding: 16px;
  max-height: 420px;
  overflow: auto;
}
.busy {
  position: fixed;
  bottom: 22px;
  right: 26px;
  width: 440px;
  background: #fff;
  box-shadow: 0 12px 50px #1c30532a;
  border: 1px solid #d9e3f5;
  border-radius: 12px;
  z-index: 80;
  padding: 18px 20px;
}
.busy .busy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.busy .spinner {
  border: 2px solid #e4ebfc;
  border-top-color: var(--blue);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.busy pre {
  font: 11px/1.8 var(--font);
  max-height: 130px;
  overflow: auto;
  white-space: pre-wrap;
  color: #8896ad;
  margin: 12px 0 0;
}
.busy small {
  color: #9aa6b8;
}
#toast {
  position: fixed;
  left: calc(50% + 80px);
  bottom: 30px;
  transform: translateX(-50%);
  background: #20304b;
  color: #fff;
  padding: 11px 22px;
  border-radius: 8px;
  box-shadow: 0 6px 20px #25374f30;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 0.2s;
  font-size: 12px;
  max-width: 70vw;
}
#toast.show {
  opacity: 1;
}
#print-area {
  display: none;
}
.error-page {
  padding: 60px;
  max-width: 800px;
  margin: auto;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
}
audio {
  width: 100%;
  height: 35px;
}
details {
  font-size: 12px;
  color: #8995a7;
  margin-top: 15px;
}
summary {
  cursor: pointer;
}
input[type="checkbox"] {
  width: auto;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}
.muted {
  color: var(--muted);
}
.report-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  background: #eef3ff;
  border: 1px solid #dce6ff;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #6c80b5;
}
.loading-text {
  color: #7e8da5;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1500px) {
  .content {
    padding-top: 38px;
  }
  .raw-input {
    min-height: 350px;
  }
  .preview-empty {
    min-height: 455px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 185px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .main {
    margin-left: 185px;
    width: calc(100% - 185px);
  }
  .content {
    padding: 25px;
  }
  .topbar {
    padding: 0 25px;
  }
  .goal-grid {
    grid-template-columns: 1fr 1fr;
  }
  .editor-grid {
    gap: 16px;
  }
  .panel-body,
  .panel-head,
  .panel-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .history-layout {
    grid-template-columns: 250px 1fr;
  }
}
@media (max-width: 850px) {
  .sidebar {
    width: 72px;
    padding: 22px 8px;
  }
  .brand {
    padding: 0 8px 25px;
  }
  .brand-copy,
  .nav-label,
  .nav span,
  .sidebar-footer {
    display: none;
  }
  .nav {
    padding: 13px 17px;
  }
  .main {
    margin-left: 72px;
    width: calc(100% - 72px);
  }
  .cards {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric .icon-box {
    display: none;
  }
  .editor-grid,
  .data-grid {
    grid-template-columns: 1fr;
  }
  .history-layout,
  .month-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-side {
    display: none;
  }
  .calendar {
    max-width: none;
  }
  .calendar.collapsed {
    display: none;
  }
  .calendar-grid {
    max-width: 100%;
  }
  .page-title {
    align-items: flex-start;
  }
  .date-pill {
    display: none;
  }
  .goal-grid {
    grid-template-columns: 1fr 1fr;
  }
  .busy {
    width: calc(100% - 100px);
  }
  .topbar {
    height: 58px;
  }
  .report-paper {
    padding: 25px;
  }
  .content {
    padding: 20px;
  }
  .top-actions .muted {
    display: none;
  }
}
@media (max-width: 560px) {
  .content {
    padding: 16px;
  }
  .cards {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
  }
  .metric {
    padding: 12px;
  }
  .metric .value {
    font-size: 23px;
  }
  .metric .caption {
    font-size: 9px;
  }
  .metric .value small {
    display: none;
  }
  .goal-grid {
    grid-template-columns: 1fr;
  }
  .compare {
    grid-template-columns: 1fr;
  }
  .page-title h1 {
    font-size: 23px;
  }
  .topbar {
    padding: 0 16px;
  }
  .workflow {
    font-size: 10px;
    gap: 6px;
  }
  .workflow .rule {
    width: 12px;
  }
  .filters {
    flex-wrap: wrap;
  }
  .busy {
    right: 12px;
    width: calc(100% - 92px);
  }
  .panel-foot {
    flex-wrap: wrap;
  }
  .report-paper {
    padding: 19px;
  }
  .date-pill {
    display: none;
  }
  .panel-body {
    padding: 16px;
  }
  .welcome-banner {
    display: block;
  }
  .btn {
    padding: 8px 10px;
  }
  #toast {
    left: calc(50% + 30px);
  }
}
@media print {
  body {
    background: white;
    font-size: 11pt;
    color: #111;
  }
  #app,
  #modal,
  #toast,
  #busy {
    display: none !important;
  }
  #print-area {
    display: block;
    white-space: pre-wrap;
    font:
      11pt/1.8 "Microsoft YaHei",
      sans-serif;
    padding: 10mm 7mm;
  }
  #print-area h1 {
    font-size: 20pt;
    margin-bottom: 10mm;
  }
  #print-area pre {
    font: inherit;
    white-space: pre-wrap;
  }
  @page {
    size: A4;
    margin: 15mm;
  }
}

/* ---- 3.6.1 ---- */
#toast.error {
  background: #8f3b33;
}
.date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.date-row input[type="date"] {
  width: 160px;
  flex: 0 0 auto;
}
.date-row .pill {
  margin-left: 6px;
  white-space: nowrap;
}
.btn.icon-only {
  padding: 7px;
  border: 1px solid #dce2ec;
  background: #fff;
}
.btn.icon-only svg {
  width: 16px;
  height: 16px;
}
.btn.icon-only:hover {
  border-color: #b9c6ee;
  color: var(--blue);
}
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.short-input {
  min-height: 75px;
}
.first-label {
  margin-top: 0;
}
.list-note {
  margin: -6px 0 12px;
}
.mono {
  font-family: Consolas, "Cascadia Mono", "Microsoft YaHei UI", monospace;
  font-size: 12px;
  word-break: break-all;
}
.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.file-list li {
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
  color: #6c7686;
  font-size: 12px;
}
.file-list strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}
ol.steps {
  margin: 10px 0 16px;
  padding-left: 20px;
  color: #56617a;
}
ol.steps li {
  margin: 6px 0;
}
.notice .btn {
  margin-left: 10px;
}
.calendar .row input[type="month"] {
  min-width: 0;
}
.pill {
  white-space: nowrap;
}
@media (max-width: 1250px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 760px) {
  .sidebar {
    padding-top: 20px;
    padding-bottom: 14px;
  }
  .brand {
    padding-bottom: 18px;
  }
  .nav {
    padding-top: 8px;
    padding-bottom: 8px;
    margin: 1px 0;
  }
  .nav-label-gap {
    margin-top: 12px;
  }
  .sidebar-footer {
    padding-top: 10px;
  }
}
@media (max-height: 600px) {
  .sidebar-footer p {
    display: none;
  }
}
.daily-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.daily-bar .workflow {
  margin: 0;
}
.stat-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #7b8390;
}
.stat-strip span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}
.stat-strip b {
  color: var(--ink);
  font-size: 13px;
}
.health-link {
  background: none;
  padding: 0;
  margin-top: 7px;
  text-align: left;
  cursor: pointer;
}
.health-link:hover {
  color: #fff;
}
.dot.bad {
  background: #e5645a;
}
#backup-alert .notice {
  margin-bottom: 18px;
}
#backup-alert .notice p {
  margin: 4px 0 8px;
}
#backup-alert .notice .btn {
  margin-left: 0;
}

/* ---- 4.0 Minimal Bottom-Dock Voice Coach & Mobile ---- */
.coach-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-width: 780px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.coach-topbar {
  height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
}
.coach-conv-trigger {
  background: #f4f7fd;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.coach-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.coach-drawer {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  max-height: 60%;
  overflow: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(20, 35, 65, 0.12);
  padding: 12px 14px;
  z-index: 20;
}
.coach-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}
.coach-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coach-conv-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  background: #f7f9fc;
  padding: 4px;
}
.coach-conv-row.active {
  background: var(--blue-soft);
}
.coach-conv-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  padding: 6px 8px;
  color: var(--ink);
}
.coach-conv-btn span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coach-conv-btn small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.coach-conv-del {
  background: none;
  color: #9ba7bb;
  font-size: 16px;
  padding: 4px 8px;
}
.coach-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  background: #fafbfe;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coach-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  max-width: 280px;
  line-height: 1.7;
}
.coach-msg {
  max-width: 84%;
  display: flex;
}
.coach-msg.user {
  align-self: flex-end;
}
.coach-msg.assistant {
  align-self: flex-start;
}
.coach-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.coach-msg.user .coach-bubble {
  background: #4262df;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.coach-msg.assistant .coach-bubble {
  background: #fff;
  color: var(--ink);
  border: 1px solid #e7ecf5;
  border-bottom-left-radius: 4px;
}
.coach-replay {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f2f5fc;
  color: #5d73b8;
  font-size: 11px;
  vertical-align: middle;
}
.coach-replay.alert {
  background: #fff3e6;
  color: #c26518;
  font-weight: 500;
}
.coach-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #4262df;
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: coachBlink 0.9s infinite;
}
@keyframes coachBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.coach-live-hint {
  text-align: center;
  font-size: 12px;
  color: #5b72b8;
  background: #f1f5ff;
  padding: 5px 10px;
  flex: 0 0 auto;
}
.coach-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
}
.coach-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f6fc;
  color: var(--ink);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.coach-icon-btn.small {
  width: 34px;
  height: 34px;
  font-size: 14px;
}
.coach-icon-btn.active {
  background: #239b6e;
  color: #fff;
}
.coach-talk-btn {
  flex: 1;
  height: 44px;
  border-radius: 999px;
  background: #4262df;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.coach-talk-btn:active {
  transform: scale(0.985);
}
.coach-talk-btn.state-recording {
  background: #df4a42;
  box-shadow: 0 0 0 4px rgba(223, 74, 66, 0.18);
}
.coach-talk-btn.state-recording.cancelling {
  background: #8a94a6;
  box-shadow: none;
}
.coach-talk-btn.state-thinking {
  background: #6c79df;
}
.coach-talk-btn.state-speaking {
  background: #239b6e;
}
.coach-dock.text-mode textarea {
  flex: 1;
  min-height: 40px;
  max-height: 110px;
  padding: 8px 12px;
  border-radius: 18px;
  resize: none;
}
.today-switcher {
  display: inline-flex;
  background: #f2f5fb;
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.ts-btn {
  padding: 5px 11px;
  border-radius: 999px;
  background: none;
  color: #6b7890;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.ts-btn.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(24, 38, 70, 0.1);
}
.coach-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pill.green {
  background: #e9f8f1;
  color: #1f8a5c;
}
.pill.warn {
  background: #fff2ef;
  color: #b84a39;
}
.mobile-tabbar {
  display: none;
}
@media (max-width: 820px) {
  .sidebar {
    display: none;
  }
  .main {
    margin-left: 0;
    width: 100%;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .shell.page-coach .topbar,
  .shell.page-today.today-coach .topbar {
    display: none;
  }
  .shell.page-coach .content,
  .shell.page-today.today-coach .content {
    padding: 0;
  }
  .shell.page-coach .coach-shell,
  .shell.page-today.today-coach .coach-shell {
    height: calc(100dvh - 56px - env(safe-area-inset-bottom, 0px));
    border: none;
    border-radius: 0;
  }
  .shell.page-today.today-write .eyebrow,
  .shell.page-today.today-write .page-title .subtitle,
  .shell.page-today.today-write .daily-bar,
  .shell.page-today.today-write .tip,
  .shell.page-history .eyebrow,
  .shell.page-history .page-title .subtitle {
    display: none;
  }
  .shell.page-today.today-write .page-title,
  .shell.page-history .page-title {
    margin-bottom: 12px;
    gap: 10px;
  }
  .shell.page-today.today-write .page-title h1,
  .shell.page-history .page-title h1 {
    font-size: 20px;
  }
  .mobile-only-btn {
    display: inline-flex !important;
  }
  .coach-datebar {
    padding: 6px 10px;
    gap: 4px;
  }
  .coach-sync-state {
    font-size: 10px;
  }
  .cal-day {
    min-height: 36px;
    font-size: 13px;
  }
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 60;
  }
  .mobile-tab {
    background: none;
    color: #7c899e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    padding: 4px 2px;
  }
  .mobile-tab svg {
    width: 18px;
    height: 18px;
  }
  .mobile-tab.active {
    color: var(--blue);
    font-weight: 600;
  }
  #toast {
    left: 50%;
    bottom: 72px;
    max-width: 90vw;
  }
}

/* ---- 4.3 Date Picker, History Actions & UX Polish ---- */
.coach-datebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f8faff;
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 0 0 auto;
}
.coach-date-nav {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #dfe6f2;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.coach-date-nav:hover {
  border-color: #9cb4f0;
  color: var(--blue);
}
.coach-date-pill,
.date-pick-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #d5e0f5;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.coach-date-pill:hover,
.date-pick-pill:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.coach-date-native,
.date-pick-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: none;
}
.coach-today-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf2ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
}
.coach-sync-state {
  font-size: 11px;
  color: #469772;
  white-space: nowrap;
  flex: 0 0 auto;
}
.coach-sync-state.error {
  color: #b84a39;
}
.history-datebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.calendar-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 11px;
  color: #8c96a5;
  flex-wrap: wrap;
}
.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dot-pub,
.dot-draft {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot-pub,
.cal-day.has-pub::after {
  background: #2fa36b;
}
.dot-draft,
.cal-day.has-draft::after {
  background: #e59934;
}
.log-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #edf0f6;
}
.past-date-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #eef3ff;
  border: 1px solid #d5e1fc;
  color: #36508f;
  font-size: 12px;
}
.options-fold {
  margin-top: 12px;
  padding: 8px 12px;
  background: #f8fafe;
  border: 1px solid #eaedf4;
  border-radius: 8px;
}
.options-fold summary {
  font-size: 12px;
  color: #60718b;
  font-weight: 500;
}
.mobile-only-btn {
  display: none;
}
.coach-mode-chip {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5ff;
  border: 1px solid #d6e2fc;
  color: #3a5bc7;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
