:root {
  color-scheme: light;
  --page: oklch(99.3% 0.002 96);
  --page-quiet: oklch(98.7% 0.003 96);
  --rail: oklch(99.1% 0.002 96 / 0.88);
  --surface: oklch(99.2% 0.002 96 / 0.84);
  --surface-raised: oklch(99.1% 0.002 96 / 0.9);
  --surface-muted: oklch(97.6% 0.003 96 / 0.72);
  --surface-warm: oklch(93.2% 0.03 82 / 0.8);
  --surface-cool: oklch(94.4% 0.018 145 / 0.76);
  --seal-green: oklch(89.4% 0.04 128);
  --seal-blue: oklch(91.2% 0.026 208);
  --ink: oklch(23.5% 0.012 78);
  --ink-soft: oklch(43.5% 0.014 84);
  --ink-muted: oklch(61.5% 0.012 88);
  --line: oklch(84.8% 0.012 88 / 0.76);
  --line-soft: oklch(88.8% 0.011 90 / 0.64);
  --line-strong: oklch(73.8% 0.024 105);
  --accent: oklch(55.5% 0.065 126);
  --accent-soft: oklch(89% 0.04 126);
  --cool: oklch(45% 0.035 156);
  --cool-soft: oklch(92% 0.026 150);
  --danger: oklch(43% 0.055 37);
  --danger-soft: oklch(93.4% 0.028 42);
  --focus: oklch(50% 0.035 215);
  --shadow-paper: 0 24px 80px oklch(38% 0.02 90 / 0.07);
  --shadow-card: 0 14px 42px oklch(36% 0.018 90 / 0.055);
  --shadow-card-hover: 0 24px 68px oklch(34% 0.018 90 / 0.09);
  --radius: 22px;
  --radius-small: 6px;
  --radius-panel: 30px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "PingFang SC",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  text-rendering: geometricPrecision;
}

body.auth-pending .app-shell,
body.auth-required .app-shell {
  visibility: hidden;
}

body.auth-required {
  overflow: hidden;
}

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

button {
  color: inherit;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(140deg, oklch(99.2% 0.003 96), oklch(97.5% 0.006 108)),
    var(--page);
}

.login-card {
  width: min(100%, 27rem);
  padding: 2.25rem;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-paper);
}

