:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --ink: #1d2425;
  --muted: #66706a;
  --line: #dfe4dc;
  --accent: #1f7a5c;
  --accent-dark: #155b44;
  --warning: #9c5b16;
  --danger: #a63a32;
  --shadow: 0 18px 50px rgba(30, 43, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.landing-shell {
  display: grid;
  gap: 86px;
  width: min(1180px, calc(100vw - 32px));
  margin: 22px auto 56px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 16px;
  z-index: 10;
  border: 1px solid rgba(223, 228, 220, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px rgba(30, 43, 36, 0.08);
  padding: 10px 12px 10px 18px;
  backdrop-filter: blur(18px);
}

.landing-nav-actions,
.landing-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-nav-actions a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.landing-nav-actions a:hover {
  color: var(--accent-dark);
}

.landing-nav-cta,
.landing-primary,
.landing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 900;
  text-decoration: none;
}

.landing-nav-cta {
  min-height: 40px;
  padding: 0 18px;
  background: var(--ink);
  color: #ffffff !important;
}

.landing-primary {
  min-width: 154px;
  padding: 0 24px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 122, 92, 0.22);
}

.landing-primary:hover,
.landing-nav-cta:hover {
  transform: translateY(-1px);
}

.landing-secondary {
  min-width: 106px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(380px, 1.1fr);
  align-items: start;
  gap: 62px;
  min-height: min(720px, calc(100vh - 170px));
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 76% 20%, rgba(43, 189, 151, 0.16), transparent 32%);
  border-radius: 32px;
  padding: 58px 56px 64px;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: auto 9% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31, 122, 92, 0.34), transparent);
}

.landing-copy {
  display: grid;
  gap: 18px;
  padding-top: 16px;
}

.landing-copy h1 {
  max-width: 720px;
  font-size: clamp(3.15rem, 5.9vw, 6rem);
  letter-spacing: 0;
  line-height: 0.94;
}

.landing-tagline {
  color: var(--ink) !important;
  font-size: clamp(1.25rem, 2.4vw, 1.72rem) !important;
  line-height: 1.35 !important;
  max-width: 640px !important;
}

.landing-copy p:not(.eyebrow) {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.7;
}

.landing-small-note {
  color: var(--accent-dark) !important;
  font-size: 0.9rem !important;
  font-weight: 850 !important;
}

.landing-product-card {
  align-self: start;
  display: grid;
  gap: 16px;
  border: 1px solid rgba(223, 228, 220, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(30, 43, 36, 0.15);
  padding: 18px;
}

.landing-product-card .home-assistant-card,
.landing-product-card .home-preview-card {
  border-radius: 14px;
}

.landing-controls-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.landing-product-card.is-animating [data-preview-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(10px);
}

.landing-preview-slider {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbf8;
  padding: 14px;
}

.landing-preview-slider .slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.landing-preview-slider label,
.landing-preview-slider output {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-preview-slider output {
  color: var(--ink);
  text-transform: none;
}

.landing-preview-slider input[type="range"] {
  --range-progress: 0%;
  width: 100%;
  height: 8px;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) var(--range-progress), #dfe7e1 var(--range-progress));
  opacity: 1;
}

.landing-preview-slider input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  appearance: none;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: #32c89d;
  box-shadow: 0 6px 18px rgba(31, 122, 92, 0.26);
}

.landing-preview-slider input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 4px solid #ffffff;
  border-radius: 999px;
  background: #32c89d;
  box-shadow: 0 6px 18px rgba(31, 122, 92, 0.26);
}

.landing-preview-slider.is-active input[type="range"]::-webkit-slider-thumb {
  animation: sliderPulse 0.75s ease infinite;
}

