@font-face {
  font-family: "OPPO Sans";
  src: url("./assets/fonts/OPPOSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
}

@font-face {
  font-family: "OPPO Sans";
  src: url("./assets/fonts/OPPOSans-Heavy.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --paper: #f4f0e7;
  --paper-strong: #fcfaf4;
  --ink: #183027;
  --echo-ink: #1b3329;
  --muted: #68786f;
  --line: #ddd8cc;
  --green: #2f6652;
  --green-dark: #24523f;
  --sage: #dce7dc;
  --sage-deep: #a8beb0;
  --warm: #c97852;
  --danger: #b84537;
  --shadow: 0 18px 50px rgba(35, 47, 40, 0.075);
  --shadow-soft: 0 8px 24px rgba(35, 47, 40, 0.055);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 2%, rgba(220, 231, 220, .82), transparent 28rem),
    linear-gradient(118deg, #f8f5ed 0%, var(--paper) 58%, #eee8dc 100%);
  font-family: "OPPO Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(rgba(37, 70, 56, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 70, 56, .018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 204px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 20px 26px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(220, 221, 211, .9);
  background: rgba(247, 244, 236, .74);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 3px 12px rgba(24, 48, 39, .08);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: .02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 74px;
}

.nav-item {
  position: relative;
  padding: 13px 16px 13px 32px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .32;
  transform: translateY(-50%);
}

.nav-item.active {
  background: rgba(220, 231, 220, .82);
  color: var(--green);
  font-weight: 700;
}

.nav-item.active::before {
  width: 6px;
  height: 6px;
  opacity: 1;
  box-shadow: 0 0 0 5px rgba(47, 102, 82, .08);
}

.side-motto {
  margin: auto 0 28px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: .04em;
}

.side-note {
  margin-top: 0;
  padding: 18px 10px 0;
  border-top: 1px solid var(--line);
}

.side-note strong {
  font: 400 36px/1 "OPPO Sans", sans-serif;
  color: var(--green);
}

.side-note span,
.side-note p {
  color: var(--muted);
  font-size: 12px;
}

.side-note p {
  margin: 12px 0 0;
  line-height: 1.7;
}

.site-filing {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.site-filing a {
  width: fit-content;
  color: inherit;
  text-decoration: none;
  transition: color .18s ease;
}

.site-filing a:hover,
.site-filing a:focus-visible {
  color: var(--green);
}

.site-filing a:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(47, 102, 82, .24);
  outline-offset: 3px;
}

.site-filing-desktop {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 15px 10px 0;
  border-top: 1px solid var(--line);
}

.police-filing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.police-filing img {
  flex: 0 0 auto;
  width: 16px;
  height: 17px;
  object-fit: contain;
}

.site-filing-mobile {
  display: none;
}

main {
  min-width: 0;
  height: 100dvh;
  overflow: auto;
}

.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

#today-view {
  height: 100dvh;
  min-height: 0;
  padding: clamp(24px, 3.1vh, 38px) min(3.5vw, 56px) clamp(22px, 2.8vh, 34px);
  overflow: hidden;
}

#today-view.active {
  display: flex;
  flex-direction: column;
}

.topbar,
.simple-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}

.topbar {
  animation: page-in .46s ease both;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font: 500 clamp(34px, 3.5vw, 50px)/1.14 "OPPO Sans", sans-serif;
  letter-spacing: -.045em;
}

.hero-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .025em;
}

h2 {
  margin: 0;
  font: 500 24px/1.3 "OPPO Sans", sans-serif;
}

.pill-button,
.send-button,
.mini-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, background .18s ease, box-shadow .18s ease;
}

.pill-button {
  min-height: 38px;
  padding: 0 17px;
  border-radius: 999px;
}

.pill-button.subtle,
.mini-button {
  border-color: var(--line);
  background: rgba(251, 250, 246, .72);
  color: var(--ink);
}

.pill-button:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.pill-button:not(:disabled):hover,
.send-button:not(:disabled):hover,
.mini-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.chat-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(560px, 1.65fr) minmax(360px, .72fr);
  gap: clamp(18px, 1.7vw, 28px);
  align-items: stretch;
  margin-top: clamp(20px, 2.5vh, 28px);
}

.conversation-card,
.journal-preview,
.settings-card {
  border: 1px solid rgba(203, 204, 193, .78);
  border-radius: 22px;
  background: rgba(252, 250, 244, .78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.conversation-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: page-in .52s .05s ease both;
}

.card-heading {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 0 22px;
  border-bottom: 1px solid rgba(221, 216, 204, .9);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}

.card-heading > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-heading strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
}

