:root {
  --accent: #2564cf;
  --accent-dark: #1c4ea3;
  --ink: #1b1b1f;
  --ink-soft: #5b5b63;
  --line: #e3e3e8;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --success: #157f3c;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.header__mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.header__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.header__subtitle {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.3;
}

.app {
  padding: 16px;
}

.modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.mode:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.mode:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mode[aria-pressed="true"] {
  border-color: var(--accent);
  background: #eef3fc;
}

.mode__label {
  font-weight: 600;
  font-size: 13px;
}

.mode__hint {
  color: var(--ink-soft);
  font-size: 11.5px;
}

.instructions {
  margin-bottom: 14px;
}

.instructions__label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.instructions__input {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}

.instructions__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11.5px;
  cursor: pointer;
}

.voice-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-soft);
}

.voice-btn[aria-pressed="true"] {
  border-color: #d34a4a;
  color: #d34a4a;
}

.voice-btn[aria-pressed="true"] .voice-btn__dot {
  background: #d34a4a;
  animation: pulse 1.1s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.primary-btn {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn:hover:not(:disabled) { background: var(--accent-dark); }

.primary-btn:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.primary-btn:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

.status-panel {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-panel__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-panel__text {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.result-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: #eef8f1;
  border: 1px solid #cfead9;
}

.result-panel__icon {
  color: var(--success);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.result-panel__text {
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 8px;
}

.result-panel__link {
  display: inline-block;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.result-panel__link:hover { text-decoration: underline; }

.signin {
  padding: 24px 16px;
  text-align: center;
}

.signin__text {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-bottom: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .status-panel__spinner,
  .voice-btn[aria-pressed="true"] .voice-btn__dot {
    animation: none;
  }
}