.landing-preview-slider.is-active input[type="range"]::-moz-range-thumb {
  animation: sliderPulse 0.75s ease infinite;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

@keyframes sliderPulse {
  50% {
    box-shadow: 0 0 0 8px rgba(50, 200, 157, 0.16), 0 6px 18px rgba(31, 122, 92, 0.26);
  }
}

.landing-section {
  display: grid;
  gap: 26px;
}

.landing-section-head {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.landing-section-head h2,
.landing-trust h2,
.landing-final-cta h2 {
  max-width: 760px;
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 1.02;
}

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

.landing-card-grid article,
.landing-steps article,
.landing-trust,
.landing-final-cta {
  border: 1px solid rgba(223, 228, 220, 0.92);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(30, 43, 36, 0.06);
  padding: 24px;
}

.landing-card-grid article {
  min-height: 205px;
  display: grid;
  align-content: start;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.landing-card-grid article:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 46px rgba(30, 43, 36, 0.1);
}

.landing-card-grid h3 {
  margin: 0;
  font-size: 1.2rem;
}

.landing-card-grid p,
.landing-steps p,
.landing-trust p,
.landing-final-cta p {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.65;
}

.landing-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.landing-proof span {
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
}

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

.landing-steps article {
  display: grid;
  gap: 12px;
}

.landing-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #e7f5ee;
  color: var(--accent-dark);
  font-weight: 900;
}

.landing-trust {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 34px;
  background:
    linear-gradient(135deg, rgba(31, 122, 92, 0.1), transparent 42%),
    #ffffff;
  padding: 36px;
}

.landing-final-cta {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 122, 92, 0.13), transparent 36%),
    #ffffff;
  padding: 48px 28px;
}

.landing-final-cta img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.landing-final-cta .landing-primary {
  margin-top: 8px;
}

.home-shell {
  display: grid;
  gap: 34px;
  width: min(1160px, calc(100vw - 32px));
  margin: 28px auto 42px;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(223, 228, 220, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(30, 43, 36, 0.08);
  padding: 12px 14px;
}

.home-nav-actions,
.home-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-nav-actions a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.home-nav-actions a:hover {
  color: var(--accent-dark);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
  gap: 30px;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 18%, rgba(31, 122, 92, 0.08), transparent 34%),
    #ffffff;
  box-shadow: var(--shadow);
  padding: 42px;
}

.home-copy {
  display: grid;
  gap: 18px;
}

.home-avatar {
  width: 96px;
  height: 96px;
  border: 1px solid rgba(31, 122, 92, 0.16);
  border-radius: 8px;
  background: #f7fbf8;
  object-fit: contain;
  padding: 10px;
  box-shadow: 0 18px 42px rgba(31, 122, 92, 0.14);
}

.home-copy h1 {
  max-width: 640px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.home-copy p:not(.eyebrow) {
  max-width: 610px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.7;
}

.home-primary,
.home-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  padding: 0 18px;
  text-decoration: none;
}

.home-primary {
  background: var(--accent);
  color: #ffffff;
}

.home-primary:hover {
  background: var(--accent-dark);
}

.home-secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.home-preview {
  display: grid;
  gap: 16px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 22px 60px rgba(30, 43, 36, 0.13);
  padding: 16px;
}

.home-preview-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 2px 4px;
}

.home-window-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #c9d7d0;
}

.home-window-title {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-assistant-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(31, 122, 92, 0.2);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.home-assistant-card img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #f7fbf8;
  object-fit: contain;
  padding: 6px;
}

.home-assistant-card div {
  display: grid;
  gap: 4px;
}

.home-assistant-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.draft-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #32c89d;
  box-shadow: 0 0 0 7px rgba(50, 200, 157, 0.12);
}

.home-assistant-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.home-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 18px;
}

.home-preview-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-preview-card p {
  margin: 12px 0 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.6;
  white-space: pre-line;
}

.typing-text {
  min-height: 1.6em;
}

.typing-text.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.12em;
  animation: draftCursorBlink 0.85s steps(2, start) infinite;
}

@keyframes draftCursorBlink {
  50% {
    opacity: 0;
  }
}

.accent-card {
  border-color: rgba(31, 122, 92, 0.24);
  background: #f2f8f5;
}

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

