:root {
  --ink: #17211a;
  --muted: #66715f;
  --paper: #f4f0e6;
  --panel: rgba(255, 252, 242, 0.86);
  --line: rgba(23, 33, 26, 0.16);
  --green: #28684a;
  --green-dark: #163f2c;
  --amber: #b46825;
  --red: #9e2b2b;
  --shadow: 0 24px 80px rgba(23, 33, 26, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Gill Sans", Verdana, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(40, 104, 74, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 4%, rgba(180, 104, 37, 0.22), transparent 30rem),
    linear-gradient(135deg, #f7f2e5 0%, #e4ead8 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.1rem;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  box-shadow: 0 12px 26px rgba(40, 104, 74, 0.22);
}

button:hover {
  transform: translateY(-1px);
  background: var(--green-dark);
}

button.ghost {
  color: var(--green-dark);
  background: rgba(40, 104, 74, 0.1);
  box-shadow: none;
}

button.danger {
  background: var(--red);
  box-shadow: 0 12px 26px rgba(158, 43, 43, 0.18);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.76rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(40, 104, 74, 0.65);
  box-shadow: 0 0 0 4px rgba(40, 104, 74, 0.12);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  line-height: 0.9;
}

h2 {
  font-size: 1.45rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.subtitle {
  max-width: 740px;
  font-size: 1.02rem;
}

.panel,
.hero-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px;
}

.label {
  color: var(--muted);
  font-size: 0.86rem;
}

#serviceState {
  font-size: 1.7rem;
  font-family: Georgia, "Times New Roman", serif;
}

.panel {
  padding: 24px;
}

.token-panel,
.section-head {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.accounts-list,
.messages-list,
.result-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.44);
}

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

.account-item,
.message-item {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.account-item:last-child,
.message-item:last-child {
  border-bottom: 0;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--green-dark);
  background: rgba(40, 104, 74, 0.11);
  font-size: 0.78rem;
}

.logs-panel {
  margin-top: 24px;
}

pre {
  margin: 18px 0 0;
  min-height: 210px;
  max-height: 360px;
  overflow: auto;
  border-radius: 22px;
  padding: 16px;
  color: #d7f3df;
  background: #102118;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.83rem;
  white-space: pre-wrap;
}

.copyable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

@media (max-width: 820px) {
  .hero,
  .grid,
  .token-panel {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
