:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-warm: #f5efe7;
  --surface-mint: #eaf3ef;
  --surface-blue: #edf2fb;
  --surface-yellow: #f7efd6;
  --ink: #242424;
  --muted: #6c6761;
  --line: #ddd6cf;
  --line-strong: #2b2b2b;
  --teal: #2e7d73;
  --teal-dark: #1f635b;
  --coral: #b96a4c;
  --blue: #4d6da9;
  --gold: #9a7624;
  --danger: #a94135;
  --shadow: 0 20px 50px rgba(40, 36, 30, 0.1);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.app {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(234, 243, 239, 0.95), rgba(251, 250, 247, 0) 340px),
    var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid rgba(36, 36, 36, 0.1);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px clamp(16px, 4vw, 44px);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.brand-title {
  font-size: 18px;
  font-weight: 850;
  white-space: nowrap;
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.brand-subtitle {
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px clamp(16px, 4vw, 44px) 56px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

.btn,
.icon-btn,
.avatar-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.btn:hover:not(:disabled),
.avatar-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-dark);
}

.btn-ghost,
.icon-btn,
.avatar-btn {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--line);
  color: var(--ink);
}

.wide {
  width: 100%;
}

.icon-btn {
  font-size: 20px;
  height: 42px;
  padding: 0;
  width: 42px;
}

.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.input,
.textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 46px;
  outline: none;
  padding: 11px 13px;
  width: 100%;
}

.textarea {
  line-height: 1.62;
  min-height: 132px;
  resize: vertical;
}

.textarea.compact {
  min-height: 92px;
}

.input:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46, 125, 115, 0.16);
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.status {
  border-radius: 8px;
  display: none;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
  padding: 10px 12px;
}

.status.show {
  display: block;
}

.status.error {
  background: #fae9e5;
  color: var(--danger);
}

.status.ok {
  background: #e9f5ef;
  color: var(--teal-dark);
}

.panel,
.auth-panel,
.chat-panel,
.upload-module,
.question-card,
.today-card,
.create-journal,
.photo-folder-section,
.photo-modal,
.loading-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(36, 36, 36, 0.11);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.auth-page {
  align-items: center;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: calc(100vh - 68px);
}

.auth-copy h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1;
  margin-bottom: 18px;
  max-width: 760px;
}

.auth-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
  max-width: 640px;
}

.auth-panel {
  padding: 24px;
}

.auth-tabs {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  padding: 4px;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  min-height: 40px;
}

.tab-button.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.page-heading {
  margin-bottom: 22px;
  max-width: 780px;
}

.page-heading h1 {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.08;
  margin-bottom: 12px;
}

.page-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.upload-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.upload-module {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.upload-module h2,
.panel h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.upload-module p,
.panel p,
.profile-card p {
  color: var(--muted);
  line-height: 1.65;
}

.upload-preview-row,
.media-strip,
.modal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.thumb {
  margin: 0;
  width: 86px;
}

.thumb img,
.media-strip img,
.modal-thumbs img {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 86px;
}

.thumb figcaption {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-empty,
.empty {
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 88px;
  padding: 16px;
  text-align: center;
}

.empty.small {
  min-height: 72px;
}

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

.bps-manual-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  padding-top: 18px;
}

.manual-heading {
  grid-column: 1 / -1;
}

.manual-heading h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.manual-heading p:last-child {
  color: var(--muted);
  margin: 0;
}

.question-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.question-card span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
}

.question-card strong {
  font-size: 15px;
  line-height: 1.45;
}

.voice-textarea-wrap {
  position: relative;
}

.voice-textarea-wrap .textarea {
  padding-bottom: 42px;
  padding-right: 54px;
}

.question-voice-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 12px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 12px;
  width: 34px;
}