.section-index {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.conversation {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px 26px;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    rgba(48, 82, 67, .035) 44px
  );
  background-position: 0 10px;
}

.message {
  max-width: 76%;
  display: flex;
  gap: 12px;
  animation: rise .24s ease both;
}

.message.user {
  justify-self: end;
  flex-direction: row-reverse;
}

.avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7e5d9;
  color: #214d3c;
  font: 600 15px "OPPO Sans", sans-serif;
}

.message.user .avatar {
  background: #dfd3c6;
  color: #795a47;
}

.bubble {
  padding: 13px 16px;
  border: 1px solid rgba(221, 216, 204, .7);
  border-radius: 5px 17px 17px;
  background: rgba(255, 254, 250, .94);
  color: var(--echo-ink);
  font-weight: 450;
  line-height: 1.75;
  box-shadow: 0 4px 14px rgba(38, 55, 46, .035);
}

.message.user .bubble {
  border-radius: 18px 4px 18px 18px;
  background: var(--green);
  color: white;
  box-shadow: 0 6px 16px rgba(47, 102, 82, .12);
}

.bubble p {
  margin: 0;
}

.bubble p + p {
  margin-top: 6px;
}

.typing {
  display: flex;
  gap: 5px;
  padding: 10px 4px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite alternate;
}

.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

.composer-panel {
  padding: 13px 16px 15px;
  border-top: 1px solid var(--line);
  background: rgba(246, 242, 233, .86);
}

.composer-label {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

textarea {
  width: 100%;
  min-height: 66px;
  max-height: 190px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  padding: 15px 16px;
  background: rgba(255, 254, 250, .9);
  color: var(--ink);
  line-height: 1.65;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(49, 95, 75, .58);
  box-shadow: 0 0 0 4px rgba(49, 95, 75, .08);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.send-button {
  min-height: 38px;
  padding: 0 22px;
  border-radius: 999px;
}

.journal-preview {
  height: 100%;
  margin-top: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: page-in .52s .11s ease both;
}

.journal-heading {
  padding-inline: 20px;
}

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

.journal-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-deep);
  box-shadow: 0 0 0 4px rgba(168, 190, 176, .16);
}

.journal-status b {
  font-weight: 400;
}

.journal-status.ready {
  color: var(--green);
}

.journal-status.ready i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 102, 82, .12);
}

.journal-preview-body {
  flex: 1;
  min-height: 0;
  padding: 0 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.preview-empty {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.preview-empty p {
  margin: 0;
  color: var(--echo-ink);
  font: 500 22px/1.55 "OPPO Sans", sans-serif;
  letter-spacing: -.02em;
}

.preview-empty span {
  max-width: 270px;
  font-size: 13px;
  line-height: 1.85;
}

.echo-rings {
  position: relative;
  width: 102px;
  height: 102px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
}

.echo-rings i {
  position: absolute;
  border: 1px solid rgba(47, 102, 82, .18);
  border-radius: 50%;
}

.echo-rings i:nth-child(1) { width: 102px; height: 102px; }
.echo-rings i:nth-child(2) { width: 74px; height: 74px; }
.echo-rings i:nth-child(3) { width: 48px; height: 48px; }

.echo-rings b {
  position: relative;
  z-index: 1;
  color: var(--green);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}

.paper {
  margin: 20px 0;
  padding: 30px 28px 26px;
  border: 1px solid rgba(221, 216, 204, .8);
  border-radius: 16px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
}

.paper h2 {
  margin-top: 30px;
  font-size: 30px;
}

.paper-content {
  margin-top: 22px;
}

.paper-content p {
  margin: 0 0 18px;
  font: 400 15px/1.95 "OPPO Sans", sans-serif;
  text-align: justify;
}

.takeaway {
  margin-top: 28px;
  padding: 18px 0 0 18px;
  border-top: 1px solid var(--line);
  border-left: 3px solid var(--green);
}

.takeaway span {
  color: var(--green);
  font-size: 11px;
  letter-spacing: .16em;
}

.takeaway p {
  margin: 8px 0 0;
  font: 400 16px/1.75 "OPPO Sans", sans-serif;
}

.paper-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.preview-generate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 13px 18px 14px;
  border-top: 1px solid var(--line);
}

.preview-generate-row > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
}

