:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #54a9ff;
  --accent-dim: #388bfd33;
  --success: #3fb950;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1f3a5f 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

header {
  margin-bottom: 2rem;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2aabee, #229ed9);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.tagline {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

input[type='url'],
input[type='text'] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #21262d;
  border-color: #484f58;
}

.btn-primary {
  background: linear-gradient(145deg, #2aabee, #229ed9);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  border-color: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.result[hidden] {
  display: none !important;
}

.result-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.result-url {
  word-break: break-all;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--accent);
}

.toast {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--success);
}

.toast[hidden] {
  display: none !important;
}

.error-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f8514918;
  border: 1px solid #f8514966;
  color: #ff7b72;
  font-size: 0.9rem;
}

.error-box[hidden] {
  display: none !important;
}

#go-page {
  text-align: center;
}

.go-card {
  text-align: center;
}

.go-lead {
  margin: 0 auto 0.25rem;
  max-width: 26rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}

.go-error {
  margin-left: auto;
  margin-right: auto;
  max-width: 28rem;
  text-align: left;
}

.go-source-wrap {
  margin: 1.5rem auto 0;
  width: 100%;
  max-width: 32rem;
}

.go-source-label {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
}

.go-source-box {
  box-sizing: border-box;
  width: 100%;
  padding: 1.1rem 1.2rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #1c2128 0%, var(--bg) 100%);
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-dim),
    0 8px 32px rgba(84, 169, 255, 0.14);
  text-align: center;
}

.go-source-display {
  margin: 0;
  min-height: 1.5em;
  word-break: break-all;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 1.08rem;
  font-weight: 600;
  color: #79c0ff;
  line-height: 1.5;
  user-select: all;
}

.go-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.go-actions .btn-primary {
  width: 100%;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
}

.footer-home {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-home a {
  color: var(--accent);
  text-decoration: none;
}

.footer-home a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .row-actions {
    flex-direction: column;
  }

  .row-actions .btn {
    width: 100%;
  }
}