.question-voice-btn.recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.voice-inline-status {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(46, 125, 115, 0.18);
  border-radius: 999px;
  bottom: 14px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
  left: 12px;
  line-height: 1;
  max-width: calc(100% - 62px);
  overflow: hidden;
  padding: 7px 9px;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-footer {
  grid-column: 1 / -1;
}

.bps-chat-page {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: calc(100vh - 150px);
  overflow: hidden;
}

.chat-heading,
.panel-heading {
  align-items: center;
  border-bottom: 1px solid rgba(36, 36, 36, 0.08);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
}

.panel-heading.flat {
  border-bottom: 0;
  padding: 0 0 14px;
}

.chat-heading h2,
.panel-heading h1,
.panel-heading h2 {
  margin: 0;
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.62;
  max-width: min(720px, 88%);
  padding: 12px 14px;
  white-space: pre-wrap;
}

.message.assistant {
  align-self: flex-start;
  background: var(--surface-warm);
}

.message.user {
  align-self: flex-end;
  background: var(--surface-mint);
  border-color: rgba(46, 125, 115, 0.25);
}

.composer {
  border-top: 1px solid rgba(36, 36, 36, 0.08);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  padding: 14px;
}

.composer .textarea {
  max-height: 140px;
  min-height: 48px;
}

.voice-status {
  color: var(--teal-dark);
  display: none;
  font-size: 13px;
  font-weight: 750;
  grid-column: 1 / -1;
  line-height: 1.45;
}

.voice-status.show {
  display: block;
}

.profile-preview {
  align-self: start;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.summary-list div {
  border-top: 1px solid rgba(36, 36, 36, 0.1);
  padding-top: 10px;
}

.summary-list span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
}

.summary-list p {
  line-height: 1.55;
  margin: 0;
}

.home-screen {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1040px;
  min-height: calc(100vh - 68px);
  padding: 30px clamp(16px, 4vw, 44px) 34px;
}

.home-header {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.home-header h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  margin: 0;
}

.home-header p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 420px;
}

.home-card-area {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 520px;
}

.today-card {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
  max-width: 900px;
  min-height: 450px;
  padding: 22px;
  width: 100%;
}

.today-card.filled {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(234, 243, 239, 0.92));
}

.today-card.empty-create {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 640px;
  text-align: center;
}

.empty-plus {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-dark);
  display: flex;
  font-size: 42px;
  height: 82px;
  justify-content: center;
  margin-bottom: 12px;
  width: 82px;
}

.card-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  grid-column: 1 / -1;
}

.today-card-body {
  align-self: center;
}

.today-card-body h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  margin: 14px 0 12px;
}

.today-card-body p,
.today-card-body strong {
  display: block;
  font-size: 16px;
  line-height: 1.72;
}

.today-card-body strong {
  color: var(--teal-dark);
  margin-top: 16px;
}

.timeline {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(9, minmax(64px, 1fr));
  overflow-x: auto;
  padding: 4px 0;
}

.timeline-node {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  min-height: 66px;
  min-width: 64px;
  padding: 10px 8px;
  place-items: center;
}

.timeline-node.active {
  border-color: var(--teal);
  color: var(--ink);
}

.timeline-node i {
  background: #d9d2c9;
  border-radius: 999px;
  display: block;
  height: 8px;
  width: 8px;
}

.timeline-node i.done {
  background: var(--teal);
}

.avatar-btn {
  border-radius: 999px;
  height: 44px;
  padding: 0;
  width: 44px;
}

.avatar {
  align-items: center;
  background: var(--surface-yellow);
  border: 1px solid rgba(36, 36, 36, 0.12);
  border-radius: 999px;
  color: var(--gold);
  display: inline-flex;
  font-weight: 850;
  height: 40px;
  justify-content: center;
  object-fit: cover;
  width: 40px;
}

.avatar.large {
  font-size: 44px;
  height: 160px;
  width: 160px;
}

.profile-page {
  display: grid;
  gap: 18px;
}

.profile-hero {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: auto minmax(0, 1fr);
}

.profile-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin-bottom: 12px;
}

.profile-hero p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

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

.profile-card {
  min-height: 170px;
}

.media-edit-card {
  display: grid;
  gap: 14px;
}

.profile-comic-card {
  align-content: start;
  display: grid;
  gap: 14px;
}

