﻿:root {
  --page: #fffdf8;
  --surface: #ffffff;
  --surface-soft: #f9f9f9;
  --input: rgba(10, 10, 10, 0.05);
  --input-strong: rgba(10, 10, 10, 0.08);
  --ink: #0a0a0a;
  --ink-soft: #474747;
  --muted: #8c8c8c;
  --line: #e5e5e5;
  --line-strong: #d1d1d1;
  --green: #512906;
  --green-deep: #3d1f04;
  --green-soft: rgba(81, 41, 6, 0.1);
  --cream: #fef5de;
  --blush: #fef5de;
  --gold: #ffc934;
  --danger: #5e0831;
  --shadow-sm: 0 4px 12px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 10, 10, 0.06);
  --shadow-lg: 0 12px 36px rgba(10, 10, 10, 0.08);
  --radius-lg: 10px;
  --radius-xl: 10px;
  --tabbar-height: 76px;
  --font-sans:
    'SuisseIntl', 'Inter', "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC",
    "Microsoft YaHei", Arial, sans-serif;
  --font-roman: 'IowanOld', 'Iowan Old Style', Georgia, "Times New Roman", "Times Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: calc(var(--tabbar-height) + 28px);
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
}

body.welcome-active {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

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

a {
  color: inherit;
}

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

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.terminal-welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(18px, 5vw, 72px);
  background: var(--page);
  color: var(--ink);
}

.terminal-welcome[hidden] {
  display: none;
}

.terminal-window {
  width: min(900px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.72);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #c65d42;
}

.terminal-dots span:nth-child(2) {
  background: var(--gold);
}

.terminal-dots span:nth-child(3) {
  background: #512906;
}

.terminal-topbar p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-roman);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.terminal-body {
  display: grid;
  min-height: min(500px, calc(100vh - 170px));
  place-content: center;
  padding: clamp(34px, 6vw, 72px);
}

