:root {
  color-scheme: light;
  --bg: #f5f2ed;
  --ink: #1b1b1f;
  --muted: #6b6b6f;
  --accent: #f2b35b;
  --accent-dark: #c98724;
  --accent-soft: #fff0d9;
  --card: #ffffff;
  --shadow: 0 20px 45px rgba(27, 27, 31, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --border: rgba(27, 27, 31, 0.08);
  --grid-gap: 18px;
  --auth-accent: #2d5bff;
  --auth-ink: #101014;
  --auth-soft: #f3f4f6;
  --auth-border: rgba(16, 16, 20, 0.14);
  --table-border: #d3d8e0;
  --table-head: #f1f4f8;
  --table-accent: #c86a1e;
  --table-accent-dark: #8a3f12;
  --table-slate: #334155;
  --table-row: #f7f9fc;
  --table-ink: #1f2937;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.8), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(242, 179, 91, 0.28), transparent 60%),
    linear-gradient(140deg, #faf7f2, #f1ece4 45%, #efe6da 100%);
  min-height: 100vh;
}

body.table-only {
  background: #0e1218;
  color: #e7ecf2;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.app-shell {
  display: none;
}

.is-authenticated .app-shell {
  display: block;
}

.is-authenticated .auth-screen {
  display: none;
}

.table-only .app-shell {
  display: block;
}

.table-only .page {
  max-width: none;
  padding: 0;
}

.table-only-only {
  display: none;
}

.table-only .table-only-only {
  display: flex;
}

.app-topbar {
  height: 56px;
  background: #1a1f27;
  border-bottom: 1px solid #2d3642;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}

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

.icon-button {
  background: #232a35;
  color: #d4d9e1;
  border-radius: 10px;
  border: 1px solid #2d3642;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #2d5cff;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.topbar-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

.topbar-nav a {
  color: #c8d0dd;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.topbar-nav a.active {
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  background: #232a35;
  color: #d7dde7;
  border: 1px solid #2d3642;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f3745;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.table-only .layout {
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 56px);
}

.side-nav {
  background: #161b24;
  border-right: 1px solid #2a3340;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: width 0.2s ease, padding 0.2s ease;
}

.side-header {
  background: #202734;
  border-radius: 14px;
  padding: 16px 14px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  color: #e9eef5;
  margin-bottom: 8px;
  border: 1px solid #2f3948;
}

.side-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.18), transparent 35%),
    radial-gradient(circle at 60% 80%, rgba(255, 255, 255, 0.12), transparent 35%);
  pointer-events: none;
}

.side-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #2f6fed;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  z-index: 1;
}

.side-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: #d8e2f0;
  z-index: 1;
  position: relative;
}

.side-user {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #f3f6fb;
  z-index: 1;
  position: relative;
}

.side-group {
  border-bottom: 1px solid #242d3b;
  padding-bottom: 8px;
}

.side-toggle {
  width: 100%;
  background: transparent;
  color: #d0d7e2;
  border: none;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.side-toggle:hover {
  background: #202734;
  border-radius: 10px;
}

.side-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #2a3340;
  color: #e7edf6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.side-caret {
  transition: transform 0.2s ease;
}

.side-panel {
  max-height: 0;
  overflow: hidden;
  display: grid;
  gap: 6px;
  padding: 0 8px;
  transition: max-height 0.25s ease;
}

.side-group.is-open .side-panel {
  max-height: 200px;
  padding-bottom: 10px;
}

.side-group.is-open .side-caret {
  transform: rotate(180deg);
}

.side-sublink {
  color: #b9c3d2;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
}

.side-sublink.active,
.side-sublink:hover {
  background: #1f2633;
  color: #ffffff;
}

.side-link {
  color: #c0c9d6;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-link.active,
.side-link:hover {
  background: #232a35;
  color: #ffffff;
}

.side-badge {
  margin-left: auto;
  background: #f59e0b;
  color: #111827;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

body.side-collapsed.table-only .layout {
  grid-template-columns: 68px 1fr;
}

.side-collapsed .side-nav {
  padding: 16px 8px;
}

.side-collapsed .side-header {
  padding: 10px;
  justify-items: center;
  text-align: center;
}

.side-collapsed .side-title,
.side-collapsed .side-user,
.side-collapsed .side-label,
.side-collapsed .side-caret,
.side-collapsed .side-panel,
.side-collapsed .side-badge,
.side-collapsed .side-text {
  display: none;
}

.side-collapsed .side-toggle,
.side-collapsed .side-link {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 10px;
}

.side-collapsed .side-icon {
  width: 32px;
  height: 32px;
  font-size: 0.65rem;
}

.side-collapsed .side-link {
  justify-content: center;
  gap: 0;
}

.table-only .auth-screen,
.table-only .app-header,
.table-only .app-nav,
.table-only .preview-panel,
.table-only .panel-header,
.table-only .panel-meta,
.table-only #labelForm,
.table-only .data-panel .data-block:not(:first-child),
.table-only .data-head,
.table-only .data-hint {
  display: none;
}

.table-only .layout {
  grid-template-columns: 220px 1fr;
}

.table-only .form-panel {
  padding: 24px 24px 32px;
  background: #11161f;
  border: none;
  box-shadow: none;
}

.table-only .data-panel {
  margin: 0;
}

.table-only .data-block {
  border: 1px solid #2b3442;
  padding: 18px;
  background: #0f141d;
}

.auth-screen {
  min-height: 100vh;
  padding: 72px 24px 48px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8), transparent 55%),
    radial-gradient(circle at 85% 30%, rgba(45, 91, 255, 0.14), transparent 60%);
  pointer-events: none;
}

