:root {
  --bg: #0f172a;
  --card: #111c37;
  --card-muted: rgba(255, 255, 255, 0.06);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.68);
  --border: rgba(148, 163, 184, 0.18);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 9px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.22), rgba(14, 23, 42, 0.84) 35%, #020617);
  color: var(--text);
}

body {
  width: 100%;
  padding: 48px 24px;
  margin: 0;
  box-sizing: border-box;
}

.app-shell {
  width: 100%;
  max-width: 1400px;
  display: grid;
  gap: 32px;
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

.site-header,
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-header__brand h1 {
  margin: 0;
}

.site-header__actions,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.excel-table {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  display: grid;
  gap: 16px;
}

.align-right {
  text-align: right;
}

.app-shell.auth-disabled {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

header h1 {
  margin: 0 0 8px 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
}

header p {
  margin: 0;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 720px;
}

.page-header {
  display: grid;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.page-logo {
  width: clamp(72px, 12vw, 120px);
  height: auto;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
  flex-shrink: 0;
}

.brand-copy h1 {
  margin: 0 0 8px 0;
}

.brand-copy p {
  margin: 0;
}

.primary-nav {
  margin-top: 20px;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.14);
  gap: 4px;
}

.site-header .primary-nav,
.header-bar .primary-nav {
  margin-top: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.18);
}

.nav-link.is-active {
  color: #0f172a;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  box-shadow: 0 10px 25px rgba(34, 211, 238, 0.32);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.admin-link:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.18);
}

.admin-link.is-active {
  color: #0f172a;
  border-color: transparent;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  box-shadow: 0 10px 25px rgba(34, 211, 238, 0.32);
}

.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.tasting-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 600;
}

.controls {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.controls--collapsible {
  padding: 0;
  display: block;
  overflow: hidden;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
}

.controls-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.toggle-controls {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-controls:hover {
  background: var(--card-muted);
  color: var(--text);
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 12px;
}

.controls--collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.controls-content {
  max-height: 800px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
  position: relative;
  z-index: 1;
}

.controls--collapsed .controls-content {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.filters-grid {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: start;
}

.filter-group {
  display: grid;
  gap: 12px;
}

.filter-group--search {
  grid-column: 1 / -1;
}

.filter-group--search input {
  width: 100%;
}

.control-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

#search-input,
#tasting-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 16px;
}

.chip-group {
  display: flex;
  gap: 12px;
}

.chip {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--card-muted);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip--active {
  background: var(--accent-soft);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.chip:not(.chip--active):hover {
  background: rgba(56, 189, 248, 0.12);
}

.table-area,
.form-area {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px 32px 32px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  width: 100%;
  max-width: 100%;
}

.form-area--prominent {
  border: 2px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, var(--card) 100%);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.2), 0 4px 20px rgba(56, 189, 248, 0.1);
}


.beer-years-cell {
  min-width: 140px;
}

.beer-year-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.beer-year-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.15);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.beer-year-empty {
  color: rgba(255, 255, 255, 0.4);
}

.form-mode-toggle {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.mode-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
  background: var(--card-muted);
  color: var(--text);
}

.mode-toggle-btn--active {
  background: var(--accent-soft);
  color: #e0f2fe;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-mode-container {
  margin-top: 24px;
}

