/* Brewery app shared styles */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --danger: #b91c1c;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

.app {
  width: 100%;
  max-width: 780px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246,247,249,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

p {
  margin: 0;
  color: var(--muted);
}

.sub,
.count,
.meta {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  min-height: 48px;
  background: #fff;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15,118,110,.12);
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.badge,
.pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
}

.badge.yes {
  background: #ecfdf5;
  color: #047857;
}

.badge.no {
  background: #fef2f2;
  color: #b91c1c;
}

.notes {
  white-space: pre-wrap;
  line-height: 1.5;
  margin-top: 12px;
}

.search {
  margin-top: 16px;
  position: relative;
}

.panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.panel.hidden {
  display: none;
}

.msg {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  background: #fffbe6;
}

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

.item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 16px;
  text-align: left;
}

.item:last-child {
  border-bottom: 0;
}

.item:hover,
.item:focus {
  background: #f9fafb;
}

.new {
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.split {
  display: grid;
  gap: 12px;
}

.page-title {
  margin: 0;
}

.page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.header-copy {
  min-width: 0;
  flex: 1;
}

.brewery-card {
  display: grid;
  gap: 12px;
}

.brewery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.brewery-title {
  min-width: 0;
  flex: 1;
}

.brewery-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.brewery-actions .btn {
  white-space: nowrap;
}

.beers {
  display: grid;
  gap: 12px;
}

.beer {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.beer-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.beer-name {
  font-weight: 700;
  font-size: 16px;
}

.beer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.beer-table th,
.beer-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.beer-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.beer-table a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.beer-table a:hover {
  text-decoration: underline;
}

.beer-table .rating,
.beer-table .abv {
  white-space: nowrap;
}

.beer-table .notes {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (min-width: 720px) {
  body {
    padding-top: 24px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    font-size: 26px;
  }

  .search-row {
    display: flex;
    gap: 10px;
  }

  .search-row input {
    flex: 1;
  }

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

  .brewery-head {
    align-items: flex-start;
  }
}

@media (max-width: 719px) {
  .brewery-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .brewery-actions .btn {
    padding: 10px 12px;
    min-height: 40px;
    font-size: 14px;
  }

  .beer-table th:nth-child(4),
  .beer-table td:nth-child(4),
  .beer-table th:nth-child(5),
  .beer-table td:nth-child(5) {
    display: none;
  }

  .beer-table th,
  .beer-table td {
    padding: 8px 6px;
  }
}