.generate-button {
  min-width: 122px;
}

.generate-button:disabled {
  border-color: transparent;
  background: #d6e1d8;
  color: #71837a;
  opacity: 1;
}

.simple-header {
  padding: 54px min(7vw, 86px) 34px;
  border-bottom: 1px solid var(--line);
}

.history-list,
.settings-grid {
  width: min(1020px, calc(100% - 48px));
}

.history-list,
.settings-grid {
  margin: 40px auto;
}

.setup-guide {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px !important;
  padding: 16px;
  border: 1px solid rgba(49, 95, 75, .24);
  border-radius: 18px;
  background: rgba(223, 232, 221, .66);
}

.setup-guide:not(.hidden) {
  display: grid;
}

.setup-guide strong {
  color: var(--echo-ink);
  font-size: 15px;
}

.setup-guide p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.guide-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 700;
}

.provider-help {
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.month-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 34px 0 8px;
}

.month-title h2 {
  font-size: 32px;
}

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

.history-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 10px;
  border-top: 1px solid var(--line);
}

.history-row time {
  min-height: 42px;
  display: grid;
  align-content: start;
  color: var(--muted);
}

.history-row time strong {
  color: var(--ink);
  font: 500 30px/1 "OPPO Sans", sans-serif;
}

.history-row time span,
.history-row p {
  font-size: 12px;
}

.history-row h3 {
  margin: 0 0 7px;
  font: 500 20px/1.35 "OPPO Sans", sans-serif;
}

.history-row p {
  margin: 0;
  color: var(--muted);
}

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

.mini-link:hover h3 {
  color: var(--green);
}

.history-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(184, 69, 55, .35);
  border-radius: 999px;
  background: rgba(184, 69, 55, .08);
  color: var(--danger);
  cursor: pointer;
}

.empty {
  padding: 80px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.detail-topbar {
  min-height: 106px;
  padding: 32px min(7vw, 86px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.detail-topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .14em;
}

.detail-reader {
  width: min(980px, calc(100% - 72px));
  margin: 0 auto;
  padding: clamp(54px, 7vw, 92px) 0 120px;
  display: grid;
  grid-template-columns: 116px minmax(0, 700px);
  gap: clamp(42px, 7vw, 88px);
  justify-content: start;
}

.detail-date-rail {
  padding-top: 10px;
  display: grid;
  align-content: start;
  color: var(--muted);
}

.detail-date-rail::before {
  content: "";
  width: 42px;
  height: 2px;
  margin-bottom: 22px;
  background: var(--green);
}

.detail-date-rail span {
  font-size: 12px;
  letter-spacing: .06em;
}

.detail-date-rail strong {
  margin: 10px 0 7px;
  color: var(--ink);
  font: 500 50px/1 "OPPO Sans", sans-serif;
}

.detail-article {
  min-width: 0;
  animation: page-in .46s ease both;
}

.detail-article > time {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
}

.detail-article h1 {
  max-width: 650px;
  margin-top: 22px;
  font-weight: 700;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.22;
}

.detail-body {
  margin-top: clamp(38px, 5vw, 58px);
  color: var(--echo-ink);
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.95;
  letter-spacing: .015em;
}

.detail-body p {
  margin: 0 0 1.45em;
}

.detail-takeaway {
  margin-top: 56px;
  padding: 26px 30px 28px;
  border-left: 3px solid var(--green);
  background: rgba(252, 250, 244, .56);
}

.detail-takeaway span {
  color: var(--green);
  font-size: 12px;
  letter-spacing: .14em;
}

.detail-takeaway p {
  margin: 12px 0 0;
  font-size: 17px;
  line-height: 1.8;
}

.detail-actions {
  margin-top: 34px;
  padding-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 20px;
  align-items: start;
}

#settings-view {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

#settings-view.active {
  display: flex;
  flex-direction: column;
}

#settings-view .simple-header {
  flex: 0 0 auto;
  padding: clamp(28px, 3.6vh, 42px) min(7vw, 86px) clamp(18px, 2.2vh, 26px);
}

#settings-view .settings-grid {
  flex: 1;
  min-height: 0;
  width: min(1080px, calc(100% - 48px));
  margin: clamp(16px, 2.2vh, 24px) auto clamp(22px, 3vh, 34px);
}

.settings-card {
  padding: 26px;
  display: grid;
  gap: 20px;
}

