:root {
    color-scheme: light dark;
    --bg: #f7f7f7;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --text: #1d1b20;
    --muted: #5f5f6a;
    --border: #d9d9df;
    --border-strong: #b8b8c2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
    --accent: #6750a4;
    --accent-soft: rgba(103, 80, 164, 0.08);
    --qr-size: 100px;
  }

  * {
    box-sizing: border-box;
  }

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

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

  .page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
  }

  .page.is-loading {
    visibility: hidden;
  }

  .card {
    width: min(100%, 720px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

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

  .title-copy {
    min-width: 0;
    flex: 1 1 auto;
  }

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 10px;
}

.copy-url-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: -9px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.copy-url-button:hover {
  background: rgba(103, 80, 164, 0.04);
  color: var(--accent);
}

.copy-url-button:focus-visible {
  outline: 2px solid rgba(103, 80, 164, 0.2);
  outline-offset: 2px;
}

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

.copy-url-button svg {
  width: 12px;
  height: 12px;
}

  .qr-inline {
    flex: 0 0 auto;
    width: var(--qr-size);
    height: var(--qr-size);
  }

  .qr-inline .qr-code {
    width: var(--qr-size);
    height: var(--qr-size);
  }

  .qr-inline .qr-code svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .qr-placeholder-code {
    width: 100%;
    height: 100%;
  }

  .qr-placeholder-code svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
  }

  h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
  }

  .intro {
    margin: 0 0 28px;
    color: var(--muted);
  }

  .form {
    display: grid;
    gap: 16px;
  }

  .server-switcher {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    overflow: hidden;
  }

  .server-switcher button {
    appearance: none;
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    border-inline-start: 1px solid var(--border-strong);
    border-radius: 0;
    background: var(--surface-strong);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    transition:
      background-color 120ms ease,
      border-color 120ms ease,
      color 120ms ease,
      transform 120ms ease;
  }

  .server-switcher button:first-child {
    border-inline-start: 0;
  }

  .server-switcher button:hover {
    background: rgba(103, 80, 164, 0.04);
  }

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

  .server-switcher button[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .server-group {
    display: grid;
    gap: 12px;
    padding-top: 2px;
  }

  .server-group[hidden] {
    display: none;
  }

  .server-fields {
    display: grid;
    gap: 12px;
  }

  .advanced-settings-divider {
    margin: 18px 0 10px;
    border: 0;
    border-top: 1px solid var(--border);
  }

  .advanced-settings > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    width: fit-content;
  }

  .advanced-settings > summary::-webkit-details-marker {
    display: none;
  }

  .advanced-settings > summary::after {
    content: "▾";
    color: var(--muted);
    font-size: 0.85em;
    opacity: 0.8;
    transform: translateY(1px);
    transition: transform 120ms ease;
  }

  .advanced-settings[open] > summary::after {
    transform: translateY(1px) rotate(180deg);
  }

  .advanced-settings-body {
    display: grid;
    gap: 12px;
    padding-top: 12px;
  }

  .tag-suggestions-switch {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: fit-content;
    min-height: 40px;
    padding: 2px 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .tag-suggestions-switch input {
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    margin: 0;
    border: 1px solid rgba(95, 95, 106, 0.18);
    border-radius: 999px;
    background: rgba(95, 95, 106, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    transition:
      background-color 120ms ease,
      border-color 120ms ease,
      transform 120ms ease;
  }

  .tag-suggestions-switch input::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface-strong);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(0, 0, 0, 0.03);
    transform: translateY(-50%);
    transition: transform 120ms ease;
  }

  .tag-suggestions-switch input:checked {
    background: rgba(103, 80, 164, 0.42);
    border-color: rgba(103, 80, 164, 0.52);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .tag-suggestions-switch input:checked::after {
    transform: translateX(16px) translateY(-50%);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(103, 80, 164, 0.08);
  }

  .tag-suggestions-switch:focus-within {
    color: var(--text);
  }

  .tag-suggestions-switch input:focus-visible {
    outline: 2px solid rgba(103, 80, 164, 0.2);
    outline-offset: 2px;
  }

  .field {
    display: grid;
    gap: 6px;
  }

  .field[hidden] {
    display: none;
  }

  .field-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .field-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
  }

  .copy-deeplink-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-top: 2px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    cursor: pointer;
    transition:
      background-color 120ms ease,
      border-color 120ms ease,
      color 120ms ease,
      transform 120ms ease;
  }

  .copy-deeplink-button:hover {
    background: rgba(103, 80, 164, 0.04);
    color: var(--accent);
  }

  .copy-deeplink-button:focus-visible {
    outline: 2px solid rgba(103, 80, 164, 0.2);
    outline-offset: 2px;
  }

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

  .copy-deeplink-button svg {
    width: 14px;
    height: 14px;
  }

  .generated-divider {
    margin: 20px 0 10px 0;
    border: 0;
    border-top: 1px solid var(--border);
  }

  .deeplink-output {
    display: block;
    text-decoration: none;
    min-height: 108px;
    padding: 14px 16px;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-family:
      ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", monospace;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .deeplink-output[href]:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  input {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
    font: inherit;
  }

  input {
    padding: 14px 16px;
  }

  input:focus {
    outline: 2px solid rgba(103, 80, 164, 0.2);
    outline-offset: 2px;
    border-color: var(--accent);
  }

  @media (max-width: 640px) {
    .card {
      padding: 20px;
      border-radius: 20px;
    }

    .title-row {
      gap: 14px;
    }

    .server-switcher button {
      padding: 11px 14px;
      font-size: 0.95rem;
    }

    .server-group + .server-group {
      padding-top: 14px;
    }

    .advanced-settings > summary {
      margin: 0;
      justify-content: flex-start;
    }

    .advanced-settings-body {
      padding-top: 10px;
    }
  }