.login-kicker {
  margin: 0 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.login-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 2.15rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-copy {
  margin: 0.8rem 0 1.75rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.login-form {
  display: grid;
  gap: 0.7rem;
}

.login-form label {
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.login-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.login-field input {
  min-height: 3.1rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(99.4% 0.002 96);
  color: var(--ink);
  padding: 0 1rem;
  outline: none;
}

.login-field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px oklch(70% 0.03 200 / 0.16);
}

.login-field button {
  min-height: 3.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: oklch(98% 0.006 100);
  cursor: pointer;
  font-weight: 760;
  padding: 0 1.35rem;
}

.login-field button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.login-error {
  min-height: 1.25rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  min-height: 100vh;
}

.room-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  height: 100vh;
  padding: 2.2rem 1.55rem 1.6rem;
  border-right: 1px solid var(--line);
  background: var(--rail);
}

.brand-block {
  padding: 0 0.25rem;
}

.brand-home {
  display: grid;
  grid-template-columns: 2.05rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-orb {
  width: 2.05rem;
  height: 2.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, oklch(99% 0.006 92), transparent 42%),
    var(--surface-warm);
  box-shadow: 0 10px 26px oklch(42% 0.014 76 / 0.08);
}

.brand-copy {
  display: grid;
  gap: 0.18rem;
}

.brand-mark {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-copy > span:last-child {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.rail-actions,
.history-list {
  display: grid;
  gap: 0.55rem;
}

.rail-button,
.history-item {
  width: 100%;
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.rail-label {
  display: grid;
  gap: 0.12rem;
}

.rail-token,
.profile-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 750;
  letter-spacing: 0;
}

.rail-token {
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  font-size: 1rem;
}

.token-sinan {
  background: var(--accent-soft);
}

.token-mingjing {
  background: var(--seal-blue);
}

.token-council {
  background: var(--seal-green);
}

.rail-button strong {
  font-size: 0.98rem;
  font-weight: 720;
  line-height: 1.25;
}

.history-item .history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-button small,
.history-item .history-time {
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-button:hover,
.history-item:hover {
  background: oklch(97% 0.008 90);
}

.rail-button.is-active,
.history-item.is-active {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 16px 42px oklch(46% 0.014 72 / 0.08);
}

.rail-button.is-active strong {
  color: var(--accent);
}

.conversation-history {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.4rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.rail-section-heading button {
  min-height: 1.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
}

.rail-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.rail-section-actions button:first-child {
  color: var(--accent);
}

.history-list {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  gap: 0.12rem;
  padding: 0.08rem 0;
}

.history-item {
  position: relative;
  min-height: 2.45rem;
  display: grid;
  align-items: center;
  padding: 0;
  border-radius: 14px;
  box-shadow: none;
}

.history-open {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  padding: 0 0.56rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-agent {
  min-width: 2.55rem;
  padding: 0.12rem 0.34rem;
  border-radius: 999px;
  background: oklch(96.8% 0.012 118 / 0.72);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 620;
  line-height: 1.2;
  text-align: center;
}

.history-title {
  min-width: 0;
  padding-right: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.history-time {
  justify-self: end;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.history-rename {
  position: absolute;
  top: 50%;
  right: 0.18rem;
  transform: translateY(-50%);
  min-width: 1.7rem;
  min-height: 1.7rem;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(99% 0.006 95 / 0.92);
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.history-item:hover .history-rename,
.history-rename:focus-visible {
  opacity: 1;
}

.history-item:hover .history-time {
  opacity: 0;
}

.history-rename:hover {
  border-color: var(--line);
  color: var(--ink-soft);
}

.history-item.is-unread .history-title::before {
  content: "";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.35rem;
  border-radius: 999px;
  background: var(--accent);
}

.history-rename-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.18rem 0;
}

.history-rename-form input {
  min-width: 0;
  height: 2.15rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

.history-rename-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.history-rename-form button {
  min-height: 2.15rem;
  padding: 0 0.58rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.history-more {
  margin: 0;
  padding: 0.4rem 0.25rem 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.rail-empty,
.rail-footnote {
  margin: 0;
  padding: 0.65rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.rail-library {
  order: 3;
  margin-top: 0;
  display: grid;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.rail-library button {
  min-height: 2.6rem;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.rail-library span {
  color: var(--ink-muted);
  font-size: 1rem;
}

.rail-library strong {
  font-size: 0.94rem;
}

.rail-library button:hover {
  color: var(--ink);
}

.rail-user-block {
  order: 4;
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.82rem;
  border-top: 1px solid var(--line-soft);
}

.rail-user-menu {
  position: absolute;
  left: auto;
  right: 0;
  bottom: calc(100% + 0.65rem);
  z-index: 5;
  width: min(13.25rem, calc(100vw - 1.5rem));
  display: grid;
  gap: 0.18rem;
  padding: 0.36rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: oklch(99% 0.006 95 / 0.96);
  box-shadow: 0 14px 34px oklch(34% 0.018 88 / 0.09);
  backdrop-filter: blur(18px);
}

.rail-user-menu button {
  min-height: 2.2rem;
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.52rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.rail-user-menu button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.rail-user-menu span {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.rail-user-menu strong {
  font-size: 0.86rem;
}

.rail-user-menu .rail-menu-secondary {
  min-height: 1.85rem;
  margin-top: 0.12rem;
  padding-top: 0.18rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-muted);
}

.rail-user-menu .rail-menu-secondary span {
  opacity: 0.62;
}

.rail-user-menu .rail-menu-secondary strong {
  font-size: 0.76rem;
  font-weight: 580;
}

.password-change-panel {
  display: grid;
  gap: 0.34rem;
  padding: 0.08rem 0.1rem 0.16rem;
}

.password-change-back {
  color: var(--ink-muted);
}

.rail-user-menu .password-change-back strong {
  font-size: 0.76rem;
  font-weight: 580;
}

.password-change-form {
  display: grid;
  gap: 0.36rem;
  padding: 0.12rem 0.16rem 0.08rem;
  border: 0;
  background: transparent;
}

.password-change-form strong {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 620;
}

.password-change-form input {
  width: 100%;
  min-height: 1.95rem;
  padding: 0 0.56rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: oklch(99% 0.005 95 / 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  outline: 0;
}

.password-change-form input:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 3px oklch(73% 0.045 105 / 0.13);
}

.rail-user-menu .password-change-form button {
  width: fit-content;
  min-height: 1.9rem;
  display: inline-flex;
  justify-content: center;
  justify-self: end;
  padding: 0 0.66rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(97.2% 0.01 100);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 620;
}

.rail-user-menu .password-change-form button:hover {
  background: var(--surface-muted);
}

.rail-user-menu .password-change-form button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.password-change-form p {
  min-height: 0.9rem;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.rail-user {
  width: auto;
  min-height: 2.2rem;
  display: inline-grid;
  grid-template-columns: 1.72rem auto auto;
  align-items: center;
  justify-content: end;
  gap: 0.42rem;
  padding: 0.18rem 0.28rem 0.18rem 0.18rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.rail-user:hover {
  background: var(--surface);
  color: var(--ink);
}

.rail-user-avatar {
  width: 1.72rem;
  height: 1.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 720;
}

.rail-user strong {
  font-size: 0.84rem;
  font-weight: 650;
}

.workspace {
  width: min(100%, 96rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: 2.15rem 2.2rem;
}

.home-view {
  min-height: calc(100vh - 4.3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 23.5rem);
  align-content: start;
  align-items: start;
  gap: 2rem;
  position: relative;
}

.home-main {
  display: grid;
  align-content: start;
  gap: 2.05rem;
}

.home-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.profile-seal {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 28px oklch(44% 0.012 80 / 0.08);
}

.home-hero {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding-top: 0.7rem;
  text-align: center;
}

.home-hero p,
.home-hero span {
  margin: 0;
  color: var(--ink-muted);
}

.home-hero p {
  font-size: 0.88rem;
  font-weight: 690;
}

.home-hero h1 {
  max-width: 42rem;
  margin: 0;
  color: var(--ink);
  font-size: 2.25rem;
  line-height: 1.22;
  letter-spacing: 0;
  font-weight: 780;
}

.home-hero span {
  font-size: 1.04rem;
}

.home-room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  width: min(100%, 56rem);
  margin: 0 auto;
}

.home-room-card {
  min-height: 24.5rem;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.55rem;
  padding: 0.55rem 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 24px 60px oklch(42% 0.016 72 / 0.075);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.home-room-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 30px 72px oklch(42% 0.016 72 / 0.1);
  transform: translateY(-2px);
}

.home-room-card img {
  width: 100%;
  aspect-ratio: 1.62;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

.home-room-card strong {
  margin-top: 0.45rem;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.home-room-card > span:not(.room-arrow),
.home-room-card small {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.home-room-card small {
  color: var(--ink-muted);
}

.home-room-content {
  display: grid;
  justify-items: center;
  gap: 0.34rem;
}

.home-room-content > span:not(.home-room-action) {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.home-room-action {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  margin-top: 0.45rem;
  padding: 0 0.82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 680;
}

.room-arrow {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: var(--surface);
  font-size: 1.08rem;
}

.home-materials {
  width: min(100%, 56rem);
  display: grid;
  gap: 0.85rem;
  margin: 0 auto;
}

.materials-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.materials-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.3;
}

.materials-heading p,
.home-reminder {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.home-reminder strong {
  margin-right: 0.55rem;
  color: var(--ink);
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: stretch;
}

.material-card {
  min-width: 0;
  min-height: 16.2rem;
  display: grid;
  grid-template-rows: auto auto auto minmax(4.5rem, 1fr) auto;
  align-content: stretch;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 44px oklch(42% 0.014 72 / 0.045);
}

.material-card.is-clickable {
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.material-card.is-clickable:hover {
  border-color: var(--line-strong);
  box-shadow: 0 20px 56px oklch(42% 0.014 72 / 0.07);
  transform: translateY(-1px);
}

.material-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.material-meta span {
  color: var(--ink-soft);
  font-weight: 700;
}

.material-meta small {
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-tag {
  min-width: 0;
  width: fit-content;
  padding: 0.18rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-warm);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 690;
}

.material-card h3 {
  min-width: 0;
  margin: 0;
  min-height: 2.84em;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.42;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.42;
  letter-spacing: 0;
}

.material-card p {
  min-width: 0;
  margin: 0;
  min-height: 4.86em;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.material-quote {
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: oklch(97.8% 0.008 92 / 0.64);
}

.material-more,
.material-actions a {
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.78rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.material-more:hover,
.material-actions a:hover {
  border-color: var(--line);
  color: var(--accent);
}

.material-actions {
  min-width: 0;
  min-height: 2.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.15rem;
  color: var(--ink-muted);
}

.material-action,
.material-source-status {
  min-width: 0;
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.84rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-action {
  color: var(--accent);
  font-weight: 650;
}

.material-source-status {
  justify-self: end;
  color: var(--ink-muted);
  font-weight: 650;
}

.home-summary-card {
  width: min(100%, 56rem);
  min-height: 10.4rem;
  display: grid;
  grid-template-columns: minmax(10rem, 0.5fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 1.1rem;
  margin: 0 auto;
  padding: 0.62rem;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: oklch(98.8% 0.008 94 / 0.76);
  box-shadow: 0 18px 54px oklch(42% 0.014 72 / 0.045);
}

.home-summary-card img {
  width: 100%;
  height: 100%;
  min-height: 8.8rem;
  object-fit: cover;
  border-radius: 14px;
}

.home-summary-card div {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.58rem;
  padding: 0.55rem 0.8rem 0.55rem 0;
}

.home-summary-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.3;
}

.home-summary-card p {
  max-width: 39rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.home-compose {
  width: min(100%, 56rem);
  min-height: 4.9rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 0.65rem;
  margin: 0 auto;
  padding: 0.72rem;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: oklch(99% 0.006 96 / 0.82);
  box-shadow: 0 18px 52px oklch(42% 0.014 72 / 0.05);
}

.home-compose textarea {
  min-height: 3.2rem;
  max-height: 9rem;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.58;
  outline: 0;
}

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

.home-compose-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.home-compose-tools span {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-muted);
}

.home-compose button {
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: oklch(98% 0.006 92);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 760;
}

.home-side-panel {
  position: sticky;
  top: 2.15rem;
  display: grid;
  gap: 1.05rem;
  max-height: calc(100vh - 4.3rem);
  padding: 1.05rem;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: oklch(98.4% 0.009 92 / 0.7);
  box-shadow: 0 20px 70px oklch(36% 0.018 88 / 0.06);
  overflow-y: auto;
}

.home-side-header,
.home-feed-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
}

.home-side-header h2,
.home-feed-head h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.home-side-header h2 {
  font-size: 1.14rem;
  line-height: 1.28;
}

.home-side-header button,
.home-feed-head button {
  min-height: 2rem;
  padding: 0 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.home-feed-block {
  min-width: 0;
  display: grid;
  gap: 0.62rem;
}

.home-feed-head h3 {
  font-size: 0.94rem;
}

.home-feed-head button {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.home-feed-card,
.home-signal-row {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: oklch(99% 0.006 94 / 0.74);
}

.home-feed-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.36rem 0.65rem;
  padding: 0.84rem;
}

.feed-tag {
  width: fit-content;
  min-height: 1.45rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 680;
}

.home-feed-card time {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.home-feed-card h4,
.home-signal-row h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.42;
  letter-spacing: 0;
}

.home-feed-card p,
.home-signal-row p,
.home-side-reminder {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.58;
}

.home-signal-row {
  min-height: 4.4rem;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  padding: 0.72rem;
}

.home-signal-row img,
.signal-plant,
.signal-cloud {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
}

.home-signal-row img {
  object-fit: cover;
}

.signal-plant,
.signal-cloud {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface-cool);
  color: var(--cool);
}

.home-side-reminder {
  padding: 0.15rem 0.25rem;
  color: var(--ink-muted);
}

.learning-pulse {
  display: grid;
  gap: 0.42rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
}

.learning-pulse div {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.learning-pulse span {
  width: fit-content;
  padding: 0.16rem 0.54rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--seal-green);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 690;
}

.learning-pulse strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.learning-pulse p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.conversation-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17.5rem, 20.75rem);
  grid-template-rows: minmax(0, 1fr);
  gap: 1.05rem;
  min-height: calc(100vh - 4.3rem);
}

.rooms {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.room-card {
  min-height: 6.5rem;
  display: grid;
  align-content: start;
  gap: 0.26rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 oklch(99% 0.004 92 / 0.85) inset;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.room-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.room-card.is-active {
  border-color: oklch(70% 0.03 72);
  background: var(--accent-soft);
}

.room-kicker {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.room-name {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 760;
  letter-spacing: 0;
}

.room-copy {
  max-width: 18rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-panel,
.learning-panel {
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: oklch(99.1% 0.002 96 / 0.84);
  box-shadow: 0 22px 70px oklch(36% 0.018 88 / 0.055);
}

.chat-panel {
  grid-column: 1;
  grid-row: 1;
  min-height: calc(100vh - 4.3rem);
  display: grid;
  grid-template-rows: auto minmax(26rem, 1fr) auto;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.58rem 1.05rem 0.5rem;
  border-bottom: 1px solid var(--line-soft);
  background: oklch(99.2% 0.002 96 / 0.72);
}

.back-home-button {
  min-height: 1.72rem;
  margin: 0 0 0.22rem;
  padding: 0 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  cursor: pointer;
}

.back-home-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 0.08rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.chat-header h1,
.learning-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.agent-note {
  max-width: 25rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: right;
}

.message-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1.08rem 1rem;
  overflow-y: auto;
  background:
    linear-gradient(180deg, oklch(99.3% 0.002 96 / 0.68), oklch(98.8% 0.003 96 / 0.72)),
    var(--surface);
}

.empty-state {
  width: min(100%, 30rem);
  margin: auto;
  color: var(--ink-muted);
  font-size: 0.95rem;
  text-align: center;
}

.message {
  width: min(100%, 46rem);
  display: grid;
  gap: 0.26rem;
}

.message-user {
  align-self: end;
}

.message-assistant,
.message-system {
  align-self: start;
}

.message-header {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.message-user .message-header {
  justify-self: end;
}

.message-speaker {
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.25;
}

.message-user .message-speaker {
  text-align: right;
}

.message-copy {
  min-height: 1.42rem;
  padding: 0 0.42rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(99% 0.006 95 / 0.62);
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 520;
  line-height: 1;
  cursor: pointer;
  opacity: 0.58;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.message:hover .message-copy,
.message-copy:focus-visible,
.message-copy.is-copied {
  opacity: 1;
}

.message-copy:hover,
.message-copy.is-copied {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
}

.message-body {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.82rem 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(99% 0.006 94 / 0.78);
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.68;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 30px oklch(42% 0.014 72 / 0.035);
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
}

.curation-notice,
.vision-notice {
  margin-top: 0.62rem;
  padding: 0.52rem 0.62rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: oklch(96.8% 0.012 122 / 0.72);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.vision-completed {
  background: oklch(96.2% 0.016 145 / 0.76);
  color: var(--cool);
}

.vision-needs_config,
.vision-failed {
  background: oklch(96.4% 0.012 82 / 0.74);
}

.material-chat-card {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.72rem;
  padding: 0.88rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(98.9% 0.007 95 / 0.82);
}

.material-chat-card header {
  display: grid;
  gap: 0.44rem;
}

.material-chat-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.38;
  letter-spacing: 0;
}

.material-chat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.material-chat-grid .source-section {
  min-height: 0;
  padding: 0.72rem;
  border-radius: 14px;
  background: oklch(99% 0.006 95 / 0.68);
}

.material-discussion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.material-discussion-action {
  min-height: 2rem;
  padding: 0 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 680;
  cursor: pointer;
}

.material-discussion-action:hover {
  border-color: var(--line-strong);
  background: oklch(98.4% 0.011 94 / 0.9);
}

.message-artifact {
  display: grid;
  gap: 0.5rem;
  margin: 0.7rem 0 0;
}

.message-artifact-image {
  width: min(100%, 30rem);
  max-height: 24rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.message-artifact figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.message-artifact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.artifact-card {
  width: min(100%, 34rem);
  display: grid;
  gap: 0.72rem;
  margin: 0.72rem 0 0;
  padding: 0.72rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(98.7% 0.007 94 / 0.9);
  box-shadow: 0 16px 44px oklch(38% 0.016 82 / 0.055);
}

.artifact-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.artifact-card-header span {
  min-height: 1.55rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.52rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-cool);
  color: var(--cool);
  font-size: 0.72rem;
  font-weight: 680;
}

.artifact-card-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-card-preview {
  width: 100%;
  max-height: 25rem;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
}

.artifact-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.artifact-card figcaption > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.artifact-card a {
  min-height: 1.9rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  font-weight: 680;
}

.message-assistant .message-body {
  background: oklch(99% 0.006 94 / 0.84);
}

.message-user .message-body {
  margin-left: auto;
  border-color: oklch(82% 0.024 80 / 0.78);
  background: oklch(92.6% 0.026 78 / 0.8);
}

.message-system .message-body {
  border-color: oklch(82% 0.03 42);
  background: var(--danger-soft);
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.62rem;
  align-items: end;
  margin: 0.62rem 0.95rem 0.28rem;
  padding: 0.78rem 0.9rem 0.74rem;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: oklch(99.2% 0.002 96 / 0.88);
  box-shadow: 0 18px 48px oklch(34% 0.018 88 / 0.065);
}

.attachment-preview {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.35rem 0.45rem 0.35rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.attachment-chip span {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  min-height: 1.55rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.composer textarea {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 3.2rem;
  max-height: 12rem;
  resize: vertical;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
  outline: 0;
}

.composer:focus-within {
  border-color: oklch(80% 0.018 126 / 0.7);
  box-shadow: 0 18px 48px oklch(34% 0.018 88 / 0.065);
}

.composer textarea::placeholder,
.feed-form input::placeholder,
.feed-form textarea::placeholder {
  color: var(--ink-muted);
}

.composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.composer-tools button {
  width: 2.22rem;
  height: 2.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 1rem;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.composer-tools button:hover {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--accent);
}

.composer-send,
.feed-form button {
  min-height: 2.65rem;
  padding: 0 0.95rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: oklch(97.5% 0.006 92);
  font-weight: 660;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.composer-send:hover,
.feed-form button:hover {
  background: oklch(38% 0.038 67);
}

.composer-send:active,
.composer-tools button:active,
.feed-form button:active,
.quiet-button:active {
  transform: translateY(1px);
}

.composer-send:disabled,
.composer-tools button:disabled,
.feed-form button:disabled {
  border-color: var(--line-strong);
  background: var(--line-strong);
  cursor: default;
  transform: none;
}

.learning-panel {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  min-height: 32rem;
  max-height: calc(100vh - 4.3rem);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: oklch(98.4% 0.008 92 / 0.74);
}

.learning-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.quiet-button {
  min-height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.quiet-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.quiet-button:disabled {
  color: var(--ink-muted);
  cursor: default;
}

.quiet-button-danger {
  color: var(--danger);
}

.learning-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.55rem;
  border-bottom: 1px solid var(--line-soft);
  background: oklch(96.8% 0.01 91 / 0.56);
}

.learning-tab {
  min-width: 0;
  min-height: 2rem;
  padding: 0 0.32rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.79rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.learning-tab:hover {
  background: var(--surface);
}

.learning-tab.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
  font-weight: 660;
}

.learning-section {
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
}

.learning-section[hidden] {
  display: none;
}

.section-heading {
  display: grid;
  gap: 0.22rem;
  margin-bottom: 0.78rem;
}

.compact-heading {
  margin-top: 1rem;
}

.section-heading h3,
.capability-boundary h3,
.rhythm-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.32;
  letter-spacing: 0;
}

.section-heading p,
.capability-boundary p,
.rhythm-heading p,
.rhythm-result {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.reading-list {
  display: grid;
  gap: 0.6rem;
}

.reading-item,
.learning-item,
.rhythm-card,
.learning-empty,
.capability-boundary {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: oklch(99% 0.006 94 / 0.72);
}

.reading-item {
  display: grid;
  gap: 0.28rem;
  padding: 0.82rem;
}

.reading-item span {
  width: fit-content;
  padding: 0.08rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-cool);
  color: var(--cool);
  font-size: 0.71rem;
}

.reading-item h4,
.learning-item h4,
.rhythm-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.36;
  letter-spacing: 0;
}

.reading-item p,
.learning-item p,
.rhythm-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.56;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.capability-boundary {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.82rem;
  background: var(--cool-soft);
}

.learning-list,
.rhythm-list,
.candidate-groups {
  display: grid;
  gap: 0.62rem;
}

.learning-empty {
  margin: 0;
  padding: 0.82rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.learning-item {
  display: grid;
  gap: 0.52rem;
  padding: 0.82rem;
}

.learning-meta,
.learning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.learning-meta span {
  min-height: 1.42rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.46rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.learning-rhythm {
  display: grid;
  gap: 0.75rem;
}

.file-feed,
.artifact-maker {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.link-button {
  text-decoration: none;
}

.rhythm-heading,
.rhythm-card-heading,
.candidate-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rhythm-card {
  display: grid;
  gap: 0.62rem;
  padding: 0.8rem;
}

.rhythm-card-heading span {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.rhythm-controls {
  display: grid;
  grid-template-columns: auto minmax(6.5rem, 1fr) minmax(4.5rem, 0.6fr);
  gap: 0.5rem;
  align-items: end;
}

.rhythm-control,
.feed-form label {
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.rhythm-toggle {
  min-height: 2.25rem;
  grid-template-columns: auto auto;
  align-items: center;
  align-self: end;
  gap: 0.36rem;
}

.rhythm-control input,
.rhythm-control select,
.feed-form input,
.feed-form select,
.feed-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.rhythm-control input,
.rhythm-control select,
.feed-form input,
.feed-form select {
  min-height: 2.42rem;
  padding: 0 0.66rem;
}

.rhythm-control input[type="checkbox"] {
  width: 1rem;
  min-height: 1rem;
  accent-color: var(--accent);
}

.feed-form {
  display: grid;
  gap: 0.72rem;
}

.foundation-profile {
  display: grid;
  gap: 0.72rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.feed-form textarea {
  min-height: 8rem;
  resize: vertical;
  padding: 0.78rem;
  line-height: 1.55;
}

.candidate-result {
  display: grid;
  gap: 0.62rem;
  margin-top: 0.72rem;
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.candidate-group {
  display: grid;
  gap: 0.62rem;
}

.candidate-group-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.candidate-group-heading span {
  min-width: 1.52rem;
  min-height: 1.52rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

/* Warm sage home shell */
.app-shell {
  grid-template-columns: 17.5rem minmax(0, 1fr);
  background: var(--page);
}

.room-rail {
  gap: 1.18rem;
  padding: 2rem 1.25rem 1.55rem;
  border-right-color: var(--line-soft);
  background: var(--rail);
  backdrop-filter: blur(28px);
}

.brand-home {
  grid-template-columns: 3rem 1fr;
  align-items: center;
  gap: 0.85rem;
}

.brand-orb {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, oklch(94% 0.05 88 / 0.9), transparent 34%),
    radial-gradient(circle at 48% 72%, oklch(65% 0.08 130 / 0.5), transparent 42%),
    linear-gradient(145deg, oklch(99% 0.006 95), oklch(90% 0.04 118));
  box-shadow: 0 16px 42px oklch(38% 0.018 92 / 0.1);
}

.brand-copy {
  display: grid;
  gap: 0.18rem;
}

.brand-mark {
  font-size: 1.35rem;
  font-weight: 720;
}

.rail-actions {
  gap: 0.72rem;
}

.rail-button {
  min-height: 4.65rem;
  padding: 0.8rem 0.92rem;
  border-radius: 22px;
}

.rail-token {
  width: 3.05rem;
  height: 3.05rem;
  background: oklch(99% 0.006 94 / 0.64);
  box-shadow: 0 12px 30px oklch(38% 0.018 92 / 0.065);
}

.rail-button.is-active,
.history-item.is-active {
  border-color: transparent;
  background: oklch(99% 0.006 95 / 0.78);
  box-shadow: var(--shadow-card);
}

.rail-button.is-active strong {
  color: var(--ink);
}

.rail-library {
  margin-top: 0;
  gap: 0.55rem;
  padding: 1.05rem 0 0;
}

.rail-library button {
  min-height: 2.55rem;
  padding: 0 0.45rem;
  border-radius: 14px;
}

.rail-library button:hover {
  background: oklch(99% 0.006 95 / 0.52);
}

.conversation-history {
  margin-top: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}

.history-list {
  max-height: none;
}

.history-item {
  padding: 0;
  background: transparent;
}

.rail-user {
  min-height: 2.25rem;
  display: inline-grid;
  grid-template-columns: 1.72rem auto auto;
  align-items: center;
  justify-content: end;
  gap: 0.42rem;
  padding: 0.18rem 0.28rem 0.18rem 0.18rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.rail-user-avatar {
  width: 1.72rem;
  height: 1.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(145deg, oklch(91% 0.04 80), oklch(80% 0.06 130));
  color: oklch(98% 0.006 95);
  font-size: 0.76rem;
  font-weight: 740;
}

.workspace {
  width: 100%;
  max-width: 91rem;
  padding: 1.05rem 2.05rem 1.15rem;
}

.home-view {
  grid-template-columns: minmax(0, 1fr) minmax(18.5rem, 20.5rem);
  align-items: start;
  gap: 3rem;
  min-height: calc(100vh - 4.5rem);
}

.home-main {
  min-width: 0;
  display: grid;
  position: relative;
  gap: 0.82rem;
}

.home-topbar {
  min-height: 2.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.home-greeting,
.home-actions {
  display: inline-flex;
  align-items: center;
}

.home-greeting {
  color: var(--ink-muted);
  font-size: 0.94rem;
  font-weight: 620;
  line-height: 1.3;
  min-width: 0;
}

.home-actions {
  gap: 0.62rem;
}

.home-actions button,
.home-side-header button,
.home-feed-head button {
  border: 1px solid var(--line-soft);
  background: oklch(99% 0.006 95 / 0.72);
  color: var(--ink-soft);
  cursor: pointer;
}

.home-actions button,
.home-side-header button {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px oklch(34% 0.018 88 / 0.055);
}

.home-actions button:last-child {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-hero {
  display: grid;
  justify-items: start;
  gap: 0;
  max-width: min(100%, 55rem);
  padding-top: 0;
  text-align: left;
}

.home-hero p {
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.home-hero h1 {
  max-width: 100%;
  margin: 0;
  font-size: 1.88rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-room-grid {
  width: 100%;
  margin: 0;
  gap: 1.18rem;
}

.home-materials {
  width: 100%;
  margin: 0;
  gap: 0.92rem;
}

.material-grid {
  gap: 1rem;
}

.home-room-card {
  position: relative;
  min-height: clamp(19.8rem, 25vw, 24rem);
  aspect-ratio: 0.82;
  display: block;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-card);
}

.home-room-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    oklch(100% 0 0 / 0.03),
    oklch(99% 0.006 95 / 0.2) 28%,
    oklch(99% 0.006 95 / 0.68) 70%,
    oklch(99% 0.006 95 / 0.96)
  );
}

.home-room-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.home-room-card img {
  position: absolute;
  inset: -1px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
  transform: scale(1.012);
}

.home-room-card:nth-child(1) img {
  object-position: 50% 50%;
}

.home-room-card:nth-child(2) img {
  object-position: 48% 50%;
}

.home-room-card:nth-child(3) img {
  object-position: 62% 50%;
}

.home-room-content {
  position: absolute;
  z-index: 1;
  left: 1.35rem;
  right: 1.35rem;
  bottom: 1.28rem;
  display: grid;
  gap: 0.34rem;
}

.home-room-card strong {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 720;
}

.home-room-card > span:not(.room-arrow),
.home-room-card small,
.home-room-content > span,
.home-room-content small {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.home-room-action {
  width: fit-content;
  min-height: 2.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.62rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: oklch(98% 0.006 95) !important;
  font-weight: 680;
  box-shadow: 0 12px 30px oklch(35% 0.035 126 / 0.12);
}

.room-arrow {
  display: none;
}

.home-summary-card {
  position: relative;
  min-height: 10.8rem;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 1.55rem 1.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.home-summary-card img {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.home-summary-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, oklch(99% 0.006 95 / 0.96), oklch(99% 0.006 95 / 0.7) 54%, transparent);
}

.home-summary-card div {
  position: relative;
  z-index: 1;
  max-width: 33rem;
  display: grid;
  gap: 0.7rem;
}

.home-summary-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.home-summary-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.home-summary-card .quiet-button {
  width: fit-content;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: oklch(99% 0.006 95 / 0.78);
}

.home-compose {
  position: relative;
  min-height: 6.4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: oklch(99% 0.006 95 / 0.82);
  box-shadow: 0 18px 48px oklch(34% 0.018 88 / 0.065);
}

.home-compose textarea {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 2.4rem;
  max-height: 9rem;
  resize: vertical;
  padding: 0 0 0.2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
}

.home-compose textarea:focus {
  outline: 0;
}

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

.home-compose-tools {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.home-compose button {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: oklch(46% 0.07 128);
  color: oklch(98% 0.006 95);
  font-size: 1.18rem;
  cursor: pointer;
  box-shadow: 0 14px 34px oklch(32% 0.04 126 / 0.18);
}

.home-side-panel {
  position: sticky;
  top: 2.25rem;
  display: grid;
  gap: 1.35rem;
  max-height: calc(100vh - 4.5rem);
  overflow-y: auto;
  padding: 1.45rem 1.22rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  background: oklch(99% 0.006 95 / 0.68);
  box-shadow: var(--shadow-paper);
  backdrop-filter: blur(24px);
}

.home-side-header,
.home-feed-head,
.home-signal-row,
.home-feed-card {
  display: flex;
  align-items: center;
}

.home-side-header,
.home-feed-head {
  justify-content: space-between;
  gap: 0.8rem;
}

.home-side-header h2,
.home-feed-head h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.home-side-header h2 {
  font-size: 1.35rem;
  font-weight: 690;
}

.home-feed-head h3 {
  font-size: 0.88rem;
}

.home-feed-head button {
  min-height: 1.6rem;
  padding: 0 0.15rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.home-feed-block {
  display: grid;
  gap: 0.72rem;
}

.home-feed-card {
  position: relative;
  align-items: start;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(99% 0.006 95 / 0.66);
}

.home-feed-card time {
  position: absolute;
  top: 0.92rem;
  right: 0.95rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.feed-tag {
  width: fit-content;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 690;
}

.home-feed-card h4,
.home-signal-row h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.38;
}

.home-feed-card p,
.home-signal-row p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.home-signal-row {
  gap: 0.78rem;
  padding: 0.18rem 0.1rem;
}

.home-signal-row img,
.signal-plant,
.signal-cloud {
  flex: 0 0 auto;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 12px;
}

.home-signal-row img {
  object-fit: cover;
  box-shadow: 0 10px 24px oklch(34% 0.018 88 / 0.08);
}

.signal-plant,
.signal-cloud {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.home-signal-row > span:last-child {
  width: 0.34rem;
  height: 0.34rem;
  margin-left: auto;
  border-radius: 999px;
  background: var(--accent);
}

.home-side-panel .learning-pulse {
  border-radius: 18px;
  background: oklch(94.4% 0.026 126 / 0.58);
}

.home-side-reminder {
  margin: 0;
  padding: 1.05rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(135deg, oklch(92.8% 0.025 126 / 0.62), oklch(96% 0.012 92 / 0.8));
  color: var(--ink-soft);
  line-height: 1.7;
  text-align: center;
}

.home-view {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.home-main {
  width: min(100%, 75rem);
  margin: 0 auto;
}

.home-daily-summary {
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 1.25rem;
  isolation: isolate;
}

.home-daily-summary > img {
  display: none;
}

.home-daily-summary::after {
  background:
    linear-gradient(90deg, oklch(99% 0.006 95 / 0.98), oklch(99% 0.006 95 / 0.88) 55%, oklch(99% 0.006 95 / 0.32)),
    radial-gradient(circle at 84% 18%, oklch(91% 0.04 126 / 0.36), transparent 32%);
}

.home-daily-summary .home-daily-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  display: grid;
  gap: 1.05rem;
  padding: 0;
}

.home-daily-summary div {
  width: 100%;
  max-width: none;
}

.home-daily-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.home-daily-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.home-daily-header span {
  display: block;
  max-width: 42rem;
  margin-top: 0.26rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}

.home-daily-header button {
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(99% 0.006 95 / 0.72);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 12px 30px oklch(34% 0.018 88 / 0.055);
}

.home-source-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.78rem;
}

.source-strip-item {
  min-width: 0;
  display: grid;
  gap: 0.32rem;
  min-height: 5.35rem;
  padding: 0.82rem 0.92rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(99% 0.006 95 / 0.72);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.source-strip-item:hover {
  border-color: var(--line);
  background: oklch(99% 0.006 95 / 0.9);
  transform: translateY(-1px);
}

.source-strip-item span {
  width: fit-content;
  min-height: 1.45rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 680;
}

.source-strip-item strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.42;
}

.source-strip-item small {
  color: var(--ink-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.home-daily-body {
  display: grid;
  grid-template-columns: minmax(16rem, 0.72fr) minmax(0, 1.28fr);
  gap: 1rem;
  align-items: stretch;
}

.home-state-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.85rem;
}

.home-state-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6.2rem, 0.36fr);
  gap: 0.9rem;
  align-items: stretch;
  padding: 0.95rem;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: oklch(99% 0.006 95 / 0.64);
}

.state-main,
.state-meter {
  display: grid;
  align-content: center;
  gap: 0.32rem;
}

.state-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: 0;
}

.state-main p,
.state-drivers {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

.state-meter {
  justify-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(94.4% 0.026 126 / 0.44);
}

.state-meter span,
.state-meter small {
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.state-meter strong {
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
  font-weight: 730;
}

.state-drivers {
  grid-column: 1 / -1;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
}

.daily-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.home-recommendation-card {
  min-width: 0;
  min-height: 11rem;
  display: grid;
  align-content: start;
  gap: 0.52rem;
  padding: 0.92rem;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: oklch(99% 0.006 95 / 0.72);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}

.home-recommendation-card.is-clickable {
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.home-recommendation-card.is-clickable:hover {
  border-color: var(--line);
  background: oklch(99% 0.006 95 / 0.9);
  transform: translateY(-1px);
}

.recommendation-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.recommendation-meta time {
  min-width: 0;
  color: var(--ink-muted);
  font-size: 0.75rem;
  text-align: right;
}

.home-recommendation-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.home-recommendation-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.65;
}

.recommendation-quote {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: oklch(96.8% 0.012 91 / 0.58);
}

.source-link-hint {
  width: fit-content;
  margin-top: auto;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 680;
}

.recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
}

.recommendation-actions a {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 680;
  text-decoration: none;
}

.material-chat-card {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: oklch(99% 0.006 95 / 0.74);
}

.material-chat-card header {
  display: grid;
  gap: 0.45rem;
}

.material-chat-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.38;
  letter-spacing: 0;
}

.material-chat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.material-discussion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.material-discussion-action {
  min-height: 2rem;
  padding: 0 0.72rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
}

.material-discussion-action:hover {
  border-color: var(--line);
  color: var(--accent);
}

.source-drawer {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: oklch(98.8% 0.008 94 / 0.78);
}

.source-drawer header {
  display: grid;
  gap: 0.25rem;
}

.source-drawer h3,
.source-section h4 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.source-drawer h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.source-drawer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 0.75fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.source-section:first-child {
  grid-column: span 1;
}

.source-section {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: oklch(99% 0.006 95 / 0.62);
}

.source-section h4 {
  font-size: 0.84rem;
}

.source-section p,
.source-action-list,
.source-meta-block {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.65;
}

.quote-list {
  display: grid;
  gap: 0.55rem;
}

.quote-list blockquote {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.65;
}

.quote-list span {
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.quote-unverified {
  color: var(--ink-soft) !important;
}

.source-meta-block {
  display: grid;
  gap: 0.35rem;
}

.source-meta-block p {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.55rem;
}

.source-meta-block strong {
  color: var(--ink-muted);
  font-weight: 680;
}

.source-meta-block a {
  width: fit-content;
  margin-top: 0.2rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 680;
}

.source-action-list {
  display: grid;
  gap: 0.34rem;
  padding-left: 1rem;
}

.home-daily-summary .learning-pulse {
  border-radius: 18px;
  background: oklch(94.4% 0.026 126 / 0.52);
}

.conversation-view {
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

body.is-chat-mode {
  overflow: hidden;
}

body.is-chat-mode .workspace {
  height: 100vh;
  min-height: 0;
  padding-bottom: 0.18rem;
  overflow: hidden;
}

body.is-chat-mode .conversation-view {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.is-chat-mode .chat-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body.is-chat-mode .message-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

body.is-chat-mode .composer {
  margin-bottom: 0.08rem;
}

.conversation-view .learning-panel {
  display: none;
}

.conversation-view.is-library-open .chat-panel {
  display: none;
}

.conversation-view.is-library-open .learning-panel {
  grid-column: 1;
  display: grid;
  min-height: calc(100vh - 4.3rem);
}

.chat-panel,
.learning-panel {
  border-color: var(--line-soft);
  border-radius: 24px;
  background: oklch(99.1% 0.002 96 / 0.86);
  backdrop-filter: blur(20px);
}

.chat-header,
.learning-header,
.composer,
.learning-tabs {
  background: oklch(99.2% 0.002 96 / 0.64);
}

.composer-send {
  min-width: 2.65rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 999px;
  background: var(--accent);
  font-size: 1.25rem;
}

.rail-button:focus-visible,
.history-item:focus-visible,
.history-open:focus-visible,
.history-rename:focus-visible,
.history-rename-form input:focus-visible,
.history-rename-form button:focus-visible,
.rail-section-heading button:focus-visible,
.brand-home:focus-visible,
.home-room-card:focus-visible,
.home-actions button:focus-visible,
.home-side-header button:focus-visible,
.home-daily-header button:focus-visible,
.home-feed-head button:focus-visible,
.material-card.is-clickable:focus-visible,
.material-more:focus-visible,
.material-actions a:focus-visible,
.material-discussion-action:focus-visible,
.source-strip-item:focus-visible,
.home-recommendation-card:focus-visible,
.home-compose textarea:focus-visible,
.home-compose button:focus-visible,
.rail-user:focus-visible,
.rail-user-menu button:focus-visible,
.back-home-button:focus-visible,
.room-card:focus-visible,
.learning-tab:focus-visible,
.quiet-button:focus-visible,
.feed-form input:focus-visible,
.feed-form select:focus-visible,
.feed-form textarea:focus-visible,
.rhythm-control input:focus-visible,
.rhythm-control select:focus-visible,
.composer-tools button:focus-visible,
.composer-send:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.composer textarea:focus,
.composer textarea:focus-visible {
  outline: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

  .room-rail {
    z-index: 2;
    height: auto;
    flex-direction: row;
    align-items: start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    min-width: max-content;
  }

  .rail-actions {
    grid-template-columns: repeat(3, minmax(5.8rem, 1fr));
    flex: 1;
    gap: 0.35rem;
  }

  .rail-button {
    min-height: 2.5rem;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius);
    text-align: center;
  }

  .rail-token {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.78rem;
  }

  .rail-label {
    gap: 0;
  }

  .rail-button strong {
    font-size: 0.86rem;
  }

  .rail-button small {
    display: none;
  }

  .conversation-history,
  .rail-user-block {
    display: none;
  }

  .workspace {
    width: min(100%, 75rem);
    min-height: calc(100vh - 4rem);
    padding: 1.1rem;
  }

  body.is-chat-mode .workspace {
    height: calc(100vh - 4rem);
    padding: 1rem;
  }

  body.is-chat-mode .conversation-view {
    height: 100%;
  }

  .home-view {
    grid-template-columns: 1fr;
  }

  .home-side-panel {
    position: static;
    max-height: none;
  }

  .home-room-grid,
  .home-materials,
  .home-summary-card {
    width: min(100%, 62rem);
  }

  .conversation-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-panel,
  .learning-panel {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
  }

  .chat-panel {
    min-height: 34rem;
  }

  .learning-panel {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 0.98rem;
  }

  .workspace {
    padding: 0.7rem;
  }

  body.is-chat-mode .workspace {
    height: calc(100vh - 3.75rem);
    padding: 0.62rem;
  }

  .brand-block {
    display: none;
  }

  .room-rail {
    align-items: stretch;
  }

  .rail-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rail-button {
    padding: 0.45rem 0.35rem;
  }

  .rail-token {
    display: none;
  }

  .home-view {
    gap: 1.4rem;
  }

  .home-hero {
    padding-top: 0.15rem;
  }

  .home-hero h1 {
    font-size: 1.75rem;
    white-space: normal;
  }

  .home-hero span {
    font-size: 0.95rem;
  }

  .home-room-grid,
  .material-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .material-chat-grid {
    grid-template-columns: 1fr;
  }

  .home-summary-card {
    grid-template-columns: 1fr;
  }

  .home-summary-card div {
    padding: 0.25rem 0.35rem 0.55rem;
  }

  .home-compose {
    grid-template-columns: minmax(0, 1fr) auto;
    border-radius: 20px;
  }

  .home-compose-tools {
    display: none;
  }

  .home-room-card {
    min-height: 0;
  }

  .home-room-card img {
    max-height: 12rem;
  }

  .materials-heading {
    align-items: start;
    flex-direction: column;
  }

  .material-card {
    min-height: 0;
  }

  .chat-panel {
    grid-template-rows: auto minmax(18rem, 1fr) auto;
    min-height: 31rem;
  }

  .chat-header {
    align-items: start;
    flex-direction: column;
    gap: 0.42rem;
  }

  .agent-note {
    max-width: 100%;
    text-align: left;
  }

  .message-list {
    padding: 0.85rem;
  }

  .material-chat-grid {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .composer-send {
    width: 2.75rem;
  }

  .learning-tabs {
    display: flex;
    overflow-x: auto;
    padding: 0.48rem;
    scrollbar-width: none;
  }

  .learning-tabs::-webkit-scrollbar {
    display: none;
  }

  .learning-tab {
    flex: 0 0 auto;
    min-width: 3.7rem;
    padding: 0 0.48rem;
  }

  .rhythm-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .home-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-side-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    background-position: center top;
  }

  .room-rail {
    backdrop-filter: blur(22px);
  }

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

  .brand-orb {
    width: 2.25rem;
    height: 2.25rem;
  }

  .rail-library,
  .conversation-history,
  .rail-user {
    display: none;
  }

  .workspace {
    max-width: 76rem;
  }

  .home-view,
  .home-main {
    gap: 0.82rem;
  }

  .home-hero h1 {
    font-size: 1.58rem;
    white-space: nowrap;
  }

  .home-room-grid {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .home-room-card,
  .home-room-card img {
    min-height: 20rem;
  }

  .home-daily-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .daily-recommendation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .room-rail {
    position: sticky;
    top: 0;
    padding: 0.65rem;
  }

  .home-greeting {
    font-size: 0.84rem;
  }

  .home-actions {
    justify-content: flex-end;
    gap: 0.42rem;
  }

  .home-actions button {
    width: 2.25rem;
    height: 2.25rem;
  }

  .home-hero h1 {
    font-size: 1.68rem;
    white-space: normal;
  }

  .home-room-grid {
    grid-template-columns: 1fr;
  }

  .home-room-card,
  .home-room-card img {
    min-height: 22rem;
  }

  .home-summary-card {
    min-height: 13rem;
    padding: 1.25rem;
  }

  .home-summary-card img {
    width: 100%;
    opacity: 0.34;
  }

  .home-summary-card::after {
    background: oklch(99% 0.006 95 / 0.78);
  }

  .home-compose {
    grid-template-columns: 1fr auto;
    border-radius: 20px;
  }

  .home-side-panel {
    padding: 1rem;
    border-radius: 22px;
  }

  .home-daily-header,
  .home-daily-body,
  .home-state-panel,
  .home-source-strip,
  .daily-recommendation-grid,
  .source-drawer-grid {
    grid-template-columns: 1fr;
  }

  .home-daily-header {
    display: grid;
  }

  .home-daily-header button {
    justify-self: start;
  }

  .state-drivers {
    grid-column: auto;
  }

  .home-recommendation-card {
    min-height: 0;
  }
}

/* Home polish pass: quieter desktop, purpose-built mobile. */
body:not(.is-chat-mode) .history-list .history-item:nth-of-type(n + 4),
body:not(.is-chat-mode) .history-more {
  display: none;
}

body:not(.is-chat-mode) .conversation-history {
  flex: 0 0 auto;
}

body:not(.is-chat-mode) .history-list {
  overflow: hidden;
}

.home-actions {
  flex: 0 0 auto;
}

.home-actions button {
  box-shadow: none;
}

.home-actions button:last-child {
  background: oklch(99% 0.006 95 / 0.72);
  color: var(--ink-soft);
}

.home-actions button:hover {
  border-color: var(--line);
  background: oklch(98.4% 0.006 95 / 0.86);
  color: var(--accent);
}

.home-hero h1 {
  max-width: 36rem;
  font-weight: 720;
}

.home-room-card {
  box-shadow: 0 18px 48px oklch(38% 0.015 90 / 0.055);
}

.home-room-card:hover {
  box-shadow: 0 24px 62px oklch(38% 0.015 90 / 0.075);
}

.home-room-action {
  background: oklch(46% 0.042 126);
  box-shadow: 0 10px 24px oklch(35% 0.028 126 / 0.1);
}

.home-materials {
  margin-top: 0.18rem;
}

.home-reminder {
  padding: 0.52rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.material-card {
  min-height: 11.8rem;
  grid-template-rows: auto auto minmax(3.2rem, 1fr) auto;
  gap: 0.48rem;
  padding: 0.86rem;
  box-shadow: none;
}

.material-card:hover {
  box-shadow: 0 14px 34px oklch(38% 0.014 90 / 0.045);
}

.material-tag {
  display: none;
}

.material-meta small {
  max-width: 8rem;
  font-weight: 400;
}

.material-card h3 {
  min-height: 0;
  font-size: 0.95rem;
  line-height: 1.38;
}

.material-card p {
  min-height: 0;
  font-size: 0.82rem;
  line-height: 1.52;
  -webkit-line-clamp: 2;
}

.material-actions {
  min-height: 1.8rem;
  padding-top: 0;
}

.material-actions a,
.material-action,
.material-source-status {
  font-size: 0.78rem;
}

@media (max-width: 1120px) {
  .rail-actions {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .room-rail {
    align-items: stretch;
    padding: 0.55rem 0.62rem;
    background: oklch(99.2% 0.002 96 / 0.94);
  }

  .rail-actions {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.28rem;
  }

  .rail-button {
    min-width: 0;
    min-height: 2.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
  }

  .rail-token {
    display: none;
  }

  .rail-button strong {
    font-size: 0.84rem;
    font-weight: 680;
  }

  .workspace {
    padding: 0.78rem 0.78rem 1.2rem;
  }

  .home-main {
    gap: 0.72rem;
  }

  .home-topbar {
    min-height: 2rem;
    gap: 0.65rem;
  }

  .home-greeting {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-actions {
    gap: 0.35rem;
  }

  .home-actions button {
    width: 2.05rem;
    height: 2.05rem;
  }

  .home-hero {
    max-width: 100%;
  }

  .home-hero h1 {
    max-width: 18rem;
    font-size: 1.42rem;
    line-height: 1.22;
    white-space: normal;
  }

  .home-room-grid {
    grid-template-columns: 1fr;
    gap: 0.72rem;
  }

  .home-room-card,
  .home-room-card img {
    min-height: 9.4rem;
  }

  .home-room-card {
    aspect-ratio: auto;
    border-radius: 20px;
  }

  .home-room-card::after {
    background: linear-gradient(
      90deg,
      oklch(99% 0.006 95 / 0.94),
      oklch(99% 0.006 95 / 0.74) 54%,
      oklch(99% 0.006 95 / 0.2)
    );
  }

  .home-room-card img {
    object-position: center;
  }

  .home-room-content {
    top: 1rem;
    bottom: 1rem;
    left: 1rem;
    right: 47%;
    align-content: center;
    gap: 0.22rem;
  }

  .home-room-card strong {
    font-size: 1.22rem;
  }

  .home-room-content > span:not(.home-room-action),
  .home-room-content small {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .home-room-action {
    min-height: 1.95rem;
    margin-top: 0.35rem;
    padding: 0 0.72rem;
    font-size: 0.78rem;
  }

  .home-materials {
    gap: 0.68rem;
    padding-top: 0.2rem;
  }

  .materials-heading {
    display: flex;
    align-items: center;
    flex-direction: row;
  }

  .materials-heading p {
    display: none;
  }

  .home-reminder {
    font-size: 0.8rem;
  }

  .material-grid {
    grid-template-columns: 1fr;
    gap: 0.62rem;
  }

  .material-card {
    min-height: 0;
    padding: 0.82rem;
  }

  .material-card:nth-child(n + 3) {
    display: none;
  }

  .material-card h3 {
    -webkit-line-clamp: 2;
  }

  .material-actions {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* System coherence pass: quiet home, stable mobile, fixed chat surface. */
html,
body {
  overflow-x: hidden;
}

.workspace,
.home-view,
.home-main,
.conversation-view,
.chat-panel,
.message-list {
  min-width: 0;
}

body:not(.is-chat-mode) .home-view {
  display: block;
  min-height: calc(100vh - 4.3rem);
}

body:not(.is-chat-mode) .home-main {
  width: min(100%, 68rem);
  margin: 0 auto;
  gap: 0.92rem;
}

body:not(.is-chat-mode) .home-topbar {
  justify-content: space-between;
  min-height: 2.55rem;
  margin-bottom: 0.08rem;
}

.home-greeting {
  display: inline-flex;
  min-width: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0;
}

.home-hero {
  justify-items: start;
  padding: 0;
  text-align: left;
}

.home-hero h1 {
  max-width: none;
  font-size: clamp(2rem, 3.1vw, 2.72rem);
  line-height: 1.08;
  font-weight: 720;
  white-space: nowrap;
}

.home-room-grid {
  width: 100%;
  gap: 1.08rem;
  margin-top: 0.28rem;
}

.home-room-card {
  min-height: clamp(18.5rem, 24vw, 23rem);
  border-radius: 24px;
  box-shadow: 0 16px 42px oklch(38% 0.015 90 / 0.052);
}

.home-room-card:hover {
  box-shadow: 0 22px 54px oklch(38% 0.015 90 / 0.072);
}

.home-room-card::after {
  background: linear-gradient(
    to bottom,
    oklch(99% 0.006 95 / 0.06),
    oklch(99% 0.006 95 / 0.2) 34%,
    oklch(99% 0.006 95 / 0.72) 72%,
    oklch(99% 0.006 95 / 0.95)
  );
}

.home-room-card strong {
  font-size: 1.36rem;
  font-weight: 720;
}

.home-room-content > span:not(.home-room-action),
.home-room-content small {
  font-size: 0.87rem;
}

.home-room-action {
  min-height: 2.12rem;
  padding: 0 0.86rem;
  background: oklch(43.5% 0.04 126);
  color: oklch(98% 0.006 92);
  font-size: 0.82rem;
  box-shadow: 0 10px 22px oklch(32% 0.022 126 / 0.12);
}

.home-materials {
  width: 100%;
  gap: 0.72rem;
  margin-top: 0.16rem;
}

.materials-heading h2 {
  font-size: 0.98rem;
}

.materials-heading p,
.home-reminder {
  font-size: 0.82rem;
}

.home-reminder {
  padding: 0.48rem 0;
}

.material-grid {
  gap: 0.78rem;
}

.material-card {
  min-height: 9.8rem;
  gap: 0.38rem;
  padding: 0.78rem 0.82rem;
  border-radius: 14px;
  background: oklch(99% 0.004 95 / 0.72);
}

.material-card h3 {
  font-size: 0.92rem;
  line-height: 1.36;
}

.material-card p {
  font-size: 0.8rem;
}

.material-meta,
.material-action,
.material-source-status,
.material-actions a {
  font-size: 0.74rem;
}

body.is-chat-mode .room-rail {
  position: sticky;
  top: 0;
  height: 100vh;
}

body.is-chat-mode .workspace {
  width: min(100%, 72rem);
  height: 100vh;
  min-height: 0;
  padding-top: 1.05rem;
  padding-bottom: 0.75rem;
}

body.is-chat-mode .conversation-view {
  height: 100%;
  min-height: 0;
}

body.is-chat-mode .chat-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body.is-chat-mode .chat-header {
  flex: 0 0 auto;
}

body.is-chat-mode .message-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.is-chat-mode .composer {
  flex: 0 0 auto;
  margin: 0.62rem 0.95rem 0.32rem;
}

.message-list {
  gap: 0.72rem;
  padding: 1.05rem 1.08rem;
}

.message {
  width: min(100%, 43.5rem);
}

.message-speaker {
  font-size: 0.72rem;
  font-weight: 560;
}

.message-copy {
  min-height: 1.35rem;
  padding: 0 0.38rem;
  font-size: 0.66rem;
  opacity: 0.18;
}

.message:hover .message-copy,
.message-copy:focus-visible,
.message-copy.is-copied {
  opacity: 0.94;
}

.message-body {
  padding: 0.72rem 0.86rem;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.62;
  box-shadow: none;
}

.message-user .message-body {
  background: oklch(93.2% 0.024 78 / 0.78);
}

.composer {
  border-radius: 24px;
  box-shadow: 0 14px 38px oklch(34% 0.018 88 / 0.055);
}

.composer textarea {
  font-size: 0.94rem;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .room-rail {
    width: 100%;
    overflow: hidden;
  }

  .rail-actions {
    min-width: 0;
  }

  .rail-button,
  .rail-label {
    min-width: 0;
  }

  .rail-button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.is-chat-mode .room-rail {
    height: auto;
  }

  body.is-chat-mode .workspace {
    height: calc(100vh - 4rem);
    width: 100%;
    padding-top: 0.8rem;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .room-rail,
  .workspace,
  .home-view,
  .home-main {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .room-rail {
    display: block;
  }

  .rail-actions {
    display: flex !important;
    width: 100%;
    min-width: 0;
    gap: 0.26rem;
  }

  .rail-actions .rail-button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    justify-content: center;
  }

  .rail-actions .rail-button[data-agent="council"] {
    display: flex !important;
  }

  .rail-actions .rail-label {
    min-width: 0;
  }

  .rail-actions .rail-button strong {
    font-size: 0.78rem;
  }

  body:not(.is-chat-mode) .home-main {
    width: 100%;
    gap: 0.62rem;
  }

  body:not(.is-chat-mode) .home-topbar {
    min-height: 2rem;
    margin-bottom: 0;
  }

  .home-greeting {
    max-width: calc(100vw - 8.1rem);
    font-size: 0.78rem;
  }

  .home-actions button {
    width: 1.92rem;
    height: 1.92rem;
    font-size: 0.82rem;
  }

  .home-hero h1 {
    max-width: none;
    font-size: clamp(1.28rem, 6.2vw, 1.48rem);
    line-height: 1.16;
    white-space: nowrap;
    overflow-wrap: anywhere;
  }

  .home-room-grid {
    gap: 0.64rem;
    margin-top: 0.1rem;
  }

  .home-room-card,
  .home-room-card img {
    min-height: 8.55rem;
  }

  .home-room-card {
    border-radius: 18px;
  }

  .home-room-content {
    left: 0.92rem;
    right: 45%;
    top: 0.78rem;
    bottom: 0.78rem;
    gap: 0.12rem;
  }

  .home-room-card strong {
    font-size: 1.08rem;
  }

  .home-room-content > span:not(.home-room-action),
  .home-room-content small {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .home-room-action {
    min-height: 1.82rem;
    margin-top: 0.28rem;
    padding: 0 0.68rem;
    font-size: 0.72rem;
  }

  .materials-heading h2 {
    font-size: 0.92rem;
  }

  .home-reminder {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .material-card {
    padding: 0.74rem;
  }

  body.is-chat-mode .workspace {
    height: calc(100vh - 3.65rem);
    padding: 0.55rem;
  }

  .chat-panel {
    border-radius: 18px;
  }

  .chat-header {
    padding: 0.55rem 0.72rem 0.5rem;
  }

  .message-list {
    padding: 0.72rem;
  }

  .message-body {
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .message-copy {
    opacity: 0.52;
  }

  .composer {
    margin: 0.5rem 0.58rem 0.22rem;
    padding: 0.68rem 0.72rem;
  }

  .composer textarea {
    min-height: 2.8rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 760px) {
  .room-rail {
    width: min(100vw, 390px);
    height: 3.45rem;
    margin: 0;
    padding: 0.55rem 0.62rem;
  }

  .workspace {
    width: min(100vw, 390px);
    margin: 0;
  }

  .rail-actions {
    position: relative;
    display: block !important;
    width: 100%;
    height: 2.35rem;
  }

  .rail-actions .rail-button {
    position: absolute;
    top: 0;
    width: calc((100% - 0.52rem) / 3);
    height: 2.35rem;
  }

  .rail-actions .rail-button[data-agent="sinan"] {
    left: 0;
  }

  .rail-actions .rail-button[data-agent="mingjing"] {
    left: calc((100% - 0.52rem) / 3 + 0.26rem);
  }

  .rail-actions .rail-button[data-agent="council"] {
    left: calc(((100% - 0.52rem) / 3) * 2 + 0.52rem);
  }
}