.bulk-common-fields {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.bulk-members-section,
.bulk-beer-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.bulk-members-section h3,
.bulk-beer-section h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.section-description {
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.bulk-members-controls,
.bulk-beer-controls {
  background: rgba(15, 23, 42, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}

.bulk-members-list {
  margin-top: 16px;
}

.empty-message {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  padding: 12px;
  text-align: center;
}

.bulk-members-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.chip-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.bulk-members-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.bulk-template-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.templates-list {
  max-height: 400px;
  overflow-y: auto;
}

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

.template-card {
  padding: 16px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: var(--primary);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.template-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.template-delete {
  flex-shrink: 0;
  opacity: 0.6;
}

.template-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.template-card-info {
  display: grid;
  gap: 8px;
}

.template-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.template-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.template-preview {
  margin-top: 16px;
  padding: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
}

.template-preview .template-info {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text);
}

.template-preview .template-info strong {
  color: var(--text);
}

.bulk-table-section {
  display: grid;
  gap: 16px;
}

.bulk-member-indicator {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px;
  border-right: 2px solid var(--border);
  white-space: nowrap;
  background: rgba(56, 189, 248, 0.06);
}

.bulk-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.bulk-table-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.bulk-table-wrapper {
  max-height: 500px;
  overflow-y: auto;
}

.bulk-table-wrapper table {
  width: 100%;
}

.bulk-table-wrapper td {
  padding: 8px;
}

.beer-group-spacer td {
  background: transparent !important;
  border: none !important;
  height: 20px;
  padding: 0 !important;
}

.bulk-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.bulk-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}

.bulk-input::placeholder {
  color: var(--text-muted);
}

.bulk-remove-row {
  padding: 6px 10px;
  min-width: auto;
}

.bulk-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chart-area {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  display: grid;
  gap: 24px;
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.chart-details {
  margin-top: 16px;
}

.chart-summary {
  padding: 12px 16px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.chart-summary::-webkit-details-marker {
  display: none;
}

.chart-summary:hover {
  background: rgba(56, 189, 248, 0.12);
}

.chart-summary::marker {
  display: none;
}

.chart-details[open] .chart-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border);
}

.chart-content {
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  display: grid;
  gap: 24px;
}

.chart-search-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.chart-search-wrapper {
  display: grid;
  gap: 8px;
  width: 100%;
  grid-column: 1 / -1;
}

.chart-search-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chart-search-input {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s ease;
}

.chart-search-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.chart-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.chart-search-clear:hover {
  background: var(--card-muted);
  color: var(--text);
}

.chart-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  grid-column: 1 / -1;
}

.quick-filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-muted);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-filter-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.quick-filter-btn--active {
  background: var(--accent-soft);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.chart-results-info {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.beers-dialog-content {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}

.beers-dialog-content-large {
  max-height: 75vh;
  overflow-y: auto;
  padding: 16px;
}

.beers-dialog-large {
  max-width: 95vw;
  width: 100%;
  max-width: 1400px;
}

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

.beers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 8px 0;
}

.beer-card {
  background: var(--card-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.beer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
}

.beer-card-enhanced {
  background: var(--card-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.beer-card-enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(56, 189, 248, 0.5);
}

.beer-card-enhanced--selected {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.08);
}

.beer-card-selected-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(56, 189, 248, 0.95);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.beer-card-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--card);
  position: relative;
}

.beer-card-image-enhanced {
  width: 100%;
  aspect-ratio: 0.75;
  overflow: hidden;
  background: var(--card);
  position: relative;
}

.beer-card-image img,
.beer-card-image-enhanced img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.beer-card-enhanced:hover .beer-card-image-enhanced img {
  transform: scale(1.05);
}

.beer-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.beer-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.08) 100%);
}

.beer-card-image-placeholder span {
  font-size: 64px;
  opacity: 0.4;
}