.profile-future-comic {
  margin: 0;
  max-height: 720px;
  min-height: 420px;
}

.profile-comic-empty {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 220px;
}

.profile-card-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.profile-card-heading h2 {
  margin: 0;
}

.profile-card-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.media-actions .btn {
  flex: 1;
  min-width: 140px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(36, 36, 36, 0.1);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 10px;
}

.detail-page {
  display: grid;
  gap: 18px;
}

.detail-toolbar {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.detail-toolbar h1 {
  font-size: clamp(30px, 4vw, 48px);
  margin: 0;
}

.segmented {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
  min-width: 260px;
  padding: 4px;
}

.segmented button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  min-height: 40px;
}

.segmented button.active {
  background: var(--surface);
  color: var(--ink);
}

.detail-surface {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
}

.detail-copy {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(36, 36, 36, 0.1);
  border-radius: 8px;
  padding: 22px;
}

.detail-copy h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.detail-copy p {
  line-height: 1.76;
}

.identity-signal {
  background: rgba(232, 244, 238, 0.82);
  border: 1px solid rgba(36, 107, 94, 0.2);
  border-radius: 8px;
  margin: 8px 0 14px;
  padding: 12px 14px;
}

.identity-signal span {
  color: var(--green);
  display: block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
}

.identity-signal p {
  margin: 0;
}

.underline-instruction {
  color: var(--muted);
  font-size: 14px;
}

.underline-text {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
}

.underline-piece {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  line-height: 1.8;
  padding: 0 2px 3px;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 4px;
  text-underline-offset: 3px;
}

.underline-piece.saved {
  background: rgba(247, 239, 214, 0.72);
  text-decoration-color: var(--gold);
}

.saved-lines {
  background: var(--surface-yellow);
  border: 1px solid rgba(154, 118, 36, 0.2);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px;
}

.saved-lines span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.saved-lines p {
  margin: 8px 0 0;
}

