:root {
  color-scheme: light dark;
  --bg: #08090a;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #8a8f98;
  --accent: #5b8def;
  --error: #e5534b;
}

* {
  border: none;
  text-decoration: none;
  outline: none;
  user-select: none;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
}

.card {
  width: 100%;
  max-width: 320px;
  background: #161617;
  border: 1px solid #262626;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.7);
  border-radius: 14px;
  padding: 16px;
}

.card-title {
  margin: 0 0 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.shorten-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.url-input {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.7);
  color: #c4c4c4;
  font-family: InterLight;
  font-size: 14px;
  width: 100%;
  height: 30px;
  transition: all 300ms ease;
}

.url-input:hover {
  background: rgba(225, 225, 225, 0.10);
  border: 1px solid rgba(225, 225, 225, 0.04);
  color: #e5e5e5;
}

.url-input:active {
  background: rgba(225, 225, 225, 0.14);
  color: #e5e5e5;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0),
    0 0 3px rgba(0, 0, 0, 0);
}

.result-input {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  color: var(--text);
  flex: 1;
}

.shorten-btn {
  width: 100%;
  height: 30px;
  background: #3e74e5;
  border: 1px solid rgba(225, 225, 225, .03);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: InterLight;
  font-size: 14px;
  color: #e5e5e5;
  cursor: pointer;
  transition: all 300ms ease;
}

.shorten-btn:hover {
  background: #4681ff;
  border: 1px solid rgba(225, 225, 225, .04);
}

.shorten-btn:active {
  background: #538aff;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0),
    0 0 3px rgba(0, 0, 0, 0);
  transform: scale(0.98);
}

.copy-btn {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.ttl-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.segmented-title {
  flex-shrink: 0;
  font-family: InterLight;
  font-size: 12px;
  color: #c4c4c4;
  opacity: 0.8;
  user-select: none;
}

.segmented-control {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid #262626;
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.segmented-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-label {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: transparent;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0),
    0 0 3px rgba(0, 0, 0, 0);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: InterLight;
  font-size: 14px;
  color: #c4c4c4;
  cursor: pointer;
  transition: all 300ms ease;
}

.segmented-label:hover {
  background: rgba(225, 225, 225, 0.10);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.7);
  color: #e5e5e5;
}

.segmented-label:active {
  background: rgba(225, 225, 225, 0.14);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.3);
  color: #e5e5e5;
  transform: scale(0.98);
}

.segmented-input:checked+.segmented-label {
  background: rgba(225, 225, 225, 0.14);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    0 0 3px rgba(0, 0, 0, 0.3);
  color: #e5e5e5;
}

.shorten-btn:disabled {
  opacity: 0.7;
  pointer-events: none;
}

.copy-btn:disabled {
  opacity: 0.7;
  pointer-events: none;
}

.result {
  margin-top: 1.25rem;
}

.result-row {
  display: flex;
  gap: 0.5rem;
}

#result-meta {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.error {
  margin-top: 1rem;
  color: var(--error);
  font-size: 0.9rem;
}

.hidden {
  display: none;
}