:root {
  color-scheme: light;
  --bg: #f8f7f2;
  --panel: #ffffff;
  --text: #151515;
  --muted: #66645d;
  --line: #d9d6ca;
  --accent: #0b7a53;
  --accent-dark: #075e40;
  --danger: #b3261e;
  --focus: #c27a12;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 44px rgba(36, 32, 20, 0.12);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbfaf6;
  font-size: 13px;
  white-space: nowrap;
}

.pill.busy {
  color: var(--focus);
  border-color: rgba(194, 122, 18, 0.35);
}

.pill.ok {
  color: var(--accent);
  border-color: rgba(11, 122, 83, 0.35);
}

.pill.error {
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.35);
}

.open-button {
  width: 100%;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0;
  transition: background 140ms ease, transform 140ms ease;
}

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

.open-button:active {
  transform: translateY(1px);
}

.open-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  line-height: 1;
}

.key-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 16px;
}

.key-form.saved {
  display: none;
}

.key-form label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

.key-form input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.key-form button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #f1efe8;
  color: var(--text);
  cursor: pointer;
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

@media (max-width: 440px) {
  .shell {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .open-button {
    min-height: 88px;
    font-size: 21px;
  }
}