.beer-card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.beer-card-content-enhanced {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.beer-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.beer-card-name-enhanced {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

.beer-card-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.beer-card-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.beer-card-stat-icon {
  font-size: 14px;
}

.beer-card-stat-text {
  font-weight: 500;
  color: var(--text);
}

.beer-card-dates {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.beer-card-date {
  font-size: 11px;
  color: var(--text-muted);
}

.beer-card-count {
  font-size: 12px;
  color: var(--text-muted);
}

.beer-card-rating {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.beer-history-cell {
  min-width: 220px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  padding: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.beer-history-cell--has-data {
  color: var(--text);
  font-weight: 500;
}

.beer-card-description {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.beer-card-description-enhanced {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.beer-item {
  padding: 16px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.beer-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.beer-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.beer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.beer-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.beer-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.beer-item-stats span {
  display: inline-flex;
  align-items: center;
}

.beers-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.pagination-btn {
  padding: 8px 16px;
  background: var(--card-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

.tasting-notes-filters {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tasting-notes-search-wrapper {
  display: grid;
  gap: 8px;
}

.tasting-notes-search-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tasting-notes-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.tasting-notes-search-input {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s ease;
}

.tasting-notes-search-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.tasting-notes-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.tasting-notes-search-clear:hover {
  background: var(--card-muted);
  color: var(--text);
}

.tasting-notes-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tasting-quick-filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-muted);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tasting-quick-filter-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.tasting-quick-filter-btn--active {
  background: var(--accent-soft);
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.tasting-notes-results-info {
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.tasting-notes-details {
  margin-top: 16px;
}

.tasting-notes-summary {
  padding: 12px 16px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.tasting-notes-summary::-webkit-details-marker {
  display: none;
}

.tasting-notes-summary:hover {
  background: rgba(56, 189, 248, 0.12);
}

.tasting-notes-summary::marker {
  display: none;
}

.tasting-notes-details[open] .tasting-notes-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border);
}

.tasting-notes-content {
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  display: grid;
  gap: 24px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.chart-fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.chart-fullscreen-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.chart-fullscreen-btn span {
  font-size: 16px;
}

.chart-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chart-fullscreen-content {
  width: 100%;
  max-width: 95vw;
  max-height: 95vh;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.chart-fullscreen-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-muted);
}

.chart-fullscreen-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.chart-fullscreen-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 400px;
  padding: 24px;
  overflow: auto;
}

.chart-fullscreen-wrapper canvas {
  max-width: 100%;
  height: auto !important;
}

.chart-beer-images {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.chart-beer-images-header {
  margin-bottom: 12px;
}

.chart-beer-images-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-beer-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-beer-image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chart-beer-image-item:hover {
  transform: translateY(-2px);
}

.chart-beer-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease, object-position 0.2s ease;
  will-change: transform, object-position;
}

.chart-beer-image-item:hover .chart-beer-image {
  border-color: rgba(56, 189, 248, 0.5);
}

.chart-beer-image-item--selected .chart-beer-image,
.chart-beer-image-item--selected .chart-beer-image-placeholder {
  border-color: #FFD700;
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.chart-beer-image-item--selected .chart-beer-image-name {
  color: #FFD700;
  font-weight: 600;
}

.chart-beer-image-placeholder {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.chart-beer-image-placeholder span {
  font-size: 32px;
  opacity: 0.4;
}

.chart-beer-image-name {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-table-wrapper table {
  min-width: 420px;
}

.members-area {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px 28px 28px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  display: grid;
  gap: 16px;
}

.members-area--compact {
  padding: 20px 24px 24px;
}

.members-details {
  margin-top: 16px;
}

.members-summary {
  padding: 12px 16px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background 0.2s ease;
}

.members-summary::-webkit-details-marker {
  display: none;
}

.members-summary:hover {
  background: rgba(56, 189, 248, 0.12);
}

.members-summary::marker {
  display: none;
}

.members-details[open] .members-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border);
}

.members-content {
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  display: grid;
  gap: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.members-form {
  display: grid;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

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

.section-header h2 {
  margin: 0;
  font-size: 24px;
}

.soft-button,
.primary-button,
.table-button {
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
  padding: 12px 18px;
}

.soft-button {
  background: var(--card-muted);
  color: var(--text);
}

.soft-button:hover {
  background: rgba(56, 189, 248, 0.14);
}

.primary-button {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #04111f;
  padding-inline: 24px;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.32);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.38);
}

.table-button {
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  padding: 8px 14px;
  font-size: 14px;
}

.table-button:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #f8fafc;
}

.table-button + .table-button {
  margin-left: 8px;
}

.table-button--danger {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.table-button--danger:hover {
  background: rgba(248, 113, 113, 0.32);
  color: #fee2e2;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
  table-layout: auto;
}

/* Ensure table-area tables show all columns */
.table-area table {
  table-layout: auto !important;
  width: 100% !important;
}

.table-area table colgroup {
  display: none; /* Remove any colgroup that might hide columns */
}

/* ============================================
   HISTORY COLUMN STYLING - MUST BE VISIBLE
   ============================================ */

/* Target the 5th column (Historikk) in the tasting notes table */
.table-area table thead tr th:nth-child(5),
.table-area table tbody tr td:nth-child(5) {
  min-width: 250px !important;
  max-width: 400px !important;
  width: auto !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  height: auto !important;
  max-height: none !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  text-align: left !important;
  vertical-align: top !important;
  clip: auto !important;
  clip-path: none !important;
  transform: none !important;
  margin: 0 !important;
}

/* Specific targeting by data-cell attribute */
.table-area table td[data-cell="history-scores"],
.table-area table td[data-cell="history-notes"],
.table-area table th[data-cell="history-scores"],
.table-area table th[data-cell="history-notes"] {
  min-width: 200px !important;
  max-width: 300px !important;
  width: auto !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: var(--text-muted) !important;
  text-align: left !important;
  vertical-align: top !important;
}

/* Style when history has content */
.table-area table td[data-cell="history-scores"].history-cell,
.table-area table td[data-cell="history-notes"].history-cell,
.table-area table tbody tr td:nth-child(5).history-cell,
.table-area table tbody tr td:nth-child(6).history-cell {
  color: var(--text) !important;
}

/* Sortable table headers */
.sortable-header {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.sortable-header:hover {
  background-color: var(--card-muted);
}

.sortable-header--active {
  color: var(--accent);
}

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

/* Style history cell content for better readability */
.table-area table td[data-cell="history-scores"]:not(:empty),
.table-area table td[data-cell="history-notes"]:not(:empty) {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Fira Mono', 'Droid Sans Mono', 'Consolas', monospace;
  font-size: 12px !important;
  letter-spacing: 0.03em;
  line-height: 1.6 !important;
}

/* Ensure history header text is visible */
.table-area table thead tr th:nth-child(5),
.table-area table thead tr th:nth-child(6) {
  min-width: 200px !important;
  max-width: 300px !important;
  width: auto !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  font-size: 13px !important;
}

/* Force table to show all columns - override any fixed layouts */
.table-area table {
  table-layout: auto !important;
  width: 100% !important;
  min-width: 100% !important;
}

/* Ensure table wrapper doesn't hide columns */
.table-area .table-wrapper {
  overflow-x: auto !important;
  overflow-y: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Make sure no colgroup is hiding the column */
.table-area table colgroup,
.table-area table colgroup col {
  display: none !important;
}

/* ============================================
   BULK TABLE HISTORY COLUMN STYLING
   ============================================ */

/* History columns in bulk table (6th and 7th columns) */
#bulk-tastings-table thead tr th:nth-child(7),
#bulk-tastings-table tbody tr td:nth-child(7),
#bulk-tastings-table thead tr th:nth-child(8),
#bulk-tastings-table tbody tr td:nth-child(8) {
  min-width: 250px !important;
  max-width: 400px !important;
  width: auto !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--text-muted) !important;
  text-align: left !important;
  vertical-align: top !important;
}

#bulk-tastings-table tbody tr td[data-field="history-scores"],
#bulk-tastings-table tbody tr td[data-field="history-notes"],
#bulk-tastings-table tbody tr td.bulk-history-scores-cell,
#bulk-tastings-table tbody tr td.bulk-history-notes-cell {
  min-width: 200px !important;
  max-width: 300px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: table-cell !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--text-muted) !important;
}

#bulk-tastings-table tbody tr td.bulk-history-scores-cell:not(:empty),
#bulk-tastings-table tbody tr td.bulk-history-notes-cell:not(:empty) {
  color: var(--text) !important;
  font-weight: 500 !important;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Fira Mono', 'Droid Sans Mono', 'Consolas', monospace;
  font-size: 12px !important;
  letter-spacing: 0.03em;
  line-height: 1.6 !important;
}

thead {
  background: rgba(15, 23, 42, 0.78);
}

th,
td {
  padding: 16px 18px;
  text-align: left;
}

/* Give the Øl column more room in tables (2nd column) */
.table-area table thead tr th:nth-child(2),
.table-area table tbody tr td:nth-child(2) {
  min-width: 260px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Specifically widen the Øl column in the bulk tastings table */
#bulk-tastings-table thead tr th:nth-child(2),
#bulk-tastings-table tbody tr td:nth-child(2) {
  min-width: 320px;
}

#bulk-tastings-table tbody tr td:nth-child(2) .bulk-input {
  width: 100%;
}

/* Ensure history column header is visible and properly sized */
/* Removed duplicate rule - handled above in .table-area table thead tr th:nth-child(5) */

th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

tbody tr {
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.12);
}

tbody tr.is-non-shared {
  background: rgba(125, 211, 252, 0.08);
}

tbody tr.is-balance-adjustment {
  background: rgba(167, 243, 208, 0.12);
  border-left: 3px solid #34d399;
}

td[data-cell='totalNok'] {
  font-weight: 600;
  color: #bae6fd;
}

td[data-cell='actions'] {
  width: 1%;
  white-space: nowrap;
}

td[data-cell='shared'] {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cell-shared-alert,
td[data-cell='shared'][data-value='not-shared'] {
  color: #fecaca;
}

.cell-has-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
}

.badge--muted {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.88);
}

.badge--alert {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.badge--balance-adjustment {
  background: rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
  font-weight: 700;
}

.form-area p {
  margin: 0;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.form-area--prominent .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-area--prominent .form-grid select[name="beer"] {
  min-width: 280px;
}

/* Make the "Velg øl" field span two grid columns for better readability */
.form-area--prominent .form-grid label.form-field--beer,
.form-area--prominent .form-grid label:has(> select[name="beer"]) {
  grid-column: span 2;
}

/* Also span two columns for bulk's beer selector */
.form-area--prominent .form-grid--compact label.form-field--beer,
.form-area--prominent .form-grid label.form-field--beer,
.form-area--prominent .form-grid--compact label:has(> #bulk-beer-name),
.form-area--prominent .form-grid label:has(> #bulk-beer-name) {
  grid-column: span 2;
}

.form-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 0;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
}

.number-field input[type="number"] {
  width: 100%;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 28px;
}

.checkbox-field input[type='checkbox'] {
  width: auto;
  accent-color: #38bdf8;
  transform: scale(1.1);
}

.notes-field {
  grid-column: 1 / -1;
}

.notes-field textarea {
  min-height: 80px;
  resize: vertical;
}

footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 24px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.auth-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 20px;
  padding: 32px;
  width: min(360px, 100% - 32px);
  box-shadow: 0 40px 70px rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.18);
  display: grid;
  gap: 20px;
}

.auth-card h2 {
  margin: 0;
  font-size: 24px;
}

.auth-card p {
  margin: 0;
  color: var(--text-muted);
}

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-card input[type='email'],
.auth-card input[type='password'] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 16px;
}

.auth-card input:focus {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
}

.auth-card button[type='submit'] {
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #04111f;
  box-shadow: 0 10px 25px rgba(14, 165, 233, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-card button[type='submit']:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.38);
}

.auth-card .auth-error {
  color: #fecaca;
  font-size: 14px;
  font-weight: 500;
}

.auth-success {
  color: #bbf7d0;
  font-size: 14px;
  font-weight: 500;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 998;
}

.dialog {
  width: min(640px, 100%);
  background: rgba(15, 23, 42, 0.96);
  border-radius: 20px;
  padding: 24px 30px 30px;
  box-shadow: 0 40px 70px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.18);
  display: grid;
  gap: 20px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h3 {
  margin: 0;
  font-size: 22px;
}

.icon-button {
  border: none;
  background: rgba(148, 163, 184, 0.14);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.icon-button:hover {
  background: rgba(248, 113, 113, 0.28);
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.dialog-backdrop[hidden] {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 30px);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 15px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.24);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 999;
  box-shadow: 0 14px 35px rgba(2, 132, 199, 0.28);
}

.toast--success {
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 18px 40px rgba(74, 222, 128, 0.24);
}

.toast--error {
  border-color: rgba(248, 113, 113, 0.54);
  box-shadow: 0 18px 40px rgba(248, 113, 113, 0.24);
}

.toast--info {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 40px rgba(148, 163, 184, 0.2);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.admin-downloads {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  display: grid;
  gap: 16px;
}

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.excel-table .table-wrapper {
  overflow-x: auto;
}

@media (max-width: 720px) {
  body {
    padding: 32px 16px;
  }

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

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls--collapsible {
    padding: 0;
  }

  .filters-grid {
    grid-template-columns: 1fr;
    padding: 0 16px 16px;
  }

  .chip-group {
    flex-wrap: wrap;
  }

  header p {
    font-size: 16px;
  }

  .form-area--prominent {
    padding: 20px;
  }

  .members-content {
    padding: 16px 12px;
  }

  .chart-search-section {
    gap: 12px;
    padding-bottom: 16px;
  }

  .chart-quick-filters {
    gap: 6px;
  }

  .quick-filter-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .tasting-notes-filters {
    gap: 12px;
    padding-bottom: 16px;
  }

  .tasting-notes-quick-filters {
    gap: 6px;
  }

  .tasting-quick-filter-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .form-mode-toggle {
    flex-direction: column;
  }

  .mode-toggle-btn {
    padding: 10px;
  }

  .bulk-table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-form-actions {
    flex-direction: column;
  }

  .bulk-form-actions button {
    width: 100%;
  }

  .bulk-table-wrapper {
    max-height: 400px;
  }

  .bulk-input {
    font-size: 13px;
    padding: 6px 8px;
  }
}

/* Beer Management Styles */
.beer-image-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.beer-image-preview {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
}

.beer-image-preview-wrapper {
  position: relative;
  display: inline-block;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-md);
  border: 3px solid var(--border);
  overflow: hidden;
  background: var(--card-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.beer-image-preview-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px dashed rgba(56, 189, 248, 0.3);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.beer-image-preview-wrapper[data-adjusting="true"]::before {
  opacity: 1;
}

.beer-image-background {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: background-position 0.2s ease, background-size 0.2s ease;
  will-change: background-position, background-size;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
  z-index: 1;
  touch-action: none; /* Prevent default touch behavior */
}

.beer-image-preview-wrapper[data-adjusting="true"] .beer-image-background {
  cursor: grab;
}

.beer-image-preview-wrapper[data-adjusting="true"] .beer-image-background:active {
  cursor: grabbing;
}

.beer-image-preview-wrapper img {
  display: none; /* Hidden, we use background-image on .beer-image-background instead */
}

.beer-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.beer-image-preview-wrapper[data-adjusting="true"] .beer-image-overlay {
  pointer-events: none;
}

.beer-image-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.beer-image-zoom-controls {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.beer-image-zoom-controls .icon-button {
  width: 28px;
  height: 28px;
  font-size: 16px;
  padding: 0;
}

.beer-image-adjust-info {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 200px;
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.beer-image-adjust-info p {
  margin: 0;
}

.beer-image-preview .icon-button,
.beer-image-controls .icon-button {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  font-size: 18px;
  pointer-events: auto;
}

.beer-image-preview .icon-button:hover,
.beer-image-controls .icon-button:hover {
  background: rgba(0, 0, 0, 0.9);
}

.beer-image-current {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.beer-image-current img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.beer-image-current span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Universal beer image frame - used in all views */
.beer-image-frame {
  position: relative;
  display: inline-block;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--card-muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Frame sizes */
.beer-image-frame--small {
  width: 60px;
  height: 60px;
}

.beer-image-frame--medium {
  width: 100px;
  height: 100px;
}

.beer-image-frame--large {
  width: 200px;
  height: 200px;
}

.beer-image-frame--preview {
  width: 300px;
  height: 300px;
}

/* Image inside frame - supports zoom and pan */
.beer-image-frame {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  transition: background-position 0.2s ease, background-size 0.2s ease;
}

.beer-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: object-position 0.2s ease, transform 0.2s ease;
  will-change: object-position, transform;
  display: block;
}

/* When zoomed, image needs to be larger than container - but we use background-image instead */
.beer-image-frame[data-zoom] {
  position: relative;
  overflow: hidden;
}

/* Hide img element when using background-image approach */
.beer-image-frame img[style*="display: none"] {
  display: none !important;
}

/* Image info overlay */
.beer-image-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 6px 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.beer-image-frame:hover .beer-image-info {
  opacity: 1;
}

.beer-image-info span {
  display: block;
  line-height: 1.4;
}

/* Legacy support - keep for backward compatibility */
.beer-table-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, object-position 0.2s ease;
  will-change: transform, object-position;
}

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

.beer-image-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.beer-image-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.image-tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-size: 14px;
}

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

.image-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.image-tab-content {
  padding-top: 8px;
}

/* --- SusOgDus offentlige sider & innlogging --- */
.site-header__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.site-header__homelink {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.site-header__homelink:hover {
  text-decoration: underline;
}

.site-marketing {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-height: 60vh;
}

.marketing-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.marketing-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.marketing-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.marketing-brand:hover {
  color: var(--accent);
}

.marketing-header__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.marketing-tools-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.marketing-tools-link:hover {
  color: var(--accent);
}

.marketing-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.marketing-user-email {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.marketing-nav__link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.marketing-nav__link:hover {
  color: var(--text);
  background: var(--card-muted);
}

.marketing-nav__link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.marketing-main {
  flex: 1;
}

.marketing-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.marketing-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 65ch;
  margin: 0 0 16px;
}

.marketing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.marketing-card {
  display: block;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, transform 0.15s ease;
}

.marketing-card:hover {
  background: rgba(17, 28, 55, 0.95);
  transform: translateY(-2px);
}

.marketing-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--accent);
}

.marketing-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
}

.marketing-article h1 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.marketing-list {
  margin: 16px 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.marketing-list a {
  color: var(--accent);
}

.marketing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.marketing-dl {
  margin: 16px 0 0;
}

.marketing-dl dt {
  font-weight: 600;
  margin-top: 12px;
  color: var(--text);
}

.marketing-dl dd {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.marketing-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.marketing-gallery__item {
  margin: 0;
}

.marketing-gallery__placeholder {
  aspect-ratio: 4/3;
  background: var(--card-muted);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.marketing-gallery figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.marketing-footer {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 8px;
}

.marketing-footer a {
  color: var(--accent);
}

.primary-button--small {
  padding: 8px 14px;
  font-size: 14px;
}

.soft-button--small {
  padding: 6px 12px;
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.login-page__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card--standalone {
  width: 100%;
  max-width: 400px;
}

body[data-auth='login'] {
  padding-top: 32px;
}

.marketing-article code {
  font-size: 0.9em;
  background: var(--card-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

