/* Phase 0.5 uses Google Fonts for speed. Production must self-host Noto Serif SC on Aranya CDN. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-input: #f0ede5;
  --ink: #1a1612;
  --ink-soft: #4a453f;
  --ink-muted: #807a71;
  --ink-faint: #b8b2a6;
  --divider: #e8e4da;
  --divider-strong: #cfc9bc;
  --accent: #b5392f;
  --highlight: rgba(26, 22, 18, 0.04);
  --ok: #28724f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-variant-east-asian: simplified;
  font-feature-settings: normal;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--divider);
  background: rgba(250, 250, 247, 0.94);
  backdrop-filter: blur(8px);
}

.header-inner {
  width: min(1200px, 100%);
  height: 80px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
}

.brand-title {
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--ink);
  white-space: nowrap;
}

.tab-nav {
  display: flex;
  align-items: center;
  gap: 54px;
}

.tab-button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 12px 2px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.tab-button:focus,
.diary-filter:focus {
  outline: none;
}

.tab-button span {
  font-size: 22px;
  letter-spacing: 0.12em;
  line-height: 1;
}

.tab-button i {
  width: 20px;
  height: 1px;
  background: transparent;
  transition: background 0.15s ease;
}

.tab-button.active {
  color: var(--ink);
}

.tab-button.active i {
  background: var(--ink);
}

.header-meta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.version-label,
.session-id,
.page-meta {
  font-family: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  letter-spacing: 0.04em;
}

.version-label {
  font-size: 10px;
  color: var(--ink-faint);
}

.avatar-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--highlight);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.ask-view {
  position: relative;
}

body[data-ask-map="page"] .ask-view,
body[data-ask-map="right"] .ask-view {
  isolation: isolate;
}

body[data-ask-map="page"] .ask-view::before {
  content: "";
  position: fixed;
  top: 80px;
  right: -180px;
  bottom: 0;
  width: min(980px, 98vw);
  background-image: url("./assets/ui/map_high.jpg");
  background-repeat: no-repeat;
  background-position: right top 36px;
  background-size: contain;
  opacity: 0.46;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

body[data-ask-map="right"] .ask-view::before {
  content: "";
  position: fixed;
  top: 108px;
  right: -260px;
  width: min(760px, 78vw);
  aspect-ratio: 1;
  background-image: url("./assets/ui/map_right.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.48;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
  transform: rotate(90deg);
}

body[data-ask-map="page"] .ask-view .page-frame,
body[data-ask-map="right"] .ask-view .page-frame {
  position: relative;
  z-index: 1;
}

.page-frame {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 40px 48px 190px;
}

.diary-view .page-frame,
.insights-view .page-frame {
  width: min(980px, 100%);
}

.ask-view .page-header,
.diary-view .page-header {
  align-items: flex-start;
  padding-bottom: 56px;
  margin-bottom: 48px;
}

.ask-view .page-header h1,
.diary-view .page-header h1 {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.06em;
}

.ask-view .page-header p,
.diary-view .page-header p {
  margin-top: 44px;
  max-width: 520px;
  font-size: 27px;
  line-height: 1.75;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.diary-voice-button,
.diary-text-button,
.diary-save-button,
.diary-cancel-text-button {
  height: 58px;
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 18px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.diary-voice-button:hover,
.diary-save-button:hover {
  background: #241f19;
}

.diary-text-button {
  border: 1px solid var(--divider-strong);
  background: transparent;
  color: var(--ink);
}

.diary-text-button:hover {
  border-color: var(--ink-soft);
  background: rgba(28, 25, 21, 0.04);
}

.diary-cancel-text-button {
  border: 1px solid var(--divider-strong);
  background: transparent;
  color: var(--ink-muted);
}

.diary-cancel-text-button:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.diary-voice-button.recording {
  background: var(--accent);
}

.diary-text-button.active {
  border-color: var(--ink-soft);
  background: rgba(28, 25, 21, 0.06);
  color: var(--ink);
}

.diary-voice-button.starting,
.diary-voice-button.processing {
  opacity: 0.78;
}

.diary-voice-button:disabled,
.diary-text-button:disabled,
.diary-save-button:disabled,
.diary-cancel-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.diary-record-icon,
.diary-text-icon,
.diary-save-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.diary-record-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  display: block;
}

.diary-text-icon svg,
.diary-save-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: square;
  stroke-linejoin: miter;
  display: block;
}

.page-header {
  border-bottom: 1px solid var(--divider);
  padding-bottom: 32px;
  margin-bottom: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
}

.page-header p {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
}

.connection-panel {
  min-width: 190px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.75;
  text-align: right;
}

.status-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.status-dot.ready {
  background: var(--ok);
}

.status-dot.error {
  background: var(--accent);
}

.session-id {
  max-width: 240px;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--ink-faint);
  font-size: 10px;
}

.text-action {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.text-action:hover {
  opacity: 0.65;
}

.ask-session-nav {
  margin: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.5;
}

.ask-session-tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 28px;
}

.ask-session-tab,
.ask-new-session,
.ask-history-back,
.ask-delete-session {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: currentColor;
  padding: 0 0 4px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.06em;
}

.ask-session-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.ask-session-tab span {
  margin-left: 3px;
  color: var(--ink-faint);
  font-size: 15px;
}

.ask-new-session {
  margin-left: auto;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ask-session-tab:hover,
.ask-new-session:hover,
.ask-history-back:hover,
.ask-delete-session:hover {
  color: var(--ink);
}

.prompt-list {
  margin-bottom: 54px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 34px;
  color: var(--ink-muted);
}

.prompt-chip {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  padding: 0 0 3px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.7;
}

.prompt-chip:hover {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.messages {
  min-height: 260px;
}

.messages:empty {
  min-height: 0;
}

.ask-history-panel,
.ask-past-panel {
  min-height: 300px;
}

body[data-ask-map="detail"] .ask-past-panel {
  position: relative;
  isolation: isolate;
}

body[data-ask-map="detail"] .ask-past-panel::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -360px;
  width: min(820px, 128vw);
  aspect-ratio: 1;
  background-image: url("./assets/ui/map_high.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.36;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

body[data-ask-map="detail"] .ask-past-panel > * {
  position: relative;
  z-index: 1;
}

.ask-history-list {
  border-top: 1px solid var(--divider-strong);
}

.ask-history-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  padding: 28px 0;
  display: grid;
  grid-template-columns: 96px 1fr 64px;
  gap: 28px;
  align-items: baseline;
  text-align: left;
  cursor: pointer;
}

.ask-history-row:hover .ask-history-title,
.ask-history-row:hover .ask-history-arrow {
  color: var(--ink);
}

.ask-history-date {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.8;
}

.ask-history-date div:first-child {
  color: var(--ink);
  font-size: 15px;
}

.ask-history-title {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
}

.ask-history-meta {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.7;
}

.ask-history-arrow {
  color: var(--ink-faint);
  font-size: 13px;
  white-space: nowrap;
}

.ask-history-empty {
  margin-top: 0;
}

.ask-history-back {
  margin-bottom: 28px;
  color: var(--ink-muted);
  font-size: 13px;
}

.ask-past-header {
  margin-bottom: 42px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--divider);
}

.ask-past-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

.ask-past-header p {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.ask-past-message {
  margin: 0 0 44px;
}

.ask-past-message.user {
  border-left: 1px solid var(--divider-strong);
  padding-left: 28px;
}

.ask-past-message-meta {
  margin-bottom: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ask-past-message-text {
  color: var(--ink);
  font-size: 18px;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ask-past-message.user .ask-past-message-text {
  font-size: 19px;
  line-height: 1.85;
}

.ask-past-actions {
  margin-top: 26px;
  padding: 16px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  color: var(--ink-muted);
  font-size: 12px;
}

.ask-past-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--divider);
  text-align: center;
}

.ask-past-footer p {
  margin: 0 0 22px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.8;
}

.ask-delete-session {
  color: var(--ink-muted);
  font-size: 13px;
}

.ask-continue-session {
  min-width: 168px;
  height: 44px;
  margin: 0 0 24px;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.ask-continue-session:hover {
  opacity: 0.86;
}

.ask-delete-session {
  display: block;
  margin: 0 auto;
}

.welcome-message {
  margin: 0 0 64px;
  padding: 36px 0 40px;
  border-top: 1px solid var(--divider-strong);
  border-bottom: 1px solid var(--divider);
}

.welcome-message h2 {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.welcome-message p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 2;
}

.message-row {
  margin: 0 0 58px;
}

.message {
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  border-left: 1px solid var(--divider-strong);
  padding-left: 32px;
  font-size: 19px;
  line-height: 1.85;
}

.message.user::before {
  content: attr(data-meta);
  display: block;
  margin-bottom: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.message.agent {
  font-size: 18px;
  line-height: 2;
}

.message.agent::before {
  content: "助手小可";
  display: block;
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.message.pending {
  color: var(--ink-soft);
}

.message-meta {
  margin-top: 26px;
  padding: 16px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  color: var(--ink-muted);
  font-size: 12px;
}

.message.user .message-meta {
  border-bottom: 0;
  padding-bottom: 0;
}

.copy-button,
.feedback-button,
.content-action-button {
  border: 0;
  background: transparent;
  color: currentColor;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.copy-button:hover,
.feedback-button:hover:not(:disabled),
.content-action-button:hover:not(:disabled) {
  color: var(--ink);
}

.content-action-group {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--ink);
  font-size: 14px;
}

.content-action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.content-action-button.selected {
  color: var(--ok);
  cursor: default;
}

.content-action-button:disabled:not(.selected) {
  opacity: 0.55;
  cursor: default;
}

.action-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
  color: currentColor;
  flex: 0 0 18px;
}

.action-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-icon.dislike svg {
  transform: rotate(180deg);
  transform-origin: center;
}

.action-icon.card {
  border: 1.25px solid currentColor;
  border-radius: 2px;
}

.action-icon.card::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 1.25px;
  background: currentColor;
  box-shadow: 0 4.5px 0 currentColor;
}

.action-icon.copy::before,
.action-icon.copy::after {
  content: "";
  position: absolute;
  border: 1.25px solid currentColor;
  border-radius: 2px;
}

.action-icon.copy::before {
  width: 10px;
  height: 12px;
  left: 5px;
  top: 2px;
}

.action-icon.copy::after {
  width: 10px;
  height: 12px;
  left: 2px;
  top: 5px;
  background: var(--bg);
}

.content-action-button.selected .action-icon.copy::before,
.content-action-button.selected .action-icon.like svg,
.content-action-button.selected .action-icon.dislike svg {
  opacity: 0;
}

.content-action-button.selected .action-icon.card {
  border-color: transparent;
}

.content-action-button.selected .action-icon.card::before {
  opacity: 0;
}

.content-action-button.selected .action-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  width: 10px;
  height: 6px;
  left: 4px;
  top: 5px;
  border: 0;
  border-left: 1.45px solid currentColor;
  border-bottom: 1.45px solid currentColor;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  transform: rotate(-45deg);
  transform-origin: center;
}

.feedback-separator {
  width: 100%;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.feedback-group {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--ink-muted);
  font-size: 13px;
}

.feedback-button.selected {
  color: var(--ink);
}

.feedback-button:disabled:not(.selected) {
  opacity: 0.45;
  cursor: default;
}

.typing {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: bounce 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 28px 48px 34px;
  background: linear-gradient(to top, var(--bg) 68%, rgba(250, 250, 247, 0));
}

.composer-inner,
.composer-hint {
  width: min(760px, 100%);
  margin: 0 auto;
}

.composer-inner {
  min-height: 58px;
  padding: 12px 18px;
  background: var(--surface-input);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.composer-hint {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 11px;
}

.composer-status {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: calc(100% + 10px);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  text-align: center;
  color: var(--ink-soft);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 4;
}

.composer-status.visible {
  opacity: 1;
  transform: translateY(0);
}

.composer-status span {
  display: inline-flex;
  max-width: min(420px, 100%);
  border: 1px solid var(--divider);
  background: rgba(250, 250, 247, 0.96);
  padding: 9px 14px;
  font-size: 13px;
}

.composer-status.error span {
  border-color: rgba(181, 57, 47, 0.28);
  color: var(--accent);
}

.composer-status.ready span {
  border-color: rgba(40, 114, 79, 0.22);
  color: var(--ok);
}

.voice-button,
.send-button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.voice-button {
  gap: 8px;
  padding: 3px 0;
  user-select: none;
  -webkit-user-select: none;
}

.voice-button.recording {
  color: var(--accent);
}

.voice-button.starting,
.voice-button.processing {
  color: var(--ink);
  opacity: 0.78;
}

.voice-button:disabled,
.send-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.voice-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.keyboard-icon {
  display: none;
}

.voice-icon svg,
.keyboard-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  display: block;
}

.voice-label,
.send-button {
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.send-button:hover:not(:disabled),
.voice-button:hover:not(:disabled) {
  color: var(--ink);
}

.composer textarea {
  width: 100%;
  max-height: 190px;
  box-sizing: border-box;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  outline: none;
  font-size: 16px;
  line-height: 1.6;
}

.composer textarea::placeholder {
  color: var(--ink-muted);
}

.tool-menu-wrap {
  display: none;
}

.ask-voice-hold-button {
  display: none;
}

.primary-action {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.secondary-action {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.secondary-action:disabled {
  opacity: 0.55;
  cursor: default;
}

.diary-composer {
  margin: -14px 0 32px;
  border: 1px solid var(--divider);
  background: rgba(255, 255, 255, 0.52);
  padding: 16px;
}

.diary-entry-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 12px;
}

.diary-text-panel {
  margin-top: 16px;
  border-top: 1px solid var(--divider);
  padding-top: 16px;
}

.diary-composer textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  padding: 0 0 18px;
  outline: none;
  font-size: 17px;
  line-height: 1.9;
}

.diary-composer textarea::placeholder {
  color: var(--ink-muted);
}

.diary-audio-preview {
  margin-top: 18px;
  border-top: 1px solid var(--divider);
  padding-top: 18px;
}

.diary-audio-head {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

.diary-audio-head span:first-child {
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.diary-audio-preview audio {
  width: 100%;
  height: 42px;
  display: block;
  filter: grayscale(1);
}

.diary-save-hint {
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.diary-composer-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 12px;
}

.diary-voice-button,
.diary-text-button,
.diary-save-button,
.diary-cancel-text-button {
  width: 100%;
}

.diary-filter-bar {
  margin: 18px 0 36px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--divider-strong);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.diary-filter-tabs {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 36px;
}

.diary-filter {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  min-width: 44px;
  padding: 0 0 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
}

.diary-filter::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: transparent;
}

.diary-filter.active {
  color: var(--ink);
}

.diary-filter.active::after {
  background: var(--ink);
}

.diary-count {
  color: var(--ink-muted);
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.card-list {
  display: block;
}

.diary-row-list {
  display: block;
}

.diary-row {
  width: 100%;
  margin: 0;
  padding: 42px 14px 46px;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  display: block;
  text-align: left;
  cursor: pointer;
}

.diary-row,
.diary-row * {
  font-weight: 400;
}

.diary-row:hover .diary-row-preview,
.diary-row:hover .diary-row-location,
.diary-row:hover .diary-row-foot {
  color: var(--ink-soft);
}

.diary-row-date {
  max-width: 720px;
  padding-top: 2px;
  display: grid;
  align-content: start;
  gap: 9px;
}

.diary-row-date-main {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0.06em;
}

.diary-row-date-sub {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.diary-row-time {
  margin-top: 12px;
  color: var(--ink-soft);
  font-family: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.diary-row-location {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.diary-row-content {
  max-width: 860px;
  margin-top: 52px;
  display: grid;
  align-content: start;
  gap: 20px;
}

.diary-row-image-frame {
  width: 100%;
  max-width: 680px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #eee9df;
}

.diary-row-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.95);
}

.diary-row-headline,
.diary-row-extracted {
  max-width: 720px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.55;
  letter-spacing: 0.025em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-row-headline.from-title {
  letter-spacing: 0.018em;
}

.diary-row-preview {
  max-width: 780px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.035em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.diary-row.has-headline .diary-row-preview {
  margin-top: -4px;
}

.diary-row.without-image .diary-row-preview {
  max-width: 840px;
}

.diary-row-foot {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.diary-row-mic {
  color: var(--ink-muted);
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.diary-row-mic svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.diary-row-status {
  display: none;
}

.diary-row-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.diary-row-badge span:first-child {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.diary-row.status-forbidden .diary-row-badge {
  color: #9d5f57;
}

.diary-row.status-published .diary-row-badge {
  color: var(--ink-soft);
}

.diary-row-chevron {
  margin-top: -6px;
  color: var(--ink-faint);
  font-size: 28px;
  line-height: 1;
}

.recording-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(35, 33, 29, 0.62);
  backdrop-filter: blur(10px);
}

.recording-overlay.open {
  display: flex;
}

.recording-dialog {
  width: min(640px, 100%);
  min-height: 452px;
  background: var(--surface);
  color: var(--ink);
  padding: 78px 48px 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 34px 92px rgba(20, 18, 15, 0.22);
}

.recording-title {
  color: var(--ink-muted);
  font-size: 23px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.recording-time {
  margin-top: 44px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: var(--ink);
  font-family: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.recording-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d77c73;
  animation: recordingPulse 1.3s ease-in-out infinite;
}

.recording-help {
  margin: 80px 0 0;
  color: var(--ink-soft);
  text-align: center;
  font-size: 24px;
  line-height: 1.75;
  letter-spacing: 0.04em;
}

.recording-actions {
  margin-top: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 62px;
}

.recording-cancel,
.recording-complete {
  min-width: 132px;
  height: 62px;
  border: 0;
  cursor: pointer;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.recording-cancel {
  background: transparent;
  color: var(--ink-muted);
}

.recording-complete {
  background: var(--ink);
  color: #fff;
}

.recording-complete:hover {
  background: #241f19;
}

.detail-open {
  overflow: hidden;
}

.card-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px;
  overflow: auto;
  background: rgba(26, 22, 18, 0.5);
  backdrop-filter: blur(8px);
}

.card-detail-overlay.open {
  display: flex;
}

.card-detail-dialog {
  position: relative;
  width: min(760px, 100%);
  min-height: min(620px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.card-detail-header {
  padding: 28px 48px;
  border-bottom: 1px solid var(--divider-strong);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 20px;
}

.card-detail-back {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.card-detail-headline {
  min-width: 0;
}

.card-detail-date {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.card-detail-headline h2 {
  margin: 8px 0 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.card-detail-headline p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.card-detail-headline p #cardDetailTime {
  font-family: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

.card-detail-tabs {
  min-height: 56px;
  padding: 20px 48px 0;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: flex-end;
  gap: 36px;
}

.card-detail-tab {
  position: relative;
  padding: 0 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.card-detail-tab:focus {
  outline: none;
}

.card-detail-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: transparent;
}

.card-detail-tab.active {
  color: var(--ink);
}

.card-detail-tab.active::after {
  background: var(--ink);
}

.card-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 48px 48px;
}

.card-detail-hint {
  margin: 0 0 20px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.card-detail-image-frame {
  width: 100%;
  margin: 0 0 34px;
  overflow: hidden;
  background: #eee9df;
}

.card-detail-image-frame[hidden] {
  display: none;
}

.card-detail-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.95);
}

.card-detail-audio {
  margin: 0 0 30px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.card-detail-audio[hidden] {
  display: none;
}

.card-detail-audio-meta {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.card-detail-audio-icon {
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
}

.card-detail-audio-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.card-detail-audio audio {
  width: 100%;
  height: 38px;
  display: block;
  filter: grayscale(1);
}

.card-detail-audio-notice {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.card-detail-audio-notice[hidden] {
  display: none;
}

.card-detail-text {
  min-height: 220px;
  outline: none;
  color: var(--ink);
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

.card-detail-text.readonly {
  cursor: default;
}

.card-detail-text.extracted {
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.02em;
}

.card-detail-text.empty::before {
  content: attr(data-empty-text);
  color: var(--ink-faint);
}

.ask-recording-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  overflow: hidden;
  background: rgba(26, 22, 18, 0.54);
  backdrop-filter: blur(2px);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.ask-recording-overlay *,
.ask-voice-hold-button,
.composer.mobile-voice-mode .voice-button,
.composer.mobile-voice-mode .tool-button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.ask-recording-overlay.open {
  display: block;
}

.ask-wave-card {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 128px;
  height: 72px;
  border-radius: 18px;
  background: #080706;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 20px 40px rgba(26, 22, 18, 0.26);
}

.ask-wave-card span {
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  animation: askWave 1s ease-in-out infinite;
}

.ask-wave-card span:nth-child(1),
.ask-wave-card span:nth-child(7) {
  height: 16px;
  animation-delay: 0.1s;
}

.ask-wave-card span:nth-child(2),
.ask-wave-card span:nth-child(6) {
  height: 28px;
  animation-delay: 0.22s;
}

.ask-wave-card span:nth-child(3),
.ask-wave-card span:nth-child(5) {
  height: 38px;
  animation-delay: 0.34s;
}

.ask-wave-card span:nth-child(4) {
  height: 46px;
  animation-delay: 0.46s;
}

.ask-recording-targets {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 28px;
}

.ask-recording-target {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  min-width: 126px;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  background: rgba(250, 250, 247, 0.28);
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.ask-recording-target.wide {
  min-width: 176px;
}

.ask-recording-target.is-active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(250, 250, 247, 0.58);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 30px rgba(8, 7, 6, 0.16);
}

.ask-release-arc {
  appearance: none;
  border: 0;
  position: absolute;
  left: 50%;
  bottom: -92px;
  width: 132%;
  height: 210px;
  border-radius: 50% 50% 0 0 / 44% 44% 0 0;
  background: rgba(255, 255, 255, 0.98);
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 56px;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0.18em;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.ask-release-arc.is-active {
  color: var(--ink);
  box-shadow: inset 0 20px 46px rgba(26, 22, 18, 0.06);
  transform: translateX(-50%) translateY(-4px);
}

.card-detail-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--divider-strong);
  background: rgba(250, 249, 245, 0.94);
  backdrop-filter: blur(8px);
}

.card-detail-actions {
  min-height: 64px;
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 32px;
}

.card-detail-actions[hidden] {
  display: none;
}

.card-detail-actions button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.card-detail-actions button.primary {
  min-width: 92px;
  height: 40px;
  background: var(--ink);
  color: #fff;
}

.card-detail-actions button.danger {
  color: var(--ink-muted);
}

.card-detail-busy {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(250, 249, 245, 0.72);
  backdrop-filter: blur(5px);
}

.card-detail-busy.open {
  display: flex;
}

.card-detail-busy[hidden] {
  display: none;
}

.card-detail-busy-panel {
  width: min(360px, 100%);
  padding: 40px 32px;
  border: 1px solid var(--divider-strong);
  background: rgba(250, 249, 245, 0.94);
  text-align: center;
  box-shadow: 0 18px 48px rgba(36, 31, 26, 0.13);
}

.card-detail-busy-title {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.card-detail-busy-panel p {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.card-detail-busy-dots {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.card-detail-busy-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ink-muted);
  opacity: 0.35;
  animation: busyDot 1.1s ease-in-out infinite;
}

.card-detail-busy-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.card-detail-busy-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(56, 53, 48, 0.28);
  backdrop-filter: blur(6px);
}

.app-confirm-overlay.open {
  display: flex;
}

.app-confirm-dialog {
  width: min(430px, 100%);
  background: var(--surface);
  color: var(--ink);
  padding: 42px 42px 34px;
  box-shadow: 0 28px 72px rgba(35, 31, 25, 0.28);
  border: 1px solid var(--divider);
}

.app-confirm-dialog h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.06em;
}

.app-confirm-dialog p {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  white-space: pre-line;
}

.app-confirm-actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
}

.app-confirm-actions button {
  min-width: 82px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.app-confirm-actions button.primary {
  background: var(--ink);
  color: #fff;
}

@keyframes recordingPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

@keyframes askWave {
  0%,
  100% {
    transform: scaleY(0.72);
    opacity: 0.62;
  }

  50% {
    transform: scaleY(1.08);
    opacity: 1;
  }
}

.empty-state {
  border-top: 1px solid var(--divider-strong);
  border-bottom: 1px solid var(--divider);
  padding: 44px 0;
}

.empty-state h2 {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 500;
}

.empty-state p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 2;
}

.diary-empty-state {
  border-top: 1px solid var(--divider-strong);
  border-bottom: 0;
  padding: 64px 0;
  text-align: center;
}

.diary-empty-state p {
  max-width: none;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.8;
}

.insights-hero {
  padding-bottom: 56px;
  border-bottom: 1px solid var(--divider);
  display: block;
}

.insights-kicker,
.insights-report-kicker,
.insights-panel-heading span,
.insights-section-title span {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.12em;
}

.insights-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.06em;
}

.insights-hero p {
  max-width: 520px;
  margin: 44px 0 0;
  color: var(--ink-soft);
  font-size: 27px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.insights-source-note {
  color: var(--ink-muted) !important;
  font-size: 15px !important;
  line-height: 1.9 !important;
}

.insights-hero-image {
  width: 100%;
  max-width: 760px;
  margin-top: 56px;
  overflow: hidden;
  background: #eee9df;
}

.insights-hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.95);
}

.insights-source-strip {
  min-height: 102px;
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
}

.insights-source-item {
  min-width: 0;
  padding: 24px 32px 24px 0;
  border-right: 1px solid var(--divider);
  display: grid;
  align-content: center;
  gap: 12px;
}

.insights-source-item + .insights-source-item {
  padding-left: 32px;
}

.insights-source-item:last-child {
  padding-right: 0;
  border-right: 0;
}

.insights-source-item span {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.12em;
}

.insights-source-item strong {
  color: var(--ink);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.05em;
}

.insights-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--divider);
}

.insights-mode-button {
  border: 0;
  border-right: 1px solid var(--divider);
  background: transparent;
  color: var(--ink-muted);
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.insights-mode-button:last-child {
  border-right: 0;
}

.insights-mode-button.active {
  background: var(--ink);
  color: #fff;
}

.insights-range-bar {
  min-height: 86px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 36px;
}

.insights-range,
.insights-question,
.insights-topic,
.insights-generate,
.insights-mode-button,
.insights-report-action,
.insights-range-input input {
  font: inherit;
}

.insights-range {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  padding: 6px 0 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.insights-range.active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.insights-range-meta {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.insights-range-custom {
  border-bottom: 1px solid var(--divider);
  padding: 26px 0;
  display: flex;
  align-items: center;
  gap: 34px;
}

.insights-range-custom[hidden] {
  display: none;
}

.insights-range-input {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr);
  align-items: center;
  gap: 14px;
  color: var(--ink-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.insights-range-input input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--divider);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  font-size: 15px;
  letter-spacing: 0.02em;
  outline: none;
}

.insights-range-input input:focus {
  border-color: var(--divider-strong);
}

.insights-workbench {
  padding: 58px 0 64px;
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 48px;
}

.insights-question-panel,
.insights-report {
  min-width: 0;
}

.insights-panel-heading,
.insights-section-title {
  display: grid;
  gap: 18px;
}

.insights-panel-heading h2,
.insights-section-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.insights-question-list {
  margin-top: 34px;
  border-top: 1px solid var(--divider);
}

.insights-question {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink-muted);
  padding: 19px 0;
  cursor: pointer;
  text-align: left;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.04em;
}

.insights-question.active,
.insights-question:hover {
  color: var(--ink);
}

.insights-custom-question {
  margin-top: 34px;
  display: grid;
  gap: 14px;
  color: var(--ink-muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.insights-custom-question textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--divider);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 16px;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  outline: none;
}

.insights-custom-question textarea:focus {
  border-color: var(--divider-strong);
}

.insights-generate {
  width: 100%;
  height: 58px;
  margin-top: 18px;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.1em;
}

.insights-report {
  border-left: 1px solid var(--divider);
  padding-left: 48px;
}

.insights-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.insights-report h2 {
  margin: 44px 0 0;
  color: var(--ink);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.insights-report-lead {
  margin: 28px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.85;
  letter-spacing: 0.035em;
}

.insights-report-block {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--divider);
}

.insights-report-block h3 {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.12em;
}

.insights-report-block p {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.95;
  letter-spacing: 0.04em;
}

.insights-report-actions {
  margin-top: 38px;
  padding-top: 30px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.insights-report-action {
  min-height: 48px;
  border: 1px solid var(--divider-strong);
  background: transparent;
  color: var(--ink);
  padding: 0 22px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.insights-report-action.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.insights-action-note {
  min-height: 26px;
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

.insights-discovery,
.insights-lines {
  padding: 62px 0;
  border-bottom: 1px solid var(--divider);
}

.insights-topic-list {
  margin-top: 36px;
  border-top: 1px solid var(--divider);
}

.insights-topic {
  width: 100%;
  min-height: 118px;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 24px;
  cursor: pointer;
  text-align: left;
}

.insights-topic strong {
  display: block;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.035em;
}

.insights-topic em {
  margin-top: 7px;
  display: block;
  color: var(--ink-muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.insights-topic b {
  color: var(--ink-soft);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.insights-topic:hover strong {
  color: var(--ink-soft);
}

.insights-line-list {
  margin-top: 56px;
  display: grid;
  gap: 54px;
}

.insights-line-list figure {
  margin: 0;
}

.insights-line-list blockquote {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.8;
  letter-spacing: 0.035em;
}

.insights-line-list figcaption {
  margin-top: 22px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

body.modal-open {
  overflow: hidden;
}

.insights-view .page-frame.insights-v13 {
  width: min(920px, 100%);
  padding-top: 40px;
}

.insights-v13-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--divider);
}

.insights-v13-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.06em;
}

.insights-v13-header p {
  max-width: 520px;
  margin: 44px 0 0;
  color: var(--ink-soft);
  font-size: 27px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.insights-v13-hero {
  width: 100%;
  margin-bottom: 36px;
  overflow: hidden;
  background: #eee9df;
}

.insights-v13-hero img {
  width: 100%;
  aspect-ratio: 7 / 2;
  display: block;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.95);
}

.insights-v13-cta {
  margin-bottom: 36px;
  padding: 32px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
}

.insights-v13-cta button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.insights-v13-cta button:hover {
  opacity: 0.62;
}

.insights-v13-filter {
  margin: 18px 0 36px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--divider-strong);
  display: flex;
  align-items: flex-end;
  gap: 36px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.insights-v13-filter button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  min-width: 44px;
  padding: 0 0 10px;
  font-family: inherit;
  font-size: inherit;
  text-align: center;
}

.insights-v13-filter button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: transparent;
}

.insights-v13-filter button.active {
  color: var(--ink);
}

.insights-v13-filter button.active::after {
  background: var(--ink);
}

.insights-v13-filter span {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 15px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.insights-report-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 32px 0;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 32px;
  text-align: left;
  font-family: inherit;
}

.insights-report-date div:first-child {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.insights-report-date div:last-child {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.insights-report-main h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.insights-report-main p {
  margin: 0 0 9px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
}

.insights-report-tags {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.insights-report-source {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.insights-report-source .auto,
.insights-detail-source .auto {
  color: var(--ink-soft);
}

.insights-report-source .user,
.insights-detail-source .user {
  color: var(--ink-muted);
}

.insights-report-source b {
  color: var(--ink-faint);
  font-weight: 400;
}

.insights-report-row:hover .insights-report-source b {
  color: var(--ink);
}

.insights-empty {
  padding: 64px 0;
  color: var(--ink-muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}

body[data-insight-rows="tei"] .insights-v13-list {
  display: grid;
  gap: 14px;
  border-top: 0;
  padding-top: 4px;
}

body[data-insight-rows="tei"] .insights-report-row {
  min-height: 92px;
  border: 0;
  background: rgba(31, 28, 24, 0.045);
  padding: 23px 28px;
  grid-template-columns: 138px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 28px;
}

body[data-insight-rows="tei"] .insights-report-row:hover {
  background: rgba(31, 28, 24, 0.065);
}

body[data-insight-rows="tei"] .insights-report-date div:first-child {
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0.12em;
}

body[data-insight-rows="tei"] .insights-report-date div:last-child {
  margin-top: 6px;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

body[data-insight-rows="tei"] .insights-report-main h2 {
  margin-bottom: 5px;
  font-size: 21px;
  line-height: 1.55;
}

body[data-insight-rows="tei"] .insights-report-main p {
  margin-bottom: 3px;
  font-size: 12px;
}

body[data-insight-rows="tei"] .insights-report-tags {
  color: var(--ink-muted);
  font-size: 12px;
}

body[data-insight-rows="tei"] .insights-report-source {
  justify-content: flex-end;
}

body[data-insight-rows="tei"] .insights-report-source span {
  display: none;
}

body[data-insight-rows="tei"] .insights-report-source b {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.insights-generator-overlay {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 48px;
  overflow-y: auto;
  background: rgba(26, 22, 18, 0.5);
  backdrop-filter: blur(8px);
}

.insights-generator-overlay.open {
  display: flex;
}

.insights-generator {
  width: min(640px, 100%);
  max-height: calc(100vh - 4rem);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.insights-generator-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--divider-strong);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.insights-generator-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.insights-generator-head button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
}

.insights-generator-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 48px;
}

.insights-generator-section + .insights-generator-section {
  margin-top: 48px;
}

.insights-generator-label {
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

.insights-generator-label.with-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.insights-generator-label em {
  color: var(--ink-faint);
  font-size: 11px;
  font-style: normal;
}

.insights-time-trigger {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: inherit;
}

.insights-time-trigger span {
  font-size: 20px;
  line-height: 1.5;
}

.insights-time-trigger em {
  color: var(--ink-muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.6;
}

.insights-time-trigger b {
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 400;
}

.insights-time-menu {
  margin-top: 20px;
  border-top: 1px solid var(--divider);
}

.insights-time-menu[hidden] {
  display: none;
}

.insights-time-option {
  width: calc(100% + 16px);
  margin-left: -8px;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 13px 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  font-family: inherit;
  text-align: left;
}

.insights-time-option:hover {
  background: rgba(26, 22, 18, 0.05);
}

.insights-time-option span {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.insights-time-option strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.insights-time-option em {
  color: var(--ink-muted);
  font-size: 12px;
  font-style: normal;
}

.insights-time-option b {
  min-width: 16px;
  color: var(--ink);
  font-weight: 400;
}

.insights-custom-dates {
  margin-top: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.insights-custom-dates[hidden] {
  display: none;
}

.insights-custom-dates input {
  border: 0;
  border-bottom: 1px solid var(--divider-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 0 7px;
  outline: none;
  font-family: inherit;
  font-size: 15px;
}

.insights-custom-dates span {
  color: var(--ink-muted);
  font-size: 14px;
}

.insights-date-hint {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.7;
}

.insights-date-hint[hidden] {
  display: none;
}

.insights-perspective-list {
  display: grid;
  gap: 16px;
}

.insights-perspective-row {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  text-align: left;
}

.insights-perspective-row.custom {
  justify-content: space-between;
  gap: 14px;
}

.insights-perspective-row.custom > button:first-child {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  text-align: left;
}

.insights-perspective-row span:not(.insights-checkbox) {
  font-size: 16px;
  line-height: 1.65;
}

.insights-perspective-row .remove {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  opacity: 0;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.insights-perspective-row.custom:hover .remove {
  opacity: 1;
}

.insights-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink);
  color: transparent;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.insights-checkbox.checked {
  background: var(--ink);
  color: #fff;
}

.insights-add-question {
  margin-top: 22px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.insights-add-question[hidden] {
  display: none;
}

.insights-add-question-form {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.insights-add-question-form[hidden] {
  display: none;
}

.insights-add-question-form input {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 0 7px;
  outline: none;
  font-family: inherit;
  font-size: 15px;
}

.insights-add-question-form button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 0 7px;
  white-space: nowrap;
}

.insights-add-question-form button.primary {
  color: var(--ink);
}

.insights-add-question-form button:disabled {
  color: var(--ink-faint);
  cursor: default;
}

.insights-generator-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--divider-strong);
  padding: 20px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.insights-generator-foot span {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}

.insights-generator-foot button {
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.insights-generator-foot button:disabled {
  cursor: default;
  opacity: 0.4;
}

.insights-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  overflow-y: auto;
  background: var(--bg);
}

.insights-detail-overlay.open {
  display: block;
}

.insights-detail-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 64px 48px 96px;
}

.insights-detail-back {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  margin: 0 0 48px;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.6;
}

.insights-detail-head {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--divider-strong);
}

.insights-detail-source {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.insights-detail-head h1 {
  margin: 18px 0 28px;
  color: var(--ink);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.insights-detail-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.insights-detail-section {
  margin-bottom: 80px;
}

.insights-detail-marker {
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}

.insights-detail-section h2 {
  margin: 0 0 40px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

.insights-detail-conclusion {
  margin-bottom: 48px;
  color: var(--ink);
  font-size: 18px;
  line-height: 2;
}

.insights-detail-evidence-title {
  margin-bottom: 20px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.insights-detail-evidence p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 15px;
  line-height: 1.7;
}

.insights-detail-evidence p span:first-child {
  color: var(--ink-faint);
}

.insights-detail-actions {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--divider-strong);
  display: flex;
  align-items: center;
  gap: 24px;
}

.insights-detail-actions button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.insights-detail-actions button:disabled {
  cursor: default;
  color: var(--ink-faint);
}

.insights-detail-actions button.danger {
  margin-left: auto;
  color: var(--ink-muted);
}

@media (max-width: 780px) {
  .insights-view .page-frame.insights-v13 {
    padding: 34px 20px 120px;
  }

  .insights-v13-header {
    margin-bottom: 28px;
  }

  .insights-v13-header h1 {
    font-size: 31px;
  }

  .insights-v13-header p {
    margin-top: 22px;
    font-size: 17px;
    line-height: 1.75;
  }

  .insights-v13-hero img {
    aspect-ratio: 16 / 7;
  }

  .insights-v13-cta {
    margin-bottom: 28px;
    padding: 28px 0;
  }

  .insights-v13-filter {
    margin-top: 14px;
    margin-bottom: 30px;
    padding-bottom: 18px;
    gap: 24px;
    font-size: 16px;
  }

  .insights-v13-filter span {
    font-size: 13px;
  }

  .insights-report-row {
    padding: 26px 0;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 20px;
  }

  .insights-report-source {
    display: none;
  }

  .insights-report-main h2 {
    font-size: 18px;
  }

  body[data-insight-rows="tei"] .insights-v13-list {
    gap: 12px;
    padding-top: 0;
  }

  body[data-insight-rows="tei"] .insights-report-row {
    min-height: 82px;
    padding: 18px 16px;
    grid-template-columns: 82px minmax(0, 1fr) 22px;
    gap: 15px;
  }

  body[data-insight-rows="tei"] .insights-report-date div:first-child {
    font-size: 14px;
    letter-spacing: 0.08em;
  }

  body[data-insight-rows="tei"] .insights-report-date div:last-child {
    margin-top: 5px;
    font-size: 10px;
  }

  body[data-insight-rows="tei"] .insights-report-main h2 {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.45;
  }

  body[data-insight-rows="tei"] .insights-report-main p,
  body[data-insight-rows="tei"] .insights-report-tags {
    font-size: 11px;
    line-height: 1.55;
  }

  body[data-insight-rows="tei"] .insights-report-source {
    display: flex;
  }

  body[data-insight-rows="tei"] .insights-report-source b {
    font-size: 22px;
  }

  .insights-generator-overlay {
    align-items: flex-start;
    padding: 24px 14px;
  }

  .insights-generator {
    max-height: calc(100vh - 48px);
  }

  .insights-generator-head,
  .insights-generator-body,
  .insights-generator-foot {
    padding-left: 24px;
    padding-right: 24px;
  }

  .insights-generator-head h2 {
    font-size: 20px;
  }

  .insights-time-trigger {
    flex-wrap: wrap;
  }

  .insights-time-option span {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .insights-perspective-row .remove {
    opacity: 1;
  }

  .insights-generator-foot button {
    width: 100%;
  }

  .insights-detail-shell {
    padding: 44px 24px 84px;
  }

  .insights-detail-head h1 {
    font-size: 32px;
  }

  .insights-detail-section h2 {
    font-size: 24px;
  }

  .insights-detail-conclusion {
    font-size: 17px;
  }
}

.desktop-only {
  display: inline;
}

@media (max-width: 900px) and (min-width: 781px) {
  .card-detail-overlay {
    padding: 32px 16px;
  }

  .card-detail-dialog {
    max-height: calc(100vh - 64px);
    min-height: min(620px, calc(100vh - 64px));
  }

  .card-detail-header {
    padding: 28px 32px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 18px;
  }

  .card-detail-back {
    width: 22px;
    height: 22px;
    font-size: 20px;
  }

  .card-detail-date {
    font-size: 12px;
  }

  .card-detail-headline h2 {
    margin-top: 8px;
    gap: 22px;
    font-size: 22px;
  }

  .card-detail-headline p {
    margin-top: 8px;
    font-size: 12px;
  }

  .card-detail-tabs {
    min-height: 56px;
    padding: 20px 32px 0;
    gap: 34px;
  }

  .card-detail-tab {
    padding-bottom: 16px;
    font-size: 17px;
  }

  .card-detail-tab::after {
    width: 100%;
  }

  .card-detail-body {
    padding: 38px 32px 44px;
  }

  .card-detail-hint {
    margin-bottom: 20px;
    font-size: 12px;
  }

  .card-detail-text {
    min-height: 220px;
    font-size: 18px;
    line-height: 2;
  }

  .card-detail-text.extracted {
    font-size: 18px;
    line-height: 2;
  }

  .card-detail-actions {
    min-height: 60px;
    padding: 18px 32px;
    justify-content: flex-end;
    gap: 24px;
  }

  .card-detail-actions button {
    font-size: 15px;
  }

  .card-detail-actions button.primary {
    min-width: 92px;
    height: 40px;
  }
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes busyDot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.28;
  }

  40% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

@media (max-width: 780px) {
  .header-inner {
    height: 76px;
    padding: 0 20px;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
  }

  .brand-title {
    font-size: 19px;
    letter-spacing: 0.08em;
  }

  .tab-nav {
    gap: 24px;
  }

  .tab-button span {
    font-size: 20px;
  }

  .version-label {
    display: none;
  }

  .page-frame {
    padding: 34px 20px 176px;
  }

  body[data-ask-map="page"] .ask-view::before {
    top: 76px;
    right: -210px;
    width: 780px;
    background-position: right top 82px;
    opacity: 0.42;
  }

  body[data-ask-map="right"] .ask-view::before {
    top: 118px;
    right: -395px;
    width: 740px;
    opacity: 0.44;
  }

  body[data-ask-map="detail"] .ask-past-panel::before {
    top: -56px;
    right: -460px;
    width: 820px;
    opacity: 0.34;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
    margin-bottom: 34px;
  }

  .page-header h1 {
    font-size: 40px;
  }

  .page-header p {
    font-size: 16px;
  }

  .connection-panel {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .status-row {
    justify-content: flex-start;
  }

  .ask-session-nav {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 34px;
    font-size: 17px;
  }

  .ask-session-tabs {
    gap: 20px;
    min-width: 0;
  }

  .ask-history-row {
    grid-template-columns: 72px 1fr 48px;
    gap: 18px;
    padding: 24px 0;
  }

  .ask-history-arrow {
    display: block;
    font-size: 12px;
  }

  .ask-history-title {
    font-size: 17px;
  }

  .ask-past-header h2 {
    font-size: 23px;
  }

  .ask-past-message.user {
    padding-left: 20px;
  }

  .ask-past-message-text,
  .ask-past-message.user .ask-past-message-text {
    font-size: 17px;
    line-height: 1.95;
  }

  .prompt-list {
    gap: 16px 24px;
    margin-bottom: 42px;
  }

  .prompt-chip {
    font-size: 17px;
  }

  .welcome-message {
    margin-bottom: 46px;
    padding: 28px 0 32px;
  }

  .welcome-message h2 {
    font-size: 30px;
  }

  .message-row {
    margin-bottom: 48px;
  }

  .message.user {
    padding-left: 22px;
    font-size: 18px;
  }

  .message.agent {
    font-size: 17px;
  }

  .composer {
    padding: 18px 20px max(18px, env(safe-area-inset-bottom));
  }

  .composer-inner {
    width: min(620px, 100%);
    min-height: 66px;
    padding: 0;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0;
    border: 1px solid var(--divider);
    border-radius: 0;
    background: var(--surface-input);
    box-shadow: 0 18px 42px rgba(60, 52, 42, 0.06);
  }

  .composer-status {
    left: 20px;
    right: 20px;
  }

  .composer-hint {
    display: none;
  }

  .voice-label,
  .desktop-only {
    display: none;
  }

  .voice-button,
  .tool-button {
    width: 62px;
    height: 62px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-soft);
  }

  .voice-button:hover:not(:disabled),
  .tool-button:hover:not(:disabled) {
    color: var(--ink);
    background: rgba(26, 22, 18, 0.04);
  }

  .voice-icon {
    width: 22px;
    height: 22px;
  }

  .keyboard-icon {
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
  }

  .composer.mobile-voice-mode .keyboard-icon {
    display: inline-flex;
  }

  .composer.mobile-voice-mode .voice-icon,
  .composer.mobile-voice-mode textarea,
  .composer.mobile-voice-mode .send-button {
    display: none;
  }

  .composer.mobile-text-mode .keyboard-icon,
  .composer.mobile-text-mode .ask-voice-hold-button,
  .composer.mobile-text-mode .tool-menu-wrap {
    display: none;
  }

  .composer.mobile-text-mode .voice-icon {
    display: inline-flex;
  }

  .ask-voice-hold-button {
    min-width: 0;
    height: 62px;
    border: 0;
    border-left: 1px solid rgba(207, 201, 188, 0.4);
    border-right: 1px solid rgba(207, 201, 188, 0.4);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 0.12em;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .composer.mobile-voice-mode .ask-voice-hold-button {
    display: inline-flex;
  }

  .ask-voice-hold-button.is-pressing {
    background: rgba(26, 22, 18, 0.1);
    box-shadow: inset 0 0 0 1px rgba(26, 22, 18, 0.08), inset 0 10px 24px rgba(26, 22, 18, 0.06);
    transform: translateY(1px);
  }

  .ask-voice-hold-button:disabled,
  .ask-voice-hold-button.is-busy {
    color: var(--ink-faint);
    cursor: not-allowed;
    background: rgba(26, 22, 18, 0.035);
  }

  .composer.mobile-voice-mode .composer-inner {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .composer.mobile-text-mode .composer-inner {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .tool-menu-wrap {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
  }

  .composer.mobile-voice-mode .tool-menu-wrap {
    display: none;
  }

  .tool-menu {
    position: absolute;
    right: 0;
    bottom: 58px;
    min-width: 150px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(60, 52, 42, 0.12);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .tool-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .tool-menu-item {
    width: 100%;
    min-height: 38px;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-align: left;
  }

  .tool-menu-icon {
    width: 18px;
    color: var(--ink-muted);
    text-align: center;
  }

  .send-button {
    font-size: 14px;
  }

  .composer textarea {
    font-size: 16px;
    min-height: 62px;
    padding: 18px 8px 16px;
  }

  .primary-action {
    width: 100%;
  }

  .ask-view .page-header,
  .diary-view .page-header {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 34px;
    margin-bottom: 34px;
    gap: 18px;
  }

  .ask-view .page-header > div,
  .diary-view .page-header > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .ask-view .page-header h1,
  .diary-view .page-header h1 {
    font-size: 31px;
  }

  .ask-view .page-header p,
  .diary-view .page-header p {
    margin-top: 22px;
    font-size: 17px;
    line-height: 1.75;
  }

  .diary-voice-button,
  .diary-text-button,
  .diary-save-button,
  .diary-cancel-text-button {
    height: 48px;
    padding: 0 8px;
    gap: 7px;
    font-size: 16px;
  }

  .diary-record-icon,
  .diary-text-icon,
  .diary-save-icon {
    width: 18px;
    height: 18px;
  }

  .diary-composer {
    margin-top: -8px;
    padding: 12px;
  }

  .diary-entry-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .diary-text-panel {
    margin-top: 12px;
    padding-top: 12px;
  }

  .diary-composer textarea {
    min-height: 104px;
    font-size: 16px;
  }

  .diary-audio-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .diary-composer-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .diary-filter-bar {
    margin-top: 14px;
    margin-bottom: 30px;
    padding-bottom: 18px;
    align-items: flex-end;
    flex-direction: row;
    gap: 12px;
  }

  .diary-filter-tabs {
    gap: 22px;
  }

  .diary-filter {
    font-size: 16px;
  }

  .diary-count {
    font-size: 13px;
  }

  .diary-row {
    padding: 34px 0 38px;
  }

  .diary-row-date {
    gap: 8px;
  }

  .diary-row-date-main {
    font-size: 17px;
  }

  .diary-row-time {
    margin-top: 10px;
  }

  .diary-row-location {
    font-size: 13px;
  }

  .diary-row-content {
    margin-top: 40px;
    gap: 14px;
  }

  .diary-row-image {
    aspect-ratio: 16 / 9;
  }

  .diary-row-headline,
  .diary-row-extracted {
    font-size: 24px;
    line-height: 1.62;
  }

  .diary-row-preview {
    font-size: 15px;
    line-height: 1.85;
  }

  .diary-row-foot {
    margin-top: 2px;
    font-size: 12px;
  }

  .insights-hero {
    padding-bottom: 36px;
  }

  .insights-hero h1 {
    font-size: 31px;
  }

  .insights-hero p {
    margin-top: 22px;
    font-size: 17px;
    line-height: 1.75;
  }

  .insights-hero-image {
    margin-top: 34px;
  }

  .insights-source-note {
    font-size: 13px !important;
  }

  .insights-source-strip {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .insights-source-item {
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--divider);
  }

  .insights-source-item + .insights-source-item {
    padding-left: 0;
  }

  .insights-source-item:last-child {
    border-bottom: 0;
  }

  .insights-source-item strong {
    font-size: 17px;
  }

  .insights-mode-button {
    min-height: 42px;
    font-size: 14px;
  }

  .insights-range-bar {
    min-height: auto;
    padding: 26px 0 24px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px 24px;
  }

  .insights-range {
    font-size: 16px;
  }

  .insights-range-meta {
    width: 100%;
    margin-left: 0;
    font-size: 12px;
  }

  .insights-range-custom {
    padding: 22px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .insights-range-input {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .insights-workbench {
    padding: 40px 0 48px;
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .insights-panel-heading h2,
  .insights-section-title h2 {
    font-size: 21px;
  }

  .insights-question-list {
    margin-top: 24px;
  }

  .insights-question {
    padding: 16px 0;
    font-size: 16px;
  }

  .insights-generate {
    height: 54px;
    font-size: 15px;
  }

  .insights-report {
    border-left: 0;
    border-top: 1px solid var(--divider);
    padding: 38px 0 0;
  }

  .insights-report-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
  }

  .insights-report h2 {
    margin-top: 28px;
    font-size: 29px;
  }

  .insights-report-lead {
    font-size: 20px;
    line-height: 1.8;
  }

  .insights-report-block {
    margin-top: 30px;
    padding-top: 24px;
  }

  .insights-report-block p {
    font-size: 16px;
  }

  .insights-report-actions {
    gap: 12px;
  }

  .insights-report-action {
    width: 100%;
    min-height: 48px;
    font-size: 14px;
  }

  .insights-discovery,
  .insights-lines {
    padding: 42px 0;
  }

  .insights-topic {
    min-height: 96px;
    padding: 22px 0;
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  .insights-topic strong {
    font-size: 20px;
    line-height: 1.65;
  }

  .insights-topic em {
    font-size: 12px;
  }

  .insights-topic b {
    font-size: 20px;
  }

  .insights-line-list {
    margin-top: 38px;
    gap: 42px;
  }

  .insights-line-list blockquote {
    font-size: 21px;
    line-height: 1.78;
  }

  .insights-line-list figcaption {
    font-size: 12px;
  }

  .recording-overlay {
    padding: 18px;
  }

  .recording-dialog {
    min-height: 388px;
    padding: 58px 28px 46px;
  }

  .recording-title {
    font-size: 20px;
  }

  .recording-time {
    margin-top: 36px;
    gap: 16px;
    font-size: 29px;
  }

  .recording-help {
    margin-top: 60px;
    font-size: 21px;
  }

  .recording-actions {
    width: 100%;
    margin-top: 54px;
    gap: 24px;
  }

  .recording-cancel,
  .recording-complete {
    flex: 1 1 0;
    min-width: 0;
    height: 58px;
    font-size: 22px;
  }

  .card-detail-overlay {
    padding: 20px 12px;
  }

  .card-detail-dialog {
    min-height: min(620px, calc(100vh - 40px));
    max-height: calc(100vh - 40px);
  }

  .card-detail-header {
    padding: 24px 24px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 16px;
  }

  .card-detail-back {
    width: 22px;
    height: 22px;
    font-size: 20px;
  }

  .card-detail-date {
    font-size: 12px;
  }

  .card-detail-headline h2 {
    margin-top: 8px;
    gap: 18px;
    font-size: 22px;
  }

  .card-detail-headline p {
    margin-top: 8px;
    font-size: 12px;
  }

  .card-detail-tabs {
    min-height: 56px;
    padding: 20px 24px 0;
    gap: 32px;
  }

  .card-detail-tab {
    padding-bottom: 16px;
    font-size: 17px;
  }

  .card-detail-tab::after {
    width: 100%;
  }

  .card-detail-body {
    padding: 36px 24px 42px;
  }

  .card-detail-hint {
    margin-bottom: 20px;
    font-size: 12px;
  }

  .card-detail-text {
    min-height: 220px;
    font-size: 18px;
    line-height: 2;
  }

  .card-detail-text.extracted {
    font-size: 18px;
    line-height: 2;
  }

  .card-detail-actions {
    min-height: 60px;
    padding: 18px 24px;
    justify-content: flex-end;
    gap: 22px;
  }

  .card-detail-actions button {
    font-size: 15px;
  }

  .card-detail-actions button.primary {
    min-width: 90px;
    height: 40px;
  }

  .app-confirm-dialog {
    padding: 34px 28px 28px;
  }

  .app-confirm-dialog h2 {
    font-size: 23px;
  }

  .app-confirm-dialog p {
    font-size: 16px;
  }

  .app-confirm-actions {
    justify-content: space-between;
    gap: 18px;
  }

  .app-confirm-actions button {
    flex: 1 1 0;
  }
}

/* xiaoke mobile action bar hotfix 20260517 */
.content-action-button{white-space:nowrap;}
@media (max-width:780px){.content-action-group{flex-wrap:nowrap;justify-content:space-between;gap:0;font-size:13px}.content-action-button{flex:0 1 auto;min-width:0;gap:5px;letter-spacing:0}.action-icon{width:16px;height:16px;flex-basis:16px}}