#settings-view .settings-card {
  padding: clamp(18px, 2.3vh, 24px);
  gap: clamp(12px, 1.6vh, 18px);
}

.settings-card:nth-child(2) {
  margin-top: 0;
}

.settings-card > div:first-child p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

#settings-view .settings-card > div:first-child p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.65;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  padding: 0 14px;
  background: rgba(251, 250, 246, .88);
  color: var(--ink);
}

select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M2 2l5 5 5-5' fill='none' stroke='%23315f4b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 17px center;
  background-size: 14px 9px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

select:hover {
  border-color: rgba(49, 95, 75, .34);
  background-color: rgba(255, 254, 250, .96);
}

select:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.secret-row,
.model-row {
  display: grid;
  gap: 8px;
}

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

#settings-view .model-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#settings-view label {
  gap: 6px;
}

#settings-view input,
#settings-view select {
  min-height: 42px;
}

.mini-button {
  min-width: 68px;
  border-radius: 14px;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(28, 41, 35, .92);
  color: white;
  box-shadow: var(--shadow);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  from { opacity: .3; transform: translateY(1px); }
  to { opacity: 1; transform: translateY(-1px); }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 16px 16px;
    width: auto;
    height: auto;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(220, 221, 211, .88);
    border-radius: 999px;
    box-shadow: var(--shadow);
  }

  .brand,
  .side-motto,
  .side-note,
  .site-filing-desktop {
    display: none;
  }

  .nav {
    margin: 0;
    grid-auto-flow: column;
  }

  .nav-item {
    padding: 10px 18px;
    text-align: center;
  }

  #today-view {
    height: auto;
    min-height: 100dvh;
    padding: 34px 18px 104px;
    overflow: visible;
  }

  #settings-view {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  #settings-view.active {
    display: block;
  }

  main {
    height: auto;
    overflow: visible;
  }

  .chat-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  #settings-view .model-row {
    grid-template-columns: 1fr;
  }

  .journal-preview {
    height: auto;
    margin-top: 0;
    min-height: 560px;
  }

  .conversation-card {
    min-height: 620px;
  }

  .settings-card:nth-child(2) {
    margin-top: 0;
  }

  .simple-header {
    padding: 38px 22px 28px;
  }

  .history-list,
  .settings-grid,
  .detail-reader {
    width: calc(100% - 36px);
    margin-bottom: 110px;
  }

  .detail-reader {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 34px;
  }

  .site-filing-mobile {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 16px;
    margin: -72px 18px 110px;
    padding: 18px 10px 0;
    border-top: 1px solid var(--line);
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .simple-header {
    display: grid;
  }

  .detail-topbar {
    min-height: 88px;
    padding: 22px 18px;
  }

  .detail-topbar p {
    font-size: 10px;
  }

  .detail-reader {
    width: calc(100% - 36px);
    margin-bottom: 84px;
    padding: 38px 0 70px;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .detail-date-rail {
    padding: 0 0 18px;
    grid-template-columns: auto auto 1fr;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px solid var(--line);
  }

  .detail-date-rail::before {
    display: none;
  }

  .detail-date-rail strong {
    margin: 0;
    font-size: 34px;
  }

  .detail-date-rail span:last-child {
    justify-self: end;
  }

  .detail-article h1 {
    margin-top: 20px;
  }

  .detail-body {
    margin-top: 34px;
    line-height: 1.9;
  }

  .detail-takeaway {
    margin-top: 44px;
    padding: 22px;
  }

  .detail-actions {
    justify-content: stretch;
  }

  .detail-actions .pill-button {
    flex: 1;
    padding-inline: 12px;
  }

  .nav-item::before {
    display: none;
  }

  .conversation-card .card-heading > span {
    display: none;
  }

  .conversation-card {
    height: 560px;
    min-height: 560px;
  }

  .conversation {
    gap: 16px;
    padding: 20px 18px;
  }

  .message {
    max-width: 88%;
  }

  .composer-panel {
    padding: 11px 16px 12px;
  }

  textarea {
    min-height: 54px;
  }

  .card-heading {
    padding-inline: 18px;
  }

  .preview-generate-row > span {
    display: none;
  }

  .preview-generate-row {
    justify-content: flex-end;
  }

  .composer-actions,
  .paper-actions,
  .button-row {
    flex-wrap: wrap;
  }

  .history-row {
    grid-template-columns: 56px 1fr;
  }

  .history-actions {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