.home-features article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
}

.home-features h2 {
  font-size: 1.08rem;
}

.home-features p {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.6;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1.05fr);
  gap: 24px;
  width: min(1160px, calc(100vw - 32px));
  margin: 32px auto;
}

.composer,
.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.title-row,
.preview-header,
.send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.draft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.title-row {
  border: 1px solid rgba(223, 228, 220, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 28px rgba(30, 43, 36, 0.08);
  padding: 12px 14px;
}

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

.brand-home-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

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

.connect-button,
.menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 12px;
  text-decoration: none;
}

.connect-button:hover,
.menu-link:hover {
  background: #f1f7f4;
}

.connect-button.connected,
.menu-link.connected {
  background: #f7fbf8;
  color: var(--muted);
  cursor: default;
}

.logout-button {
  color: var(--muted);
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid rgba(31, 122, 92, 0.22);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(31, 122, 92, 0.18);
  text-decoration: none;
}

.user-avatar:hover,
.user-avatar[aria-expanded="true"] {
  background: var(--accent-dark);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(260px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 10px;
}

.user-menu-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 4px 4px 10px;
}

.user-menu-heading span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef7f2;
  color: var(--accent-dark);
  font-weight: 900;
}

.menu-link {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.user-menu-panel button.menu-link {
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  padding: 0 12px;
  text-align: left;
}

.user-menu-panel button.menu-link:hover {
  background: #f1f7f4;
}

.danger-link {
  color: var(--danger);
}

.brand-logo {
  width: 178px;
  height: 62px;
  border-radius: 8px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-subtitle,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-size: 1.35rem;
  font-weight: 850;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

h2 {
  font-size: 1.6rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbf8;
  color: var(--accent-dark);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #24b47e;
  box-shadow: 0 0 0 3px rgba(36, 180, 126, 0.14);
}

.status-pill.not-ready {
  border-color: rgba(166, 58, 50, 0.22);
  background: rgba(166, 58, 50, 0.08);
  color: var(--danger);
}

.status-pill.not-ready .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(166, 58, 50, 0.14);
}

.form-panel,
.draft-preview {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.slider-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.profile-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  cursor: pointer;
  padding: 13px 14px;
}

.profile-toggle input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.profile-toggle span {
  display: grid;
  gap: 3px;
}

.profile-toggle small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

.slider-head,
.scale-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

output,
.scale-labels {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

label {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="range"] {
  accent-color: var(--accent);
  cursor: pointer;
  padding: 0;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.14);
}

.copy-field {
  position: relative;
}

.copy-field input,
.copy-field textarea {
  padding-right: 54px;
}

.copy-icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid rgba(31, 122, 92, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0;
  box-shadow: 0 6px 14px rgba(30, 43, 36, 0.06);
}

.copy-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.copy-icon-button:hover {
  border-color: var(--accent);
  background: #eef7f2;
  color: var(--accent-dark);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
}

button:hover {
  background: var(--accent-dark);
}

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: #f1f4ef;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  margin-top: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.hidden {
  display: none;
}

.notice {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
}

.notice.error {
  color: var(--danger);
}

.notice.success {
  color: var(--accent-dark);
}

.history-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.history-head h2 {
  margin-top: 4px;
  font-size: 1.2rem;
}

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

.history-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 14px;
}

.history-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
}

.history-item:hover {
  border-color: rgba(31, 122, 92, 0.35);
  background: #f1f7f4;
}

.history-item strong,
.history-meta,
.history-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item strong {
  font-size: 0.95rem;
}

.history-meta,
.history-preview {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.feedback-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px 14px;
}

.feedback-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

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

.feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 44px;
  border: 1px solid rgba(31, 122, 92, 0.24);
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0 10px;
  box-shadow: 0 8px 18px rgba(30, 43, 36, 0.06);
}

.feedback-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.feedback-button:hover,
.feedback-button.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 122, 92, 0.18);
}

