:root {
  --bg: #f7f7f5;
  --surface: #f9f9f7;
  --surface-low: #f4f4f2;
  --surface-high: #e8e8e6;
  --text: #121212;
  --muted: #636363;
  --border: #e5e5e2;
  --bottle-green: #006a4e;
  --green: #2e7d32;
  --red: #c62828;
  --error: #ba1a1a;
  --container: 640px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 22px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.brand strong {
  color: var(--bottle-green);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}

.brand span,
.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  overflow-x: auto;
}

.nav button,
.link-button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  font-size: 14px;
  line-height: 20px;
}

.nav button.active,
.link-button.active {
  border-color: var(--text);
  color: var(--text);
}

.primary {
  border: 0;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.add-button {
  background: var(--bottle-green);
}

.add-button:hover {
  background: #00543e;
}

.secondary,
.danger {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger {
  color: var(--error);
}

.page {
  padding: 48px 24px 72px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  margin: 0 0 8px;
  color: var(--bottle-green);
  font-size: 40px;
  line-height: 48px;
}

.hero p {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}

.auth-box {
  border-left: 1px solid var(--border);
  padding-left: 48px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 32px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}

.section {
  margin-top: 48px;
}

.section:first-child {
  margin-top: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.list {
  border-top: 1px solid var(--border);
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.item:hover,
.item.open {
  background: var(--surface-low);
  margin-inline: -12px;
  padding-inline: 12px;
}

.item-title {
  font-weight: 600;
}

.item-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 28px;
  min-height: 28px;
  padding: 2px;
}

.icon-button.active.up {
  color: var(--green);
}

.icon-button.active.down {
  color: var(--red);
}

.icon-button.active.heart {
  color: var(--text);
}

.comment {
  display: none;
  grid-column: 1 / -1;
  margin-top: 8px;
  border: 1px solid var(--border);
  background: var(--surface-high);
  padding: 16px;
}

.item:hover .comment,
.item.open .comment {
  display: block;
}

.empty-slot {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  padding: 16px 0;
  text-align: center;
}

.tabs,
.category-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 32px;
}

.feed-filter {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.category-choice {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  padding: 12px 8px;
  text-align: center;
}

.category-choice.active {
  border-color: var(--text);
  background: var(--surface-high);
}

form {
  display: grid;
  gap: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

label,
.label {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-bottom-color: var(--text);
}

.form-panel {
  display: grid;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  background: var(--bg);
}

.compact-panel {
  margin-top: 16px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.notice,
.error {
  border: 1px solid var(--border);
  background: var(--surface-low);
  color: var(--muted);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 20px;
}

.error {
  border-color: color-mix(in srgb, var(--error) 40%, var(--border));
  color: var(--error);
}

.group-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.member-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.danger-button {
  margin-top: 12px;
}

.invite-link {
  word-break: break-all;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .container,
  .topbar-inner,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .auth-box {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 32px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .item {
    grid-template-columns: 1fr;
  }

  .item-actions {
    justify-content: flex-start;
  }
}