.terminal-line {
  display: flex;
  width: min(780px, 100%);
  min-height: clamp(104px, 14vw, 160px);
  align-items: baseline;
  gap: 12px;
  color: var(--ink);
  font-size: clamp(1.28rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.terminal-prompt {
  flex: 0 0 auto;
  color: var(--green);
  font-family: var(--font-roman);
  font-size: clamp(0.78rem, 1.2vw, 0.94rem);
  font-weight: 700;
}

.terminal-cursor {
  display: inline-block;
  width: 0.28em;
  height: 0.9em;
  margin-left: 0.1em;
  transform: translateY(0.1em);
  border-radius: 999px;
  background: var(--green);
  animation: terminal-cursor 900ms steps(1) infinite;
}

@keyframes terminal-cursor {
  50% {
    opacity: 0;
  }
}

.terminal-password {
  display: grid;
  width: min(560px, 100%);
  gap: 12px;
  margin: clamp(28px, 5vw, 54px) auto 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.terminal-password.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.terminal-password label {
  margin: 0;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 900;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.terminal-password input {
  height: 56px;
  margin: 0;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.05);
}

.terminal-password button {
  min-width: 104px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 22px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.terminal-password button:hover {
  border-color: rgba(81, 41, 6, 0.28);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.terminal-password p {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 850;
}

.terminal-password button:focus-visible,
.tab-button:focus-visible,
.submit-button:focus-visible,
.delete-button:focus-visible {
  outline: 3px solid rgba(81, 41, 6, 0.18);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 6vw, 96px);
  background: rgba(255, 253, 248, 0.86);
}

.brand {
  color: var(--green);
  font-family: var(--font-roman);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.app-tabs {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  z-index: 80;
  display: grid;
  min-height: var(--tabbar-height);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 40px rgba(10, 10, 10, 0.14);
  backdrop-filter: blur(22px);
}

.tab-button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.tab-button span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tab-button.is-active {
  background: rgba(81, 41, 6, 0.09);
  color: var(--green);
  font-weight: 900;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 68px - var(--tabbar-height));
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(28px, 5vw, 68px);
  padding: clamp(42px, 7vw, 86px) clamp(20px, 6vw, 96px);
}

.hero-canvas {
  display: none;
}

.hero-copy {
  max-width: 680px;
}

.site-label,
.section-heading p {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 7em;
  margin-bottom: 22px;
  color: var(--ink);
  font-size: clamp(2.8rem, 8vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 28px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.34rem);
  line-height: 1.85;
}

.danmaku-panel {
  width: min(100%, 620px);
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.danmaku-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 850;
}

.danmaku-panel-heading span:last-child {
  color: var(--muted);
  font-family: var(--font-roman);
  font-size: 0.78rem;
}

.danmaku-layer {
  position: relative;
  height: 150px;
  overflow: hidden;
  pointer-events: none;
}

.danmaku-item {
  position: absolute;
  top: var(--top);
  right: 0;
  display: inline-flex;
  max-width: min(520px, 76vw);
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(110%);
  animation: danmaku-move var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.danmaku-name {
  color: var(--green);
  margin-right: 8px;
  font-weight: 900;
}

@keyframes danmaku-move {
  from {
    transform: translateX(110%);
  }

  to {
    transform: translateX(calc(-100vw - 120%));
  }
}

.message-form,
.feature-form {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.feature-form {
  position: sticky;
  top: 88px;
}

.form-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.form-heading p {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.form-heading span {
  color: var(--muted);
  font-family: var(--font-roman);
  font-size: 0.86rem;
  font-weight: 700;
}

label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--input);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(71, 71, 71, 0.54);
}

input {
  height: 48px;
  margin-bottom: 17px;
  padding: 0 16px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px 16px;
  line-height: 1.65;
}

input:focus,
textarea:focus {
  border-color: rgba(81, 41, 6, 0.42);
  background: rgba(81, 41, 6, 0.06);
  box-shadow: 0 0 0 4px rgba(81, 41, 6, 0.08);
}

.upload-field {
  margin-bottom: 17px;
}

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

.upload-dropzone {
  display: grid;
  min-height: 132px;
  place-items: center;
  gap: 8px;
  border: 1.5px dashed rgba(81, 41, 6, 0.28);
  border-radius: 10px;
  margin: 0;
  padding: 22px;
  background: var(--input);
  color: var(--green);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.upload-dropzone svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.upload-dropzone span {
  font-size: 1rem;
  font-weight: 900;
}

.upload-dropzone small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.file-input:focus-visible + .upload-dropzone,
.upload-dropzone:hover {
  border-color: rgba(81, 41, 6, 0.48);
  background: var(--input-strong);
  transform: translateY(-1px);
}

.form-actions {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.submit-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  padding: 0 20px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(81, 41, 6, 0.18);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
  background: var(--green-deep);
  box-shadow: 0 16px 30px rgba(81, 41, 6, 0.22);
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.form-status {
  min-width: 0;
  margin: 0;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 800;
}

.messages,
.feature-page,
.records-page {
  min-height: calc(100vh - 68px - var(--tabbar-height));
  padding: clamp(36px, 7vw, 82px) clamp(20px, 6vw, 96px);
}

.messages {
  padding-top: clamp(18px, 5vw, 58px);
}

.feature-page,
.records-page {
  background: var(--page);
}

.section-heading {
  display: grid;
  max-width: 760px;
  gap: 4px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 3.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.message-list {
  column-count: 3;
  column-gap: 16px;
}

.message-card {
  position: relative;
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.message-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding-right: 34px;
}

.message-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.message-author {
  min-width: 0;
}

.message-author strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-author time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message-card .card-actions {
  position: absolute;
  top: 16px;
  right: 16px;
}

.delete-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.04);
  color: rgba(10, 10, 10, 0.34);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}

.delete-button:hover {
  background: rgba(168, 91, 80, 0.1);
  color: var(--danger);
}

.delete-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.message-card p {
  margin-bottom: 14px;
  color: var(--ink-soft);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.message-card footer {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--cream);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.empty-state,
.feature-empty {
  border: 1px dashed rgba(81, 41, 6, 0.22);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-weight: 750;
}

.message-list .empty-state {
  display: block;
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
}

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 17px;
  border: 0;
  padding: 0;
}

.role-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 850;
}

.role-picker label {
  margin: 0;
}

.role-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.role-picker span {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--input);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 850;
}

.role-picker input:checked + span {
  border-color: rgba(81, 41, 6, 0.28);
  background: var(--green);
  color: #fff;
}

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

.feature-column h3 {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 1.05rem;
  font-weight: 900;
}

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

.feature-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-card img,
.feature-image-placeholder {
  display: block;
  width: calc(100% - 20px);
  aspect-ratio: 16 / 10;
  margin: 10px 10px 0;
  border-radius: 10px;
  object-fit: cover;
  background: var(--cream);
}

.feature-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.feature-content {
  padding: 16px 18px 18px;
}

.feature-content header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.feature-content h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.feature-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.role-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.feature-time {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.feature-note {
  margin: 0 0 13px;
  color: var(--ink-soft);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.feature-link {
  display: inline-flex;
  max-width: 100%;
  min-height: 36px;
  align-items: center;
  border-radius: 10px;
  padding: 0 12px;
  background: var(--cream);
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.feature-link:hover {
  background: #f5ebd0;
}

.feature-link-text {
  margin: 0;
  border-left: 3px solid rgba(81, 41, 6, 0.22);
  padding-left: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.records-shell {
  display: grid;
  min-height: calc(100vh - 68px - var(--tabbar-height) - clamp(72px, 14vw, 164px));
  grid-template-rows: auto auto auto 1fr;
  gap: 18px;
}

.records-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius-xl);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.records-card div {
  display: grid;
  gap: 5px;
}

.records-card strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
}

.records-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.records-original-link,
.records-more-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(81, 41, 6, 0.1);
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.records-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-radius: 999px;
  padding: 7px;
  background: rgba(81, 41, 6, 0.08);
}

.records-view-tab {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 950;
  cursor: pointer;
}

.records-view-tab.is-active {
  background: var(--surface);
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

.records-view {
  display: grid;
  min-height: 0;
  gap: 14px;
}

.records-view[hidden] {
  display: none;
}

.records-timeline-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
  text-align: center;
}

.records-stream {
  height: min(720px, calc(100vh - 300px));
  min-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-xl);
  padding: 16px clamp(12px, 3vw, 24px) 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)),
    var(--cream);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: rgba(81, 41, 6, 0.28) transparent;
}

.records-load-older {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 14px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.records-load-older:disabled {
  cursor: default;
  opacity: 0.55;
}

.records-filter {
  display: grid;
  gap: 14px;
  border-radius: var(--radius-xl);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.records-field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 900;
}

.records-field input,
.records-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  background: rgba(81, 41, 6, 0.08);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.records-field input:focus,
.records-field select:focus {
  border-color: rgba(81, 41, 6, 0.36);
  background: #fff;
}

.records-status {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.records-candidates {
  display: grid;
  gap: 10px;
}

.records-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.records-candidate-body {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.records-candidate:hover,
.records-candidate:focus-visible {
  outline: 2px solid rgba(81, 41, 6, 0.22);
  outline-offset: 2px;
  background: rgba(81, 41, 6, 0.06);
}

.records-candidate-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.records-candidate-text {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 780;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.records-candidate mark {
  border-radius: 7px;
  padding: 0 3px;
  background: rgba(255, 201, 52, 0.72);
  color: var(--ink);
  font-weight: 950;
}

.records-candidate-preview {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 10px;
  background: rgba(81, 41, 6, 0.08);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
}

.records-candidate-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.records-candidate-preview.is-emoji img {
  padding: 8px;
  object-fit: contain;
}

.records-media-fallback {
  display: grid;
  min-width: 112px;
  min-height: 72px;
  place-items: center;
  border: 1px dashed rgba(81, 41, 6, 0.22);
  border-radius: 10px;
  padding: 12px;
  background: rgba(81, 41, 6, 0.08);
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.records-context-toolbar {
  position: sticky;
  top: 76px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.records-context-toolbar[hidden] {
  display: none;
}

.records-context-toolbar span {
  max-width: min(420px, 42vw);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 900;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-context-button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(81, 41, 6, 0.1);
  color: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.records-context-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.records-results {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 280px;
}

.records-flow-results {
  min-height: 0;
}

.records-date-divider {
  justify-self: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(10, 10, 10, 0.1);
  color: rgba(10, 10, 10, 0.62);
  font-size: 0.76rem;
  font-weight: 900;
}

.records-message {
  display: grid;
  gap: 7px;
  max-width: min(760px, 92%);
}

.records-message.is-mu {
  justify-self: start;
}

.records-message.is-you {
  justify-self: end;
}

.records-message.is-anchor .records-bubble {
  outline: 3px solid rgba(255, 201, 52, 0.92);
  outline-offset: 3px;
}

.records-message header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.records-message.is-you header {
  justify-content: flex-end;
}

.records-bubble {
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}

.records-message.is-you .records-bubble {
  background: var(--green);
  color: #fff;
}

.records-bubble .message-content {
  display: grid;
  gap: 8px;
}

.records-bubble .message-text {
  line-height: 1.65;
  white-space: pre-wrap;
}

.records-bubble .quoted-message {
  border-left: 3px solid rgba(81, 41, 6, 0.2);
  padding-left: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.records-message.is-you .quoted-message {
  border-left-color: rgba(255, 255, 255, 0.42);
  color: rgba(255, 255, 255, 0.72);
}

.records-bubble img.message-media,
.records-bubble video.message-media {
  display: block;
  width: min(100%, 320px);
  max-height: 360px;
  border-radius: 10px;
  object-fit: contain;
}

.records-bubble img.emoji {
  width: min(160px, 52vw);
}

.records-bubble audio {
  max-width: 100%;
}

.records-bubble a {
  color: inherit;
}

.records-more-button {
  justify-self: center;
  min-width: min(260px, 100%);
}

body > footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 22px clamp(20px, 6vw, 96px);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

body > footer span:first-child {
  font-family: var(--font-roman);
}

@media (min-width: 780px) {
  .app-tabs {
    right: auto;
    left: 50%;
    width: min(560px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
}

@media (min-width: 981px) {
  body {
    padding-bottom: 0;
  }

  .app-header {
    border-bottom: 1px solid var(--line);
  }

  .app-tabs {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    min-height: 58px;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    border-radius: 10px;
    padding: 6px;
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .tab-button {
    min-height: 46px;
    border-radius: 10px;
  }
}

@media (max-width: 980px) {
  .hero,
  .feature-layout {
    grid-template-columns: 1fr;
  }

  .message-form,
  .feature-form {
    max-width: 620px;
  }

  .feature-form {
    position: static;
  }

  .message-list {
    column-count: 2;
  }
}

@media (max-width: 680px) {
  :root {
    --tabbar-height: 72px;
  }

  .terminal-welcome {
    align-items: start;
    padding: 14px;
  }

  .terminal-window {
    min-height: calc(100vh - 28px);
  }

  .terminal-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px;
  }

  .terminal-body {
    min-height: calc(100vh - 110px);
    padding: 26px 18px;
    align-content: center;
    justify-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 180px auto;
    row-gap: 26px;
  }

  .terminal-line {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 180px;
    font-size: 1.58rem;
    line-height: 1.25;
  }

  .terminal-prompt {
    display: block;
    margin-bottom: 12px;
  }

  .terminal-password {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 0;
  }

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

  .terminal-password button {
    width: 100%;
    min-width: 0;
    min-height: 72px;
  }

  .app-header {
    min-height: 58px;
    padding: 12px 18px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .app-tabs {
    border-radius: 10px;
    padding: 7px;
  }

  .tab-button {
    min-height: 56px;
    border-radius: 10px;
    font-size: 0.72rem;
  }

  .tab-icon {
    width: 21px;
    height: 21px;
  }

  .hero,
  .messages,
  .feature-page,
  .records-page {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero {
    padding-top: 30px;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
  }

  .hero-text {
    font-size: 1.02rem;
  }

  .form-heading,
  .form-actions,
  .records-card,
  body > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .submit-button,
  .records-card .submit-button,
  .records-original-link {
    width: 100%;
  }

  .records-shell {
    grid-template-rows: auto auto auto 1fr;
    gap: 14px;
  }

  .records-view-tabs {
    border-radius: 10px;
  }

  .records-view-tab {
    min-height: 48px;
    border-radius: 10px;
  }

  .records-stream {
    height: calc(100svh - 262px);
    min-height: 430px;
    border-radius: 10px;
    padding: 14px 10px 18px;
  }

  .records-filter,
  .records-card {
    border-radius: 10px;
    padding: 16px;
  }

  .records-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .records-context-toolbar {
    top: 14px;
    grid-template-columns: 1fr 1fr;
    border-radius: 10px;
  }

  .records-context-toolbar span {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: 100%;
  }

  .records-context-button {
    grid-row: 2;
  }

  .records-candidate {
    grid-template-columns: minmax(0, 1fr) 64px;
    border-radius: 10px;
    padding: 12px;
  }

  .records-candidate-preview {
    width: 64px;
    height: 64px;
    border-radius: 10px;
  }

  .records-field-wide {
    grid-column: 1 / -1;
  }

  .records-message {
    max-width: 96%;
  }

  .records-bubble {
    border-radius: 10px;
  }

  .message-list {
    column-count: 1;
  }

  .feature-columns {
    grid-template-columns: 1fr;
  }

  .feature-card img,
  .feature-image-placeholder {
    width: calc(100% - 18px);
    margin: 9px 9px 0;
    border-radius: 10px;
  }
}

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

/* Opennote redesign: ink on parchment */
:root {
  --page: #fffdf8;
  --surface: #fffdf8;
  --surface-soft: #f9f9f9;
  --input: #f9f9f9;
  --input-strong: #fffdf8;
  --ink: #0a0a0a;
  --ink-soft: #474747;
  --muted: #8c8c8c;
  --line: #e5e5e5;
  --line-strong: #d1d1d1;
  --green: #512906;
  --green-deep: #3b1d04;
  --green-soft: rgba(81, 41, 6, 0.08);
  --cream: #fef5de;
  --blush: #fef5de;
  --gold: #ffc934;
  --danger: #5e0831;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --radius-lg: 10px;
  --radius-xl: 10px;
  --page-max-width: 1200px;
  --tabbar-height: 0px;
}

body {
  padding-bottom: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
.brand,
.form-heading p,
.records-card strong {
  font-family: var(--font-roman);
  font-weight: 500;
}

.terminal-welcome {
  padding: 24px;
  background: var(--page);
}

.terminal-window {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  background: var(--page);
  box-shadow: none;
  backdrop-filter: none;
}

.terminal-topbar {
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.terminal-topbar p {
  color: var(--ash-gray, #8c8c8c);
  letter-spacing: 0;
}

.terminal-body {
  min-height: min(460px, calc(100vh - 120px));
  padding: clamp(32px, 7vw, 80px);
}

.terminal-line {
  min-height: 120px;
  color: var(--ink);
  font-family: var(--font-roman);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
}

.terminal-prompt {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 400;
}

.terminal-password label,
label,
.field-label,
.role-picker legend,
.records-field {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 400;
}

.terminal-password input,
input,
textarea,
.records-field input,
.records-field select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input);
  color: var(--ink);
  font-weight: 400;
}

.terminal-password input:focus,
input:focus,
textarea:focus,
.records-field input:focus,
.records-field select:focus {
  border-color: var(--line-strong);
  background: var(--page);
  box-shadow: none;
}

.terminal-password button,
.submit-button,
.records-original-link,
.records-more-button,
.records-context-button,
.records-load-older {
  border: 1px solid var(--green);
  border-radius: 10px;
  background: var(--green);
  color: var(--page);
  box-shadow: none;
  font-weight: 400;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.terminal-password button:hover,
.submit-button:hover,
.records-original-link:hover,
.records-more-button:hover,
.records-context-button:hover,
.records-load-older:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
  transform: none;
  box-shadow: none;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  width: min(var(--page-max-width), calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 0;
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--ink);
  font-size: 20px;
  text-decoration: none;
}

.app-tabs {
  position: static;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  width: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  backdrop-filter: none;
}

.tab-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}

.tab-button:hover,
.tab-button.is-active {
  border-bottom-color: var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 400;
}

.tab-icon {
  display: none;
}

main {
  display: grid;
}

.hero,
.messages,
.feature-page,
.records-page {
  width: min(var(--page-max-width), calc(100% - 48px));
  margin: 0 auto;
  padding-right: 0;
  padding-left: 0;
}

.hero {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 40px;
  padding-top: 80px;
  padding-bottom: 80px;
  text-align: center;
}

.hero-copy {
  display: grid;
  justify-items: center;
  max-width: 760px;
}

.opennote-figure {
  width: min(180px, 52vw);
  height: auto;
  margin-bottom: 32px;
  color: var(--ink);
}

.opennote-figure path,
.opennote-figure circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.opennote-figure circle {
  fill: var(--gold);
}

.site-label,
.section-heading p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

h1 {
  max-width: 820px;
  margin: 0 0 24px;
  font-size: clamp(42px, 7vw, 64px);
  line-height: 1.08;
}

.hero-text {
  max-width: 660px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.5;
}

.danmaku-panel {
  width: min(100%, 700px);
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: none;
}

.danmaku-panel-heading {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.danmaku-panel-heading span:last-child {
  color: var(--muted);
  font-family: var(--font-sans);
}

.danmaku-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink-soft);
  font-weight: 400;
}

.danmaku-name {
  color: var(--green);
  font-weight: 400;
}

.message-form,
.feature-form,
.records-card,
.records-filter,
.records-candidate,
.message-card,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.message-form {
  max-width: 720px;
  padding: 24px;
  text-align: left;
}

.feature-form {
  top: 96px;
  padding: 24px;
}

.form-heading {
  align-items: end;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.form-heading p {
  color: var(--ink);
  font-size: 32px;
  line-height: 1.2;
}

.form-heading span {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
}

.upload-dropzone,
.role-picker span,
.empty-state,
.feature-empty,
.records-media-fallback {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-weight: 400;
}

.upload-dropzone:hover,
.file-input:focus-visible + .upload-dropzone {
  border-color: var(--green);
  background: var(--cream);
  transform: none;
}

.role-picker input:checked + span {
  border-color: var(--green);
  background: var(--cream);
  color: var(--ink);
}

.form-actions {
  align-items: center;
}

.submit-button {
  min-height: 52px;
  padding: 0 24px;
}

.messages,
.feature-page,
.records-page {
  min-height: auto;
  padding-top: 80px;
  padding-bottom: 80px;
}

.messages {
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 40px;
}

.section-heading h2 {
  font-family: var(--font-roman);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
}

.message-list {
  column-gap: 16px;
}

.message-card {
  padding: 16px;
}

.message-avatar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 400;
}

.message-author strong,
.feature-content h4,
.feature-column h3 {
  color: var(--ink);
  font-family: var(--font-roman);
  font-weight: 500;
}

.delete-button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 400;
}

.delete-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.message-card footer,
.role-tag,
.feature-link {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 400;
}

.feature-layout {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 40px;
}

.feature-columns {
  gap: 16px;
}

.feature-column h3 {
  font-size: 24px;
}

.feature-card {
  overflow: hidden;
}

.feature-card img,
.feature-image-placeholder {
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
}

.feature-content {
  padding: 16px;
}

.feature-link:hover {
  background: var(--gold);
}

.feature-link-text {
  border-left: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-weight: 400;
}

.records-shell {
  min-height: auto;
  gap: 16px;
}

.records-card {
  padding: 16px;
}

.records-card strong {
  font-size: 24px;
}

.records-card span,
.records-status,
.records-timeline-head,
.records-candidate-meta,
.records-message header {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.records-original-link,
.records-more-button {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.records-view-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: var(--surface-soft);
}

.records-view-tab {
  min-width: 96px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 400;
}

.records-view-tab.is-active {
  background: var(--page);
  color: var(--ink);
  box-shadow: none;
}

.records-stream {
  height: min(760px, calc(100vh - 260px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: none;
}

.records-load-older {
  border-color: var(--line-strong);
  background: var(--page);
  color: var(--ink);
}

.records-field input,
.records-field select {
  background: var(--surface-soft);
}

.records-candidate {
  border: 1px solid var(--line);
  padding: 16px;
}

.records-candidate:hover,
.records-candidate:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 0;
  background: var(--cream);
}

.records-candidate-text {
  font-weight: 400;
}

.records-candidate mark {
  border-radius: 4px;
  background: var(--gold);
  font-weight: 400;
}

.records-candidate-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-soft);
  font-weight: 400;
}

.records-context-toolbar {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: none;
}

.records-context-button {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.records-date-divider {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--muted);
  font-weight: 400;
}

.records-bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  box-shadow: none;
}

.records-message.is-you .records-bubble {
  border-color: var(--green);
  background: var(--green);
  color: var(--page);
}

.records-message.is-anchor .records-bubble {
  outline: 2px solid var(--gold);
}

body > footer {
  width: min(var(--page-max-width), calc(100% - 48px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 0;
  }

  .app-tabs {
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .feature-layout {
    grid-template-columns: 1fr;
  }

  .feature-form,
  .message-form {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .app-header,
  .hero,
  .messages,
  .feature-page,
  .records-page,
  body > footer {
    width: min(100% - 32px, var(--page-max-width));
  }

  .terminal-welcome {
    padding: 16px;
  }

  .terminal-window {
    min-height: calc(100vh - 32px);
  }

  .terminal-body {
    grid-template-rows: auto auto;
    min-height: calc(100vh - 96px);
    padding: 28px 18px;
  }

  .terminal-line {
    min-height: 0;
    font-size: clamp(32px, 12vw, 42px);
  }

  .terminal-password button {
    min-height: 56px;
  }

  h1 {
    font-size: clamp(42px, 13vw, 54px);
  }

  .hero-text {
    font-size: 18px;
  }

  .messages,
  .feature-page,
  .records-page {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .form-heading,
  .form-actions,
  .records-card,
  body > footer {
    align-items: stretch;
  }

  .feature-columns,
  .records-filter-grid {
    grid-template-columns: 1fr;
  }

  .records-view-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .records-stream {
    height: calc(100svh - 250px);
    min-height: 420px;
  }

  .records-candidate {
    grid-template-columns: minmax(0, 1fr) 64px;
  }
}

/* Opennote interaction layer */
button,
a,
input,
textarea,
select,
.upload-dropzone,
.role-picker span,
.message-card,
.feature-card,
.records-candidate,
.records-bubble {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.tab-button {
  position: relative;
  border-bottom: 0;
  text-decoration: none;
}

.tab-button::after,
.brand::after {
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  background: var(--line);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 140ms ease, background-color 140ms ease;
}

.brand {
  position: relative;
}

.brand::after {
  bottom: -8px;
}

.tab-button:hover::after,
.tab-button.is-active::after,
.brand:hover::after,
.brand:focus-visible::after {
  background: var(--ink);
  transform: scaleX(1);
}

.tab-button:hover,
.tab-button.is-active {
  border-bottom-color: transparent;
}

.terminal-password button,
.submit-button {
  border-color: var(--green);
  background: var(--green);
  color: var(--page);
}

.terminal-password button:hover,
.submit-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.terminal-password button:active,
.submit-button:active,
.records-original-link:active,
.records-more-button:active,
.records-context-button:active,
.records-load-older:active,
.records-view-tab:active,
.delete-button:active {
  opacity: 0.72;
}

.records-original-link,
.records-more-button,
.records-context-button,
.records-load-older {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.records-original-link:hover,
.records-more-button:hover,
.records-context-button:hover,
.records-load-older:hover {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.terminal-password button:focus-visible,
.tab-button:focus-visible,
.brand:focus-visible,
.submit-button:focus-visible,
.delete-button:focus-visible,
.records-original-link:focus-visible,
.records-more-button:focus-visible,
.records-context-button:focus-visible,
.records-load-older:focus-visible,
.records-view-tab:focus-visible,
.records-candidate:focus-visible,
.upload-dropzone:focus-visible,
.role-picker input:focus-visible + span,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(81, 41, 6, 0.34);
  outline-offset: 3px;
}

input:focus,
textarea:focus,
select:focus,
.records-field input:focus,
.records-field select:focus {
  border-color: var(--green);
  background: var(--page);
}

.upload-dropzone:hover,
.file-input:focus-visible + .upload-dropzone,
.role-picker label:hover span {
  border-color: var(--green);
  background: var(--cream);
}

.role-picker input:checked + span {
  border-style: solid;
}

.message-card:hover,
.feature-card:hover,
.records-candidate:hover {
  border-color: var(--line-strong);
  background: #fffaf0;
}

.message-card:hover .message-avatar,
.feature-card:hover img,
.feature-card:hover .feature-image-placeholder,
.records-candidate:hover .records-candidate-preview {
  border-color: var(--line-strong);
}

.delete-button:hover {
  border-color: var(--line-strong);
  background: var(--page);
  color: var(--danger);
}

.feature-link,
.message-card footer,
.role-tag {
  text-decoration: none;
}

.feature-link:hover {
  border-color: var(--ink);
  background: var(--gold);
}

.records-view-tab:hover {
  background: var(--page);
  color: var(--ink);
}

.records-view-tab.is-active {
  border: 1px solid var(--line);
}

.records-candidate:focus-visible {
  background: var(--cream);
}

.records-bubble a,
.feature-link-text a {
  text-decoration-color: var(--line);
  text-underline-offset: 8px;
}

.records-bubble a:hover,
.feature-link-text a:hover {
  text-decoration-color: var(--ink);
}

button:disabled,
.submit-button:disabled,
.records-load-older:disabled,
.records-context-button:disabled {
  opacity: 0.45;
  pointer-events: none;
}