.comic-board {
  aspect-ratio: 4 / 5;
  background: #fff;
  border: 1px solid rgba(36, 36, 36, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  min-height: 330px;
  padding: 12px;
}

.mini-comic .comic-board {
  min-height: 300px;
}

.generated-comic-image {
  aspect-ratio: 4 / 5;
  background: #fff;
  border: 1px solid rgba(36, 36, 36, 0.14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  min-height: 330px;
  object-fit: contain;
  padding: 8px;
  width: 100%;
}

.mini-comic .generated-comic-image {
  min-height: 300px;
}

.comic-panel {
  background: var(--surface-warm);
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.comic-panel span {
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(36, 36, 36, 0.16);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  padding: 8px;
}

.panel-art {
  background:
    radial-gradient(circle at 28% 36%, rgba(36, 36, 36, 0.18) 0 12px, transparent 13px),
    radial-gradient(circle at 58% 52%, rgba(46, 125, 115, 0.32) 0 24px, transparent 25px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 239, 231, 0.9));
}

.comic-board.bps .panel-art {
  background:
    radial-gradient(circle at 30% 36%, rgba(46, 125, 115, 0.28) 0 14px, transparent 15px),
    radial-gradient(circle at 62% 50%, rgba(77, 109, 169, 0.24) 0 26px, transparent 27px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(234, 243, 239, 0.95));
}

.art-2 {
  filter: saturate(0.9);
}

.art-3 {
  filter: hue-rotate(16deg);
}

.art-4 {
  filter: saturate(1.15) brightness(1.02);
}

.create-page {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.create-page.ready {
  max-width: 1180px;
}

.create-workspace {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
}

.reality-preview-panel {
  align-self: start;
  padding: 12px;
}

.reality-preview-panel .generated-comic-image {
  display: block;
  width: 100%;
}

.create-journal,
.photo-folder-section {
  padding: 20px;
}

.diary-textarea {
  min-height: 280px;
}

.folder-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.folder-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 174px;
  padding: 10px;
  text-align: left;
}

.folder-card img,
.folder-empty {
  aspect-ratio: 4 / 3;
  background: var(--surface-warm);
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.folder-card p {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  margin: 9px 0 4px;
}

.folder-card span {
  color: var(--muted);
  font-size: 12px;
}

.folder-card.add {
  align-items: center;
  border-style: dashed;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.folder-card.add span {
  color: var(--teal-dark);
  font-size: 36px;
}

.confirm-create {
  justify-self: stretch;
  min-height: 52px;
}

.create-page.ready .confirm-create {
  justify-self: end;
  min-width: 240px;
  padding-left: 28px;
  padding-right: 28px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(36, 36, 36, 0.32);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.photo-modal {
  max-height: calc(100vh - 36px);
  max-width: 560px;
  overflow: auto;
  padding: 20px;
  width: 100%;
}

.upload-drop {
  background: var(--surface-mint);
  border: 1px dashed var(--teal);
  border-radius: 8px;
  color: var(--teal-dark);
  font-weight: 850;
  min-height: 86px;
  width: 100%;
}

.modal-thumbs {
  margin: 12px 0;
}

.loading-page {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 68px);
  padding: 24px;
}

.loading-card {
  max-width: 520px;
  padding: 30px;
  text-align: center;
  width: 100%;
}

.loading-card h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 16px 0;
}

.loader {
  animation: spin 1s linear infinite;
  border: 4px solid rgba(46, 125, 115, 0.16);
  border-radius: 999px;
  border-top-color: var(--teal);
  height: 58px;
  margin: 0 auto;
  width: 58px;
}

.loading-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.loading-steps li {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
  padding: 10px;
}

.loading {
  animation: pulse 1.2s ease-in-out infinite;
}

.daily-analysis-panel {
  display: grid;
  gap: 18px;
}

.analysis-side {
  align-self: stretch;
  grid-template-rows: auto auto minmax(320px, 1fr) auto;
}

.daily-analysis-panel.muted {
  color: var(--muted);
}

.loader.small {
  height: 28px;
  margin: 0;
  width: 28px;
}

.analysis-summary {
  border-left: 4px solid var(--teal);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
  padding-left: 14px;
}

.locked-note {
  background: rgba(46, 125, 115, 0.08);
  border: 1px solid rgba(46, 125, 115, 0.2);
  border-radius: 8px;
  color: var(--teal);
  font-weight: 700;
  margin: 10px 0;
  padding: 10px 12px;
}

.analysis-answer-area {
  align-content: start;
  display: grid;
  gap: 12px;
  min-height: 0;
}

.analysis-questionnaire {
  display: grid;
  gap: 12px;
}

.future-point {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.future-point.selected {
  background: rgba(46, 125, 115, 0.08);
  border-color: rgba(46, 125, 115, 0.28);
}

.future-point label {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.future-point p {
  color: var(--muted);
  margin: 0;
}

.future-point .point-question {
  color: var(--muted);
  line-height: 1.5;
}

.point-evidence {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.point-domain {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-hint {
  color: var(--muted);
  margin: 0;
}

.create-materials {
  display: grid;
  gap: 14px;
}

.materials-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.create-materials .diary-textarea {
  min-height: 180px;
}

.create-materials .folder-card {
  min-height: 132px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .auth-page,
  .upload-grid,
  .questionnaire,
  .bps-manual-section,
  .bps-chat-page,
  .today-card,
  .profile-grid,
  .detail-surface,
  .create-workspace,
  .materials-grid {
    grid-template-columns: 1fr;
  }

  .home-header,
  .detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .top-actions .btn {
    flex: 1;
  }

  .page,
  .home-screen {
    padding-inline: 14px;
  }

  .auth-page {
    min-height: auto;
    padding-top: 24px;
  }

  .auth-copy h1 {
    font-size: 42px;
  }

  .composer {
    grid-template-columns: 1fr auto;
  }

  .composer .btn-primary {
    grid-column: 1 / -1;
  }

  .home-card-area {
    min-height: 420px;
  }

  .timeline {
    grid-template-columns: repeat(9, 66px);
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .avatar.large {
    height: 120px;
    width: 120px;
  }
}
