:root {
  color-scheme: light dark;
  --bg: #f5efe4;
  --panel: rgba(255, 252, 247, 0.88);
  --ink: #132130;
  --muted: #5f6f7d;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --line: rgba(19, 33, 48, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --panel: rgba(27, 35, 44, 0.92);
    --ink: #f8fafc;
    --muted: #b7c3cf;
    --accent: #34d399;
    --accent-strong: #a7f3d0;
    --line: rgba(248, 250, 252, 0.08);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.14), transparent 26%),
    linear-gradient(180deg, #f8f1e4 0%, var(--bg) 100%);
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 60px;
  display: grid;
  gap: 20px;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px 0;
}

.site-footer-link {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-footer-link:hover,
.site-footer-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(18, 33, 46, 0.08);
}

.hero {
  padding: 32px;
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-button {
  min-width: 68px;
  padding: 10px 14px;
}

.lang-button.active {
  color: #fff;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-size: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 0.96;
  margin-bottom: 12px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.browser-send {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

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

.browser-send input,
.browser-send textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
}

.browser-send textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.touch-entry {
  display: grid;
  grid-template-columns: minmax(0, 240px) auto;
  gap: 12px;
  margin-top: 24px;
}

.touch-entry input {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
}

@media (prefers-color-scheme: dark) {
  .browser-send input,
  .browser-send textarea,
  .touch-entry input {
    background: rgba(15, 23, 42, 0.8);
  }
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}

button.secondary {
  color: var(--ink);
  background: rgba(19, 33, 48, 0.08);
}

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

.hint {
  margin-top: 18px;
  color: var(--muted);
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.idle,
.pill.pending {
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-strong);
}

.pill.granted {
  background: rgba(22, 163, 74, 0.16);
  color: #166534;
}

.pill.denied {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.subtle,
.empty {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 12px;
}

.session-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(19, 33, 48, 0.06);
  color: var(--ink);
}

.session-item.selected {
  background: rgba(15, 118, 110, 0.16);
}

.session-item span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 20px;
  }

  .hero,
  .panel {
    border-radius: 22px;
    padding: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .hero-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .send-actions {
    grid-template-columns: 1fr;
  }

  .touch-entry {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}