:root {
  --ink: #1c1916;
  --paper: #f6f1e8;
  --card: #fffdf8;
  --line: #d8d0c4;
  --muted: #6b645b;
  --person: #2f5d50;
  --group: #6b3f2a;
  --idea: #3d4c7a;
  --ok: #2f5d50;
  --error: #8a2b2b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background: var(--paper);
  color: var(--ink);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.75rem;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

h1 span,
.sub {
  color: var(--muted);
  font-weight: 400;
  font-size: 1rem;
}

nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
}

nav a:hover { text-decoration: underline; }

main {
  padding: 0 1.5rem 3rem;
  max-width: 880px;
}

.auth-main { max-width: 28rem; }

.card,
.gate,
.save {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}

.save {
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
}

.card p:first-child,
.gate p:first-child { margin-top: 0; }

.muted,
.gate p,
.help {
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

label {
  display: block;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.7rem 0 0.25rem;
}

input,
select,
button,
textarea {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
}

input[type="search"] { min-width: 16rem; flex: 1; }

input,
textarea { width: 100%; }

button { cursor: pointer; width: auto; }

button.primary,
button[type="submit"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

button.secondary {
  background: transparent;
  color: var(--ink);
}

button.danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}

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

.hidden { display: none; }

.save-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.title { font-weight: 700; }
.title a { color: inherit; text-decoration: none; }
.title a:hover { text-decoration: underline; }

.url {
  color: var(--muted);
  font-size: 0.85rem;
  word-break: break-all;
  margin: 0.25rem 0 0.4rem;
}

.note { margin: 0; }
.meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.45rem; }

.chip {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  color: #fff;
}

.chip.person { background: var(--person); }
.chip.group { background: var(--group); }
.chip.idea { background: var(--idea); }

.empty { color: var(--muted); }
.error { color: var(--error); }
.ok { color: var(--ok); }

.token-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}

.token-row:first-of-type { border-top: 0; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.banner {
  background: #efe4cf;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin: 0 0 1rem;
}

.google {
  width: 100%;
  margin-top: 0.75rem;
}

.split {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1rem 0;
}

.split::before,
.split::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