.feedback-button:disabled {
  cursor: default;
  transform: none;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 178px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 22px;
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.auth-copy,
.auth-switch {
  color: var(--muted);
  line-height: 1.6;
}

.auth-error {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(166, 58, 50, 0.22);
  border-radius: 8px;
  background: rgba(166, 58, 50, 0.08);
  color: var(--danger);
  font-weight: 700;
}

.auth-message {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(31, 122, 92, 0.22);
  border-radius: 8px;
  background: rgba(31, 122, 92, 0.08);
  color: var(--accent-dark);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.auth-form button {
  margin-top: 6px;
}

.auth-switch {
  margin: 22px 0 0;
  text-align: center;
}

.auth-switch a {
  color: var(--accent-dark);
  font-weight: 800;
}

.admin-button {
  color: var(--accent-dark);
}

.admin-shell {
  display: grid;
  gap: 24px;
  width: min(1060px, calc(100vw - 32px));
  margin: 32px auto;
}

.admin-header,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 28px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
}

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

.admin-metrics {
  display: grid;
  grid-template-columns: minmax(160px, 0.4fr) minmax(260px, 0.6fr);
  gap: 12px;
}

.admin-summary {
  display: inline-grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.admin-summary strong {
  font-size: 2rem;
  line-height: 1;
}

.token-summary {
  gap: 10px;
}

.token-range-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-range-form label {
  font-size: 0.82rem;
  text-transform: uppercase;
}

.token-range-form select {
  width: auto;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
}

.metric-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.user-table-wrap {
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.user-table th,
.user-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.user-table th {
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

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

.data-section {
  display: grid;
  gap: 14px;
}

.compact-table {
  min-width: 760px;
}

.compact-table th,
.compact-table td {
  vertical-align: top;
  font-size: 0.86rem;
}

.long-cell {
  max-width: 360px;
  white-space: pre-wrap;
}

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

.profile-card {
  display: grid;
  gap: 22px;
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-saved {
  margin: 0;
  border: 1px solid rgba(31, 122, 92, 0.2);
  border-radius: 999px;
  background: #eef7f2;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 12px;
}

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

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-save-button {
  width: fit-content;
  grid-column: 1 / -1;
}

.settings-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.settings-panel h2 {
  font-size: 1.35rem;
}

.settings-button {
  width: fit-content;
  padding: 0 16px;
}

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

.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(1160px, calc(100vw - 32px));
  margin: -10px auto 32px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

@media (max-width: 820px) {
  .landing-shell {
    gap: 48px;
    margin: 16px auto 28px;
  }

  .landing-nav {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 18px;
  }

  .landing-nav-actions {
    width: 100%;
    gap: 12px;
  }

  .landing-nav-cta {
    width: 100%;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 34px 22px;
  }

  .landing-copy h1 {
    font-size: clamp(2.8rem, 14vw, 4.4rem);
  }

  .landing-card-grid,
  .landing-steps,
  .landing-proof,
  .landing-trust {
    grid-template-columns: 1fr;
  }

  .landing-proof span {
    text-align: left;
  }

  .home-shell {
    margin: 16px auto 28px;
  }

  .home-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 24px;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
    margin: 16px auto;
  }

  .composer,
  .preview {
    padding: 20px;
  }

  .send-row {
    align-items: stretch;
    flex-direction: column;
  }

  .title-row {
    align-items: center;
    flex-direction: row;
    padding: 12px;
  }

  .header-actions {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }

  .draft-actions {
    width: 100%;
  }

  .brand-lockup {
    align-items: center;
  }

  .brand-logo {
    width: 150px;
    height: 52px;
  }

  .status-pill,
  .connect-button,
  .send-row button {
    width: 100%;
  }

  .title-row .status-pill {
    width: auto;
  }

  .admin-header,
  .admin-actions {
    align-items: center;
    flex-direction: row;
  }

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

  .profile-card-head {
    flex-direction: column;
  }

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

  .admin-metrics {
    grid-template-columns: 1fr;
  }

}
