:root {
  --bg: #f5f0e8;
  --bg-accent: #efe7db;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-soft: rgba(55, 43, 30, 0.05);
  --panel-strong: #fbf7f1;
  --border: rgba(55, 43, 30, 0.12);
  --border-strong: rgba(55, 43, 30, 0.22);
  --text: #1f1a16;
  --muted: #62574b;
  --muted-strong: #4f453a;
  --primary: #312920;
  --primary-strong: #1f1a16;
  --primary-soft: #f0e6d7;
  --user-bubble: #1f1a16;
  --user-text: #f8f2e8;
  --danger: #c9483d;
  --shadow: 0 20px 60px rgba(44, 33, 20, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --composer-safe-height: 220px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(180deg, #f7f2ea 0%, #f3ede4 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  padding: 24px 24px calc(var(--composer-safe-height) + 32px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand-block h1,
.panel-header h2,
.access-card h2 {
  margin: 0;
  font-family: "Noto Serif SC", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.topbar-actions,
.intake-footer,
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.surface-panel,
.composer,
.access-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.surface-panel,
.composer {
  border-radius: var(--radius-xl);
}

.surface-panel {
  padding: 20px 22px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header .helper-text {
  margin-top: 8px;
}

.chat-layout {
  display: grid;
  gap: 18px;
  padding-bottom: var(--composer-safe-height);
}

.message-list {
  display: grid;
  gap: 18px;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message-shell {
  width: min(100%, 760px);
}

.message.user .message-shell {
  width: min(100%, 700px);
}

.message-content,
.message-trace {
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .message-content {
  display: block;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--user-bubble);
  color: var(--user-text);
  line-height: 1.75;
}

.message.assistant.message .message-content {
  display: block;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

.message.assistant.bubble .message-content {
  display: block;
  padding: 14px 16px;
  border-radius: 20px 20px 20px 10px;
  border: 1px solid rgba(55, 43, 30, 0.1);
  background: rgba(255, 252, 247, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 20px rgba(44, 33, 20, 0.04);
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
}

.message.assistant.bubble .message-content > :first-child {
  margin-top: 0;
}

.message.assistant.bubble .message-content > :last-child {
  margin-bottom: 0;
}

.message.assistant.bubble .message-content p,
.message.assistant.bubble .message-content ul,
.message.assistant.bubble .message-content ol,
.message.assistant.bubble .message-content pre,
.message.assistant.bubble .message-content blockquote,
.message.assistant.bubble .message-content h1,
.message.assistant.bubble .message-content h2,
.message.assistant.bubble .message-content h3 {
  margin: 0 0 12px;
}

.message.assistant.bubble .message-content h1,
.message.assistant.bubble .message-content h2,
.message.assistant.bubble .message-content h3 {
  line-height: 1.45;
  font-family: "Noto Serif SC", Georgia, serif;
}

.message.assistant.bubble .message-content h1 {
  font-size: 22px;
}

.message.assistant.bubble .message-content h2 {
  font-size: 19px;
}

.message.assistant.bubble .message-content h3 {
  font-size: 17px;
}

.message.assistant.bubble .message-content ul,
.message.assistant.bubble .message-content ol {
  padding-left: 22px;
}

.message.assistant.bubble .message-content li + li {
  margin-top: 6px;
}

.message.assistant.bubble .message-content a {
  color: #80522a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message.assistant.bubble .message-content code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(55, 43, 30, 0.08);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.92em;
}

.message.assistant.bubble .message-content pre {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(31, 26, 22, 0.96);
  color: rgba(248, 242, 232, 0.96);
}

.message.assistant.bubble .message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
}

.message.assistant.bubble .message-content blockquote {
  padding-left: 14px;
  border-left: 3px solid rgba(128, 82, 42, 0.28);
  color: var(--muted-strong);
}

.message.trace .message-shell,
.message.thinking .message-shell,
.message.stream.trace-stream .message-shell {
  width: min(100%, 560px);
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid rgba(55, 43, 30, 0.06);
}

.message-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-strong);
}

.message-label.is-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d7b98d, #a36f35);
  box-shadow:
    0 0 0 6px rgba(163, 111, 53, 0.1),
    0 0 18px rgba(163, 111, 53, 0.24);
  animation: pulse 1.8s ease-in-out infinite;
}

.message-trace {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.message.trace .message-content,
.message.thinking .message-content,
.message.stream.trace-stream .message-content,
.message.status-card .message-content,
.message.status-card .message-trace,
.message.skill-activity .message-content {
  display: none !important;
}

.message.status-card .message-shell,
.message.skill-activity .message-shell {
  width: min(100%, 640px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.message.status-card .message-label,
.message.skill-activity .message-label {
  position: relative;
  overflow: hidden;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(55, 43, 30, 0.08);
  background: rgba(112, 119, 129, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: rgba(31, 26, 22, 0.86);
}

.message.status-card .message-label.is-live::before,
.message.skill-activity .message-label.is-live::before {
  display: none;
}

.message.status-card .message-label.is-live,
.message.skill-activity .message-label.is-live {
  border-color: rgba(94, 102, 114, 0.16);
  background: rgba(95, 105, 118, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 0 1px rgba(255, 255, 255, 0.18);
}

.message.status-card .message-label.is-live::after,
.message.skill-activity .message-label.is-live::after {
  content: "";
  position: absolute;
  inset: -35% -28%;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 18%,
    rgba(255, 255, 255, 0.18) 36%,
    rgba(255, 255, 255, 0.62) 50%,
    rgba(194, 204, 214, 0.28) 58%,
    rgba(255, 255, 255, 0) 74%
  );
  transform: translate3d(-52%, 0, 0);
  animation: shimmerSweep 2.6s linear infinite;
  pointer-events: none;
}

.message.skill-activity .message-trace {
  margin-top: 8px;
  height: 1.55em;
  max-height: 1.55em;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(98, 105, 116, 0.82);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Source Code Pro", monospace;
  font-size: 12px;
  line-height: 1.55;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  pointer-events: none;
  user-select: none;
  touch-action: none;
}

.message.skill-activity .message-trace::-webkit-scrollbar {
  display: none;
}

.message.is-streaming .is-streaming::after {
  content: "";
  display: inline-block;
  width: 9px;
  height: 1.1em;
  margin-left: 6px;
  vertical-align: -0.16em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(122, 96, 67, 0.92), rgba(79, 69, 58, 0.96));
  box-shadow:
    0 0 10px rgba(122, 96, 67, 0.28),
    0 0 20px rgba(79, 69, 58, 0.18);
  animation: cursorGlow 0.9s ease-in-out infinite;
}

.output-list,
.options-list,
.intake-form {
  display: grid;
  gap: 14px;
}

.intake-form {
  gap: 18px;
}

.intake-fields {
  display: grid;
  gap: 18px;
}

.intake-section {
  display: grid;
  gap: 12px;
}

.intake-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-strong);
  font-family: "Noto Serif SC", Georgia, serif;
}

.intake-section-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.intake-field-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(55, 43, 30, 0.1);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 242, 235, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 10px 24px rgba(44, 33, 20, 0.05);
}

.intake-other-wrap {
  margin-top: 10px;
}

.intake-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(55, 43, 30, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.intake-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.intake-table th,
.intake-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(55, 43, 30, 0.08);
  vertical-align: top;
}

.intake-table th {
  text-align: left;
  font-size: 13px;
  color: var(--muted-strong);
  background: rgba(240, 230, 215, 0.38);
}

.intake-table td {
  background: transparent;
}

.intake-table tr:last-child td {
  border-bottom: 0;
}

.intake-table .intake-table-action-head,
.intake-table .intake-table-action-cell {
  width: 92px;
  text-align: center;
}

.intake-table-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.intake-table-add,
.intake-table-remove {
  padding: 8px 14px;
}

.intake-table-remove {
  min-width: 68px;
}

.intake-other-input {
  min-height: 72px;
  resize: vertical;
  font-size: 14px;
}

.options-list {
  grid-template-columns: 1fr;
}

.output-item,
.intake-field {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
}

.output-item {
  border: 1px solid rgba(55, 43, 30, 0.1);
  background: rgba(255, 252, 247, 0.9);
}

.intake-field {
  display: grid;
  gap: 12px;
}

.intake-field--full {
  grid-column: 1 / -1;
}

.intake-field--half {
  grid-column: span 3;
}

.intake-field--third {
  grid-column: span 2;
}

.output-title,
.option-chip-title,
.intake-field-label {
  font-weight: 600;
}

.output-meta {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.output-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(240, 230, 215, 0.72);
  color: var(--primary-strong);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.output-link:hover,
.option-chip:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.output-link:hover {
  background: rgba(240, 230, 215, 0.96);
}

.option-chip {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(55, 43, 30, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(245, 238, 228, 0.96));
  text-align: left;
  color: var(--text);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(44, 33, 20, 0.05);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.option-chip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(117, 93, 66, 0.12), transparent 42%);
  pointer-events: none;
}

.option-chip > * {
  position: relative;
  z-index: 1;
}

.option-chip:hover {
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 36px rgba(44, 33, 20, 0.09);
}

.option-chip.is-static {
  cursor: default;
  pointer-events: none;
}

.option-chip.is-static:hover {
  transform: none;
}

.option-chip.is-muted {
  border-color: rgba(55, 43, 30, 0.08);
  background: linear-gradient(180deg, rgba(249, 248, 246, 0.92), rgba(243, 241, 238, 0.9));
  color: rgba(98, 87, 75, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.option-chip.is-muted::before {
  opacity: 0.18;
}

.option-chip.is-muted .option-chip-badge,
.option-chip.is-muted .option-chip-hint {
  background: rgba(55, 43, 30, 0.04);
  color: rgba(98, 87, 75, 0.54);
}

.option-chip.is-muted .option-chip-title strong,
.option-chip.is-muted .option-chip-body strong {
  color: rgba(31, 26, 22, 0.56);
}

.option-chip.is-selected {
  border-color: rgba(115, 104, 93, 0.16);
  background: linear-gradient(180deg, rgba(242, 238, 232, 0.96), rgba(235, 230, 224, 0.94));
  color: rgba(31, 26, 22, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 6px 16px rgba(44, 33, 20, 0.03);
}

.option-chip.is-selected::before {
  opacity: 0.32;
}

.option-chip.is-selected .option-chip-badge,
.option-chip.is-selected .option-chip-hint {
  background: rgba(55, 43, 30, 0.05);
  color: rgba(79, 69, 58, 0.72);
}

.message.option-history .message-shell {
  width: min(100%, 760px);
}

.message.option-history .message-label {
  margin-bottom: 12px;
}

.message.option-history .message-content {
  display: block;
}

.option-history-list {
  display: grid;
  gap: 12px;
}

.option-chip-starter {
  padding: 20px;
  border-color: rgba(55, 43, 30, 0.12);
}

.option-chip-starter.tone-contract::before {
  background: radial-gradient(circle at top right, rgba(137, 112, 82, 0.16), transparent 44%);
}

.option-chip-starter.tone-criminal::before {
  background: radial-gradient(circle at top right, rgba(164, 121, 74, 0.18), transparent 44%);
}

.option-chip-starter.tone-labor::before {
  background: radial-gradient(circle at top right, rgba(151, 99, 80, 0.14), transparent 44%);
}

.option-chip:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.access-input:focus-visible,
textarea:focus-visible,
.intake-field input:focus-visible,
.intake-field textarea:focus-visible {
  outline: none;
  border-color: rgba(55, 43, 30, 0.24);
  box-shadow: 0 0 0 4px rgba(85, 67, 46, 0.1);
}

.option-chip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.option-chip-badge,
.option-chip-hint {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.option-chip-badge {
  background: rgba(240, 230, 215, 0.9);
  color: var(--primary-strong);
}

.option-chip-starter .option-chip-badge {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(55, 43, 30, 0.08);
}

.option-chip-hint {
  background: rgba(55, 43, 30, 0.06);
  color: var(--muted);
}

.option-chip-starter .option-chip-hint {
  background: rgba(240, 230, 215, 0.8);
  color: var(--muted-strong);
}

.option-chip-title {
  font-size: 16px;
  line-height: 1.65;
}

.option-chip-body {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
}

.option-chip-body > :first-child {
  margin-top: 0;
}

.option-chip-body > :last-child {
  margin-bottom: 0;
}

.option-chip-body p,
.option-chip-body ul,
.option-chip-body ol,
.option-chip-body blockquote,
.option-chip-body pre,
.option-chip-body h1,
.option-chip-body h2,
.option-chip-body h3 {
  margin: 0 0 10px;
}

.option-chip-body p {
  margin: 0;
  line-height: 1.7;
}

.option-chip-body ul,
.option-chip-body ol {
  padding-left: 20px;
}

.option-chip-body li + li {
  margin-top: 4px;
}

.option-chip-body blockquote {
  padding-left: 12px;
  border-left: 3px solid rgba(128, 82, 42, 0.2);
}

.option-chip-body pre {
  overflow-x: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 26, 22, 0.94);
  color: rgba(248, 242, 232, 0.96);
}

.option-chip-title strong,
.option-chip-title em,
.option-chip-body strong,
.option-chip-body em {
  color: var(--text);
}

.intake-field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.intake-required {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(176, 72, 52, 0.08);
  font-size: 12px;
  color: var(--danger);
}

.intake-hint {
  margin: -4px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.intake-field-error {
  margin: -4px 0 0;
  color: var(--danger);
  line-height: 1.65;
  font-size: 13px;
  font-weight: 600;
}

.intake-field.is-invalid {
  border-color: rgba(201, 72, 61, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 0 3px rgba(201, 72, 61, 0.12),
    0 10px 24px rgba(44, 33, 20, 0.05);
}

.intake-field.is-invalid .intake-field-label {
  color: var(--danger);
}

.intake-field.is-invalid input,
.intake-field.is-invalid textarea,
.intake-field.is-invalid .intake-table-wrap,
.intake-field.is-invalid .intake-choice {
  border-color: rgba(201, 72, 61, 0.32);
}

.intake-field input,
.intake-field textarea,
textarea,
.access-input {
  width: 100%;
  border: 1px solid rgba(55, 43, 30, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 14px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.intake-choice-group {
  display: grid;
  gap: 10px;
}

.intake-field--single_choice .intake-choice-group {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.intake-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(55, 43, 30, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  line-height: 1.65;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.intake-choice span {
  display: block;
  flex: 1;
}

.intake-choice:hover {
  border-color: rgba(97, 74, 52, 0.2);
  background: rgba(255, 252, 247, 0.96);
}

.intake-choice:has(input:checked) {
  border-color: rgba(97, 74, 52, 0.26);
  background: rgba(243, 236, 227, 0.96);
  box-shadow: 0 8px 18px rgba(44, 33, 20, 0.04);
}

.intake-choice input {
  width: auto;
  margin-top: 3px;
  padding: 0;
}

@media (max-width: 720px) {
  .intake-section-fields {
    grid-template-columns: 1fr;
  }

  .intake-field--half,
  .intake-field--third {
    grid-column: 1 / -1;
  }
}

.composer {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  width: min(920px, calc(100vw - 48px));
  padding: 16px;
  transform: translateX(-50%);
  background: rgba(251, 247, 241, 0.94);
}

.composer-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.composer-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

textarea {
  min-height: 104px;
  resize: none;
  line-height: 1.7;
}

.composer-footer {
  margin-top: 12px;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.primary-button {
  border: 1px solid transparent;
  background: var(--primary-strong);
  color: #f8f2e8;
}

.primary-button:hover {
  background: var(--primary);
}

.ghost-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.72);
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(41, 31, 22, 0.34);
  backdrop-filter: blur(18px);
}

.access-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 28px;
}

.access-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.access-error {
  margin: 0;
  color: var(--danger);
  line-height: 1.6;
}

@keyframes shimmerSweep {
  0% {
    transform: translate3d(-48%, 0, 0);
  }

  100% {
    transform: translate3d(48%, 0, 0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.94);
  }

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

@keyframes cursorGlow {
  0%,
  100% {
    opacity: 0.74;
    transform: scaleY(0.9);
  }

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

@media (max-width: 720px) {
  body {
    padding: 16px 16px calc(var(--composer-safe-height) + 24px);
  }

  .topbar,
  .topbar-actions,
  .composer-header,
  .intake-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .composer {
    bottom: 16px;
    width: calc(100vw - 32px);
  }

  .message-shell,
  .message.user .message-shell,
  .message.trace .message-shell,
  .message.thinking .message-shell,
  .message.stream.trace-stream .message-shell,
  .message.skill-activity .message-shell {
    width: 100%;
  }
}
