:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --text: #0a0a0a;
  --muted: #0f172a;
  --border: #d4dde9;
  --border-input: #cbd5e1;
  --accent: #0ea5e9;
  --accent-muted: #e2e8f0;
  --input-bg: #f8fafc;
  --readonly-bg: #eef2ff;

  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  min-height: 100vh;
  min-width: 100vw;
  display: grid;
  place-items: center;
}

passhash-app {
  max-width: 640px;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 1.5rem;
  margin: 1.5rem;
  box-shadow: 0 4px 16px rgb(0 0 0 / 5%);

  h1 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
  }

  a {
    color: var(--accent);
  }

  .field {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  label:not(.option) {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--muted);
    gap: 0.5rem;
    margin-bottom: 0.25rem;
  }

  .copied-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--accent-muted);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 200ms ease;

    &.visible {
      opacity: 1;
    }
  }

  input[type="text"],
  input[type="password"],
  input[readonly],
  select {
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-input);
    background: var(--input-bg);
    width: 100%;
    box-sizing: border-box;
  }

  input[readonly] {
    background: var(--readonly-bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }

  .row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    > .field {
      flex: 1 1 160px;
    }
  }

  .options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }

  .button,
  button {
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;

    &.secondary {
      background: var(--accent-muted);
      color: var(--muted);
    }
  }

  datalist option {
    font-size: 0.95rem;
  }

  .tool-notes {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--muted);
  }

  .tool-notes summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }
}
