:root {
  --cream: #fbf6ef;
  --paper: #fffdf9;
  --ink: #2b2421;
  --muted: #786e68;
  --line: #e9ded2;
  --rose: #b85b59;
  --rose-dark: #88413f;
  --sage: #667861;
  --gold: #caa46a;
  --blue: #4b6f86;
  --shadow: 0 18px 45px rgba(43, 36, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

[hidden] {
  display: none !important;
}

.public-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(202, 164, 106, 0.2), transparent 28%),
    linear-gradient(180deg, #fffaf4 0%, #fbf6ef 55%, #f7eee5 100%);
}

.public-header {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 82px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
}

.public-brand img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(43, 36, 33, 0.14);
}

.public-brand span {
  display: grid;
  line-height: 1.05;
}

.public-brand strong {
  font-size: 20px;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.public-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.public-login-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.public-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 86px 24px 104px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.86fr);
  align-items: center;
  gap: 72px;
}

.public-kicker {
  margin-bottom: 13px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.public-hero h1 {
  max-width: 700px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.public-hero h1 span {
  color: var(--rose);
}

.hero-lead {
  max-width: 640px;
  margin: 24px 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-actions,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions a,
.hero-actions button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 44px;
}

.security-section {
  border-top: 1px solid rgba(136, 65, 63, 0.1);
  border-bottom: 1px solid rgba(136, 65, 63, 0.1);
  background: rgba(255, 253, 249, 0.72);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.security-grid article {
  min-height: 150px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.security-grid strong {
  font-size: 15px;
}

.security-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.security-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: #fff7e8;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.trust-row {
  margin-top: 24px;
  gap: 18px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 750;
}

.hero-preview {
  padding: 20px;
  border: 1px solid rgba(136, 65, 63, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: 0 34px 80px rgba(62, 42, 33, 0.17);
  transform: rotate(1deg);
}

.preview-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.preview-top span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dcc9b4;
}

.preview-top strong {
  margin-left: auto;
}

.preview-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.preview-metrics article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 10px;
  background: #f8eee5;
}

.preview-metrics small,
.preview-metrics i,
.preview-list {
  color: var(--muted);
  font-size: 11px;
}

.preview-metrics b {
  font-size: 23px;
}

.preview-metrics i {
  color: var(--sage);
  font-style: normal;
}

.preview-chart {
  height: 180px;
  padding: 20px 14px 0;
  display: flex;
  align-items: end;
  gap: 10px;
  border-radius: 10px;
  background: #2d2420;
}

.preview-chart span {
  flex: 1;
  min-height: 20px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #d69b91, #b85b59);
}

.preview-list {
  margin-top: 12px;
  padding: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.preview-list b {
  color: var(--ink);
  font-size: 11px;
}

.public-section,
.pricing-section,
.auth-section {
  padding: 92px 24px;
}

.public-section {
  background: #fffdf9;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 38px;
  text-align: center;
}

.section-heading h2,
.auth-intro h2 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.035em;
}

.section-heading > p:last-child,
.auth-intro > p {
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid,
.pricing-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid article,
.price-card,
.auth-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.feature-grid article > span {
  color: var(--rose);
  font-size: 12px;
  font-weight: 850;
}

.feature-grid h3 {
  margin: 18px 0 10px;
  font-size: 19px;
}

.feature-grid p {
  color: var(--muted);
  line-height: 1.65;
}

.pricing-section {
  background: #2a211d;
  color: #fff8ef;
}

.pricing-section .public-kicker {
  color: #e5b7ad;
}

.price-card {
  position: relative;
  color: var(--ink);
}

.price-card.featured {
  border: 2px solid #d7988f;
  transform: translateY(-10px);
}

.popular {
  position: absolute;
  top: -13px;
  right: 20px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.price-card > p {
  color: var(--rose-dark);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-card h3 {
  font-size: 34px;
}

.price-card h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.price-card ul {
  min-height: 150px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 2;
}

.price-card > a,
.price-card > button {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.billing-note {
  max-width: 760px;
  margin: 28px auto 0;
  color: #d8c7ba;
  text-align: center;
  font-size: 12px;
}

.auth-section {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 56px;
  align-items: start;
}

.auth-intro {
  padding-top: 28px;
}

.privacy-card {
  margin-top: 26px;
  padding: 18px;
  display: grid;
  gap: 6px;
  border-left: 3px solid var(--sage);
  background: rgba(102, 120, 97, 0.08);
}

.privacy-card span {
  color: var(--muted);
  line-height: 1.6;
}

.auth-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.auth-card h3 {
  margin-bottom: 7px;
  font-size: 21px;
}

.auth-card > p {
  color: var(--muted);
}

.auth-card-accent {
  border-color: rgba(184, 91, 89, 0.4);
  background: #fff9f5;
}

.text-button {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rose-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.recovery-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-help {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.locked-field,
.account-plan-card {
  padding: 14px;
  display: grid;
  gap: 7px;
  border: 1px dashed #d8b4a9;
  border-radius: 9px;
  background: #fff8f3;
}

.locked-field span,
.account-plan-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.locked-field button,
.account-plan-card button {
  margin-top: 4px;
  justify-self: start;
}

.public-footer {
  min-height: 110px;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #d8c7ba;
  background: #211a17;
}

.public-footer span {
  color: #fff8ef;
  font-weight: 850;
}

.public-footer p {
  margin: 0;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  background: #231b18;
  color: #fff8ef;
}

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

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.brand p {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.brand span {
  color: #dfc7a8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #f8efe3;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 22px;
  text-align: center;
}

.shell {
  min-width: 0;
  padding: 24px 28px 42px;
}

.guest-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d9c394;
  border-radius: 8px;
  background: #fff7e6;
}

.guest-banner div {
  display: grid;
  gap: 3px;
}

.guest-banner span {
  color: var(--muted);
  font-size: 12px;
}

.guest-banner button {
  flex: 0 0 auto;
}

.demo-account-card h2 {
  margin-top: 12px;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 14px;
}

.primary,
.secondary,
.ghost {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 38px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 650;
}

.primary {
  background: var(--rose);
  color: white;
}

.primary:hover {
  background: var(--rose-dark);
}

.secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.ghost {
  background: transparent;
  color: var(--rose-dark);
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.panel,
.metric,
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.welcome-panel {
  margin-bottom: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-left: 4px solid var(--rose);
  background: linear-gradient(110deg, #fffdf9, #fff5ee);
}

.welcome-panel h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.welcome-panel p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  line-height: 1.6;
}

.onboarding-actions {
  min-width: 230px;
  display: grid;
  gap: 7px;
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 24px;
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: #f7efe6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2dfdb;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  background: #e5eee0;
  color: #435c3f;
}

.status.soft {
  background: #eee7de;
  color: #786e68;
}

.formula {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.formula code {
  color: var(--blue);
  font-size: 13px;
}

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

.sheet-heading h2 {
  margin-bottom: 6px;
}

.sheet-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sheet-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #b8c9b3;
  border-radius: 6px;
  background: #edf4ea;
  color: #435c3f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ingredient-sheet,
.excel-sheet {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.ingredient-sheet .table-wrap,
.excel-sheet .table-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ingredient-sheet table {
  min-width: 1380px;
}

.recipe-excel-sheet table {
  min-width: 1440px;
}

.excel-sheet table {
  min-width: 1080px;
}

.ingredient-sheet th,
.excel-sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-right: 1px solid #e2d4c6;
  background: #eee3d6;
  white-space: nowrap;
}

.ingredient-sheet td,
.excel-sheet td {
  border-right: 1px solid #eee4da;
  white-space: nowrap;
}

.ingredient-sheet th:first-child,
.ingredient-sheet td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

.ingredient-sheet td:first-child {
  background: var(--paper);
}

.ingredient-sheet th:first-child {
  z-index: 4;
}

.ingredient-sheet tbody tr:hover td,
.excel-sheet tbody tr:hover td {
  background: #fffaf4;
}

.ingredient-sheet tbody tr:hover td:first-child {
  background: #fffaf4;
}

.sheet-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sheet-empty {
  padding: 26px !important;
  color: var(--muted);
  text-align: center;
}

.ingredient-form-panel {
  margin-top: 14px;
}

.ingredient-import-panel {
  margin-top: 14px;
}

.import-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px dashed #d1ae83;
  border-radius: 10px;
  background: #fffaf4;
}

.import-zone > div:first-child,
.import-preview-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.import-zone span,
.import-preview-heading span {
  color: var(--muted);
  font-size: 12px;
}

.import-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 10px;
}

.import-errors {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e4b7ae;
  border-radius: 8px;
  color: #7f2e24;
  background: #fff3f1;
}

.import-errors ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.status-success {
  color: #246b48;
  background: #e8f6ee;
}

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

.ingredient-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ingredient-formula-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.ingredient-formula-preview span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.ingredient-formula-preview strong,
.ingredient-formula-preview code {
  color: var(--blue);
  font-size: 13px;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  align-items: center;
  gap: 10px;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfd3;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--sage);
}

.admin-heading,
.plan-access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-heading {
  margin-bottom: 14px;
  background: linear-gradient(120deg, #fffdf9, #fff5ed);
  border-left: 4px solid var(--gold);
}

.admin-heading h2,
.plan-access-card h2 {
  margin: 7px 0;
  font-size: 23px;
}

.admin-heading p,
.plan-access-card p {
  margin-bottom: 0;
}

.plan-badges {
  display: flex;
  gap: 6px;
}

.plan-badges span,
.plan-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #2b2421;
  color: #fff8ef;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.plan-badges span:last-child {
  background: var(--gold);
  color: #2b2421;
}

.admin-empty {
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f3f7ef;
  border-color: #cad7c3;
}

.admin-empty span {
  color: var(--muted);
}

.admin-metrics {
  margin-bottom: 14px;
}

.admin-metrics .metric {
  position: relative;
  overflow: hidden;
}

.admin-metrics .metric::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(202, 164, 106, 0.14);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-wide {
  grid-column: 1 / -1;
}

.chart-card {
  min-width: 0;
}

.chart-title {
  min-height: 44px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.chart-title h2 {
  margin: 0;
}

.chart-title > strong {
  font-size: 22px;
}

.vertical-chart {
  min-height: 260px;
  padding: 12px 8px 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(56px, 1fr));
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 63px, rgba(233, 222, 210, 0.55) 64px);
}

.vbar-group {
  height: 240px;
  display: grid;
  grid-template-rows: 22px 1fr 24px;
  gap: 5px;
  align-items: end;
  text-align: center;
}

.vbar-value {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.vbar-track {
  width: min(44px, 76%);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: end;
  border-radius: 7px 7px 0 0;
  background: #f2e9df;
}

.vbar {
  width: 100%;
  min-height: 3px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #d18a82, var(--rose));
}

.vbar-group small {
  color: var(--muted);
  font-weight: 750;
  text-transform: capitalize;
}

.donut-layout {
  min-height: 230px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
}

.donut {
  width: 184px;
  height: 184px;
  padding: 24px;
  border-radius: 50%;
}

.donut > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--paper);
  text-align: center;
  font-size: 28px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.chart-legend {
  display: grid;
  gap: 11px;
}

.chart-legend > div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chart-legend span {
  color: var(--muted);
  font-size: 12px;
}

.finance-bars {
  min-height: 230px;
  align-content: center;
}

.rank-list {
  min-height: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
}

.rank-row > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-content: center;
  border-radius: 7px;
  background: #f4e9df;
  color: var(--rose-dark);
  font-size: 11px;
  font-weight: 850;
}

.rank-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.rank-row small {
  color: var(--muted);
  font-size: 10px;
}

.rank-row i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfd3;
}

.rank-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rose);
}

.rank-row em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-summary {
  min-height: 230px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-summary article {
  display: grid;
  place-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffaf4;
  text-align: center;
}

.admin-summary span {
  color: var(--muted);
  font-size: 11px;
}

.admin-summary strong {
  font-size: 22px;
}

.plan-access-card {
  color: #fff8ef;
  background: #2b2421;
  border-color: #2b2421;
}

.plan-access-card .plan-pill {
  background: var(--gold);
  color: #2b2421;
}

.plan-access-card .muted {
  color: #d8c7ba;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.roadmap-grid article,
.logo-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 14px;
}

.roadmap-grid strong {
  display: block;
  margin-bottom: 6px;
}

.roadmap-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: white;
}

.logo-preview p {
  margin-bottom: 0;
}

.account-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.account-card span {
  color: var(--muted);
  font-size: 13px;
}

.accounting-heading,
.accounting-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.accounting-heading h2 {
  margin: 5px 0;
}

.accounting-heading p {
  margin-bottom: 0;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.accounting-controls {
  justify-content: flex-start;
  margin-top: 14px;
  background: #fffaf4;
}

.accounting-controls label {
  min-width: 170px;
}

.period-name {
  display: grid;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.period-name span {
  color: var(--muted);
  font-size: 11px;
}

.period-name strong {
  font-size: 16px;
}

.accounting-metrics {
  margin-top: 14px;
}

.accounting-positive {
  border-color: #b9cfb3;
  background: #f1f7ee;
}

.accounting-negative {
  border-color: #e0b6b2;
  background: #fff1ef;
}

.text-positive {
  color: #476947;
}

.text-negative,
.danger-link {
  color: #a34643;
}

.accounting-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  align-items: start;
}

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

.calendar-day {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
}

.calendar-date {
  display: grid;
  align-content: start;
  gap: 4px;
}

.calendar-date strong {
  font-size: 15px;
}

.calendar-date span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-items {
  display: grid;
  gap: 8px;
}

.calendar-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.calendar-item h3 {
  margin-bottom: 4px;
}

.calendar-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7efe6;
}

.segmented button {
  border: 0;
  border-radius: 6px;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.segmented button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 4px 12px rgba(43, 36, 33, 0.08);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

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

.month-header h3 {
  text-transform: capitalize;
}

.month-header span {
  color: var(--muted);
  font-size: 12px;
}

.month-grid-head,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
}

.month-grid-head {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.month-grid-head span {
  padding: 9px;
  color: var(--muted);
  background: #f7efe6;
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-grid-head span:last-child {
  border-right: 0;
}

.month-grid {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.month-cell {
  min-height: 118px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.month-cell.outside {
  background: #f4ece3;
}

.month-cell > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.month-task {
  display: grid;
  gap: 2px;
  padding: 6px;
  margin-bottom: 5px;
  border-radius: 6px;
  background: #f2dfdb;
  color: var(--rose-dark);
}

.month-task span {
  font-size: 11px;
  font-weight: 800;
}

.month-task small {
  font-size: 11px;
}

.week-day,
.board-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  padding: 12px;
}

.week-day h3,
.board-column h3 {
  margin-bottom: 4px;
}

.week-day > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.week-items,
.board-column {
  display: grid;
  gap: 8px;
}

.week-items article,
.board-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.week-items small,
.board-card span,
.board-card p {
  color: var(--muted);
  font-size: 12px;
}

.board-card p {
  margin-bottom: 0;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.doc-actions .secondary {
  min-height: 31px;
  padding: 6px 9px;
  font-size: 12px;
}

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

.split-title {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.recipe-layout .panel:nth-child(2),
.recipe-layout .panel:nth-child(3) {
  grid-column: span 1;
}

.recipe-layout .panel:nth-child(4),
.recipe-layout .panel:nth-child(5) {
  grid-column: span 1;
}

.compact-metrics {
  gap: 10px;
}

.compact-metrics .metric {
  box-shadow: none;
  padding: 12px;
}

.compact-metrics .metric strong {
  font-size: 18px;
}

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

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .public-nav {
    display: none;
  }

  .public-hero,
  .auth-section {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .public-hero {
    padding-top: 54px;
  }

  .hero-preview {
    transform: none;
  }

  .feature-grid,
  .pricing-grid,
  .auth-cards,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .price-card.featured {
    transform: none;
  }

  .sidebar {
    min-height: auto;
  }

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

  .shell {
    padding: 18px;
  }

  .topbar,
  .guest-banner,
  .two-col,
  .recipe-layout,
  .welcome-panel,
  .admin-heading,
  .accounting-heading,
  .accounting-controls,
  .plan-access-card {
    display: block;
  }

  .onboarding-actions {
    margin-top: 18px;
  }

  .admin-heading button,
  .accounting-heading button,
  .plan-access-card button {
    margin-top: 16px;
  }

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

  .accounting-controls label {
    margin-top: 10px;
  }

  .period-name {
    margin-top: 14px;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .admin-wide {
    grid-column: auto;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chart-legend {
    width: 100%;
  }

  .topbar .primary {
    margin-top: 14px;
  }

  .grid.cols-4,
  .grid.cols-3,
  .roadmap-grid,
  .form-grid,
  .split-title,
  .calendar-day,
  .calendar-item,
  .week-grid,
  .board-grid,
  .month-grid-head,
  .month-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .sheet-heading {
    display: block;
  }

  .import-zone,
  .import-preview-heading {
    display: block;
  }

  .import-zone .actions,
  .import-preview-heading .actions {
    margin-top: 14px;
  }

  .sheet-badge {
    display: inline-flex;
    margin-top: 12px;
  }

  .ingredient-form-grid,
  .ingredient-formula-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .public-header {
    padding: 12px 16px;
  }

  .public-login-link {
    display: none;
  }

  .public-hero,
  .public-section,
  .pricing-section,
  .auth-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .public-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-hero h1 {
    font-size: 42px;
  }

  .hero-preview {
    padding: 14px;
  }

  .vertical-chart {
    gap: 5px;
    overflow-x: auto;
  }

  .vbar-value {
    display: none;
  }

  .vbar-group {
    grid-template-rows: 1fr 24px;
  }

  .admin-summary {
    grid-template-columns: 1fr 1fr;
  }

  .preview-list,
  .public-footer {
    display: grid;
  }
}
