:root {
  color-scheme: light;
  font-family: Avenir Next, system-ui, sans-serif;
  color: #22233e;
  background: #eeeff5;
  --paper: #fff;
  --line: #d6d7e4;
  --muted: #545675;
  --accent: #52369a;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100% - 40px, 1040px); margin: clamp(32px, 8vh, 90px) auto 64px; }
h1, h2, p { margin: 0; }

.intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 18px 32px;
  margin-bottom: 28px;
}

.intro h1 { font-size: clamp(2.25rem, 6vw, 4.25rem); line-height: 1.06; letter-spacing: -.055em; }
.intro h1 + p { max-width: 34em; margin-top: 12px; color: var(--muted); line-height: 1.55; }
.environment { display: grid; gap: 3px; max-width: 100%; padding-left: 12px; border-left: 3px solid #ad96e4; }
.environment span { font-size: .82rem; color: var(--muted); }
.environment strong { max-width: 28ch; overflow-wrap: anywhere; }

.connection {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  color: #f8f7ff;
  background: #2f2852;
  border-radius: 13px;
  margin-bottom: 28px;
}

.connection div { display: grid; gap: 5px; min-width: 0; padding: 16px clamp(10px, 3vw, 24px); }
.connection div + div { border-left: 1px solid #51486e; }
.connection div > span { color: #d8cee9; font-size: .82rem; }
.state { font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
.state::before {
  content: "";
  display: inline-block;
  width: .56em;
  aspect-ratio: 1;
  margin-right: .45em;
  border-radius: 50%;
  background: #bfb1da;
}
.state[data-state="ok"]::before { background: #94e6c2; }
.state[data-state="error"]::before { background: #ffaeaa; }

.workspace { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.composer { padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
h2 { font-size: 1.28rem; line-height: 1.25; letter-spacing: -.02em; }
form { margin-top: 16px; }
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  resize: vertical;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #f8f7fc;
  font: inherit;
  line-height: 1.5;
}
textarea::placeholder { color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-top: 14px; }
#counter { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
button { min-height: 44px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: white; background: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
button:hover:enabled { background: #422780; }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid #7c54d2; outline-offset: 3px; }
.form-status { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.form-status:empty { margin-top: 0; }
.form-status[data-error="true"] { color: #9b2440; }

.history { min-width: 0; padding: 9px 0 0; }
.history-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.refresh { background: transparent; color: #422780; border-color: #bcb3d3; }
.refresh:hover:enabled { background: #e3dcf3; }
.list-status { padding: 17px 0; color: var(--muted); line-height: 1.5; }
.list-status:empty { padding: 0; }
ol { list-style: none; margin: 0; padding: 0; }
li { padding: 13px 0 15px; border-bottom: 1px solid var(--line); }
li time { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
li p { margin-top: 4px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 670px) {
  .workspace { grid-template-columns: 1fr; }
  .connection { margin-bottom: 20px; }
  .connection div { padding-inline: 10px; }
  .state { font-size: .82rem; }
}