.auth-shell {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  justify-items: center;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 36px;
  animation: floatIn 0.8s ease-out both;
}

.kicker {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

h1 {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0 0 16px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

.muted {
  color: var(--muted);
}

.header-card {
  background: var(--accent-soft);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 135, 36, 0.2);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  line-height: 1.6;
}

.header-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.app-nav a {
  text-decoration: none;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-nav button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.app-nav a:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(27, 27, 31, 0.12);
}

.app-nav button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(27, 27, 31, 0.12);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}

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

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

.panel-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-family: "Fraunces", serif;
}

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

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

.panel-meta .error {
  color: #8d1c1c;
  font-weight: 600;
}

.role-pill {
  background: #111114;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.data-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.data-block:first-child {
  grid-column: 1 / -1;
}

.data-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.data-head h3 {
  margin: 0;
  font-size: 1rem;
}

.data-hint {
  margin: 0;
  font-size: 0.85rem;
}

.data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.data-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.data-item {
  border: none;
  background: none;
  padding: 0;
  border-radius: 0;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.data-item:hover {
  text-decoration: underline;
}

.data-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

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

.table-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.table-header p {
  margin: 4px 0 0;
  color: #9aa3b2;
  font-size: 0.85rem;
}

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

.table-search input {
  background: #0e131b;
  border: 1px solid #2a3442;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 280px;
}

.table-search input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.table-action {
  background: #2f6fed;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  border: 1px solid #1b52c5;
  cursor: pointer;
}

.table-action:hover {
  transform: translateY(-1px);
}

.table-strip {
  background: linear-gradient(90deg, #c65f1a, #d77625);
  color: #ffffff;
  text-align: center;
  padding: 12px 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 16px 16px 0 0;
  font-size: 0.82rem;
  border: 1px solid var(--table-accent-dark);
  border-bottom: none;
}

.table-substrip {
  background: linear-gradient(90deg, #2f3b4c, #3b4a5d);
  color: #ffffff;
  text-align: center;
  padding: 9px 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid #243040;
  border-top: none;
  font-size: 0.72rem;
}

.table-wrap {
  border: 1px solid var(--table-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  overflow-x: auto;
  background: #ffffff;
  box-shadow: 0 18px 30px rgba(20, 24, 31, 0.1);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 0.82rem;
  color: var(--table-ink);
  font-variant-numeric: tabular-nums;
}

.product-table th,
.product-table td {
  border: 1px solid var(--table-border);
  padding: 10px 12px;
  text-align: center;
  background: #ffffff;
}

.product-table th {
  background: var(--table-head);
  color: #445163;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  position: sticky;
  top: 0;
  z-index: 1;
}

.product-table .item-cell {
  text-align: left;
  font-weight: 600;
}

.product-table .date-cell {
  white-space: nowrap;
}

.product-table .category-row td {
  background: #f7efe8;
  color: var(--table-accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  border-top: 1px solid var(--table-border);
  border-bottom: 1px solid var(--table-border);
}

.table-link {
  border: none;
  background: none;
  padding: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.table-link:hover {
  text-decoration: underline;
}

.product-table tbody tr:not(.category-row):nth-child(even) td {
  background: var(--table-row);
}

.product-table tbody tr:not(.category-row):hover td {
  background: #eef3fb;
}

.table-only .data-block {
  border-radius: 16px;
  border: 1px solid #e3e7ed;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(20, 24, 31, 0.14);
}

.table-only .table-wrap {
  max-height: 70vh;
}

.table-only .table-strip {
  background: linear-gradient(90deg, #c35c18, #d77a2a);
  border-color: #6e320f;
}

.table-only .table-substrip {
  background: linear-gradient(90deg, #2f3b4c, #39495c);
  border-color: #1f2833;
}

.table-only .table-wrap {
  background: #0f141d;
  border-color: #2a3442;
  box-shadow: 0 16px 30px rgba(5, 8, 14, 0.45);
}

.table-only .product-table th {
  background: #1b2230;
  color: #d7dde7;
  border-color: #2a3442;
}

.table-only .product-table td {
  background: #0f141d;
  color: #e5e7eb;
  border-color: #2a3442;
}

.table-only .product-table tbody tr:not(.category-row):nth-child(even) td {
  background: #121a25;
}

.table-only .product-table tbody tr:not(.category-row):hover td {
  background: #1a2331;
}

.table-only .product-table .category-row td {
  background: #121825;
  color: #f0a45e;
  border-color: #2a3442;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #fbfbfb;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(201, 135, 36, 0.4);
  box-shadow: 0 0 0 3px rgba(201, 135, 36, 0.16);
}

textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.divider {
  margin: 26px 0 18px;
  border-top: 1px dashed var(--border);
  position: relative;
}

.divider span {
  position: absolute;
  top: -11px;
  left: 0;
  background: var(--card);
  padding-right: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.nutrition-grid {
  margin-bottom: 12px;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  background: #ffffff;
}

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

.section-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.section-tag {
  background: #f2efe8;
  color: #5a4b30;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: "IBM Plex Sans", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost {
  background: #f3f3f3;
  color: var(--ink);
}

.primary {
  background: var(--accent);
  color: #2a1b00;
  box-shadow: 0 10px 20px rgba(242, 179, 91, 0.4);
}

.auth-panel {
  display: none;
}

.status-pill {
  align-self: center;
  background: #1f1f23;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  justify-self: center;
}

.status-pill.ok {
  background: #1f3f2a;
}

.status-pill.warn {
  background: #745a1e;
}

.status-pill.error {
  background: #6a1f1f;
}

.auth-status {
  margin: 0;
  font-weight: 600;
  text-align: center;
}

.auth-status.error {
  color: #8d1c1c;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  text-align: center;
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-top {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.auth-top h3 {
  margin: 0;
  font-size: 1.6rem;
  font-family: "Fraunces", serif;
}

.auth-sub {
  margin: 0;
  font-size: 0.95rem;
}

.auth-field {
  text-align: left;
  gap: 6px;
  font-size: 0.7rem;
  color: #8b8b92;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-field input {
  margin-top: 6px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: #f3f3f5;
  font-size: 0.95rem;
  color: var(--auth-ink);
}

.auth-field input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(45, 91, 255, 0.16);
  background: #ffffff;
}

.auth-main {
  background: var(--auth-ink);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(16, 16, 20, 0.16);
  width: 100%;
}

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--auth-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-divider span {
  padding: 0 4px;
}

.auth-provider {
  background: #ffffff;
  border: 1px solid #d6d6dd;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  box-shadow: 0 12px 22px rgba(27, 27, 31, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.auth-provider--google {
  border-color: rgba(27, 27, 31, 0.2);
}

.auth-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--auth-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #2d5bff;
  font-weight: 700;
}

.auth-links {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.auth-links p {
  margin: 0;
}

.auth-signout {
  justify-self: center;
}

.auth-legal {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-legal a {
  color: inherit;
  text-decoration: none;
}

.auth-legal a:hover {
  text-decoration: underline;
}

.ai-panel {
  background: #fff7ea;
  border: 1px solid rgba(201, 135, 36, 0.2);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: grid;
  gap: 12px;
}

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

.ai-header h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.ai-output {
  display: grid;
  gap: 10px;
}

.ai-copy {
  margin: 0;
  font-weight: 600;
}

.ai-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.ai-warnings {
  color: #7a3d0d;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.label {
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 24px;
  background: #fffdf9;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  animation: riseIn 0.8s ease-out both 0.1s;
}

.label::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(242, 179, 91, 0.15), transparent 55%);
  pointer-events: none;
}

.label-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.label-brand {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin: 0 0 4px;
}

.label-header h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
}

.label-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.85rem;
}

.label-body {
  display: grid;
  gap: 18px;
}

.label-block h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.allergen-note {
  font-weight: 600;
}

.allergen {
  text-transform: uppercase;
  font-weight: 700;
  color: #924000;
}

.nutrition-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.nutrition-table {
  display: grid;
  gap: 6px;
}

.nutrition-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr;
  gap: 8px;
  font-size: 0.9rem;
}

.nutrition-row span:nth-child(2),
.nutrition-row span:nth-child(3) {
  text-align: right;
}

.nutrition-head {
  font-weight: 600;
  color: var(--muted);
}

.trace {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

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

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

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
  }

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

  .label-meta {
    text-align: left;
  }
}

@media print {
  body {
    background: white;
  }

  .auth-screen,
  .app-header,
  .app-nav,
  .form-panel,
  .panel-header button,
  .actions {
    display: none !important;
  }

  .page {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .label {
    border: 2px solid #000;
    box-shadow: none;
    margin: 0;
  }
}
