:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --ink: #211F1C;
  --ink-muted: #6B6860;
  --border: #E4E1D8;
  --accent: #1F6F64;
  --accent-ink: #FFFFFF;
  --danger: #B3432E;
  --warn: #B3831F;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.wrap-narrow {
  max-width: 380px;
  margin: 0 auto;
  padding: 96px 24px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0 0 32px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 100, 0.15);
}

textarea {
  resize: vertical;
  min-height: 64px;
}

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

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

.btn-primary:disabled {
  background: var(--border);
  color: var(--ink-muted);
  cursor: not-allowed;
}

.btn-text {
  background: none;
  color: var(--ink-muted);
  padding: 10px 8px;
}

.btn-text:hover { color: var(--ink); }

.field-row { margin-bottom: 16px; }

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 12px 0 0;
  display: none;
}

.error.visible { display: block; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.topbar-meta {
  font-size: 13px;
  color: var(--ink-muted);
}

.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.entry-label {
  font-size: 15px;
  font-weight: 600;
}

.entry-meta {
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  display: none;
}

.dot.visible { display: inline-block; }

.entry-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.saved-msg {
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.saved-msg.visible { opacity: 1; }

.empty-state {
  color: var(--ink-muted);
  font-size: 14px;
  padding: 32px 0;
  text-align: center;
}
