* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f7f7f8;
  color: #1a1a1a;
  margin: 0;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 16px;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  gap: 8px;
}

.row > * {
  flex: 1;
  min-width: 0;
}

input, select, button {
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d0d0d5;
}

button {
  background: #1a1a1a;
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #333;
}

.link-btn {
  background: none;
  border: none;
  color: #888;
  padding: 4px;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.save-form {
  margin-bottom: 12px;
}

.save-feedback {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.save-feedback.success {
  background: #d7f5df;
  color: #146c2e;
}

.save-feedback.error {
  background: #fbdada;
  color: #9c1c1c;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 12px;
  background: #ececef;
}

.filters a.active {
  background: #1a1a1a;
  color: #fff;
}

ul.links {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.links li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e5e8;
}

ul.links li a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1a1a1a;
}

.group-tag {
  font-size: 0.75rem;
  color: #888;
  background: #ececef;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

form.inline {
  display: inline;
}

.muted {
  color: #888;
  font-size: 0.9rem;
}

ul.flashes {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

ul.flashes li {
  background: #fff3cd;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

dialog#edit-dialog {
  border: none;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
}

dialog#edit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

dialog#edit-dialog h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}
