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

:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border: #e5e5e5;
  --text: #171717;
  --text-secondary: #737373;
  --text-muted: #a3a3a3;
  --primary: #171717;
  --primary-hover: #000;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { opacity: 0.7; }

.muted { color: var(--text-secondary); font-size: 0.875rem; }
.text-center { text-align: center; }

.center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.container {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.flex { display: flex; }
.gap { gap: 0.5rem; }
.mt-2 { margin-top: 1rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.card h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text-secondary);
}

input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--text);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  padding-left: 2.25rem;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: var(--danger);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-full {
  width: 100%;
}

.navbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

.logo {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.alert {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.entry-card:hover {
  border-color: var(--text);
  text-decoration: none;
}

.entry-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.entry-info strong {
  font-size: 0.9375rem;
  font-weight: 500;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: #f5f5f5;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.empty-state .btn {
  margin-top: 1.5rem;
}

.detail-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-of-type {
  border-bottom: none;
}

.label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-width: 72px;
  flex-shrink: 0;
}

.icon-sm {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.detail-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.btn .icon-sm {
  margin-right: 0.375rem;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 2.5rem;
}

.btn-toggle {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}

.btn-toggle:hover {
  color: var(--text);
  background: var(--bg);
}

.password-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9375rem;
  word-break: break-all;
}
