:root,
:root[data-theme="light"] {
  --surface: #f7f4ed;
  --paper: #fffefa;
  --ink: #32382d;
  --muted: #757968;
  --accent: #596c45;
  --line: #e0e3d6;
  --soft: #ebeddf;
  --radius: 20px;
  --pico-font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --pico-font-size: 100%;
  --pico-line-height: 1.65;
  --pico-background-color: var(--surface);
  --pico-color: var(--ink);
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent);
  --pico-primary-hover-background: #435533;
  --pico-primary-hover-border: #435533;
  --pico-primary-focus: #596c4533;
  --pico-border-radius: 10px;
  --pico-card-background-color: var(--paper);
  --pico-form-element-background-color: var(--paper);
  --pico-muted-color: var(--muted);
  --pico-form-element-border-color: #ced3c4;
  --pico-card-box-shadow: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.35;
  font-weight: 650;
}
h2 {
  font-size: 1.3rem;
}
h3 {
  font-size: 1.15rem;
}
a {
  text-decoration: none;
}
button,
[role="button"] {
  min-height: 44px;
  font-weight: 600;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid #7d9464;
  outline-offset: 4px;
}
p {
  color: var(--muted);
}
small {
  line-height: 1.65;
}
[hidden] {
  display: none !important;
}
article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sidebar {
  width: 232px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 40px 28px;
  background: #eeeee3;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.wordmark {
  color: var(--ink);
  font-size: 2rem;
  font-family: Georgia, serif;
  font-weight: bold;
  display: flex;
  align-items: baseline;
  margin: 0 0 32px;
  letter-spacing: -0.06em;
}
.wordmark span {
  font-size: 1.65rem;
}
.wordmark::after {
  content: "";
  width: 7px;
  height: 7px;
  background: #b3bd84;
  border-radius: 50%;
  margin-left: 3px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 14px;
}
.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}
.primary-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 48px;
}
.primary-nav a span {
  font-size: 1.35rem;
  line-height: 1;
}
.primary-nav a[aria-current] {
  background: var(--accent);
  color: white;
}
.sidebar-footer {
  margin-top: auto;
  color: var(--muted);
}
.workspace {
  margin-left: 232px;
}
.standalone {
  max-width: 1400px;
  margin: auto;
}
.topbar {
  min-height: 90px;
  border-bottom: 1px solid var(--line);
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 0.9rem;
}
.mobile-brand {
  display: none;
}
.account-menu {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 0.8rem;
}
.account-menu form,
.account-menu button {
  margin: 0;
}
.account-menu button {
  padding: 6px 14px;
  font-size: 0.8rem;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 40px;
}
.page-heading {
  margin: 14px 0 32px;
}
.page-heading h1 {
  margin-bottom: 12px;
}
.with-action,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.with-action > a {
  flex-shrink: 0;
}
.section-heading {
  margin-bottom: 20px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading a,
.section-heading button {
  font-size: 0.85rem;
}
.section-heading button {
  padding: 8px 12px;
  margin: 0;
}
.welcome-panel {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  background: #e9ebdb;
  border: 1px solid #dde1ca;
  border-radius: 24px;
  padding: 38px;
  margin-bottom: 42px;
  overflow: hidden;
  min-height: 280px;
  gap: 15px;
}
.welcome-panel h1 {
  max-width: 650px;
}
.welcome-panel p:not(.eyebrow) {
  max-width: 460px;
}
.welcome-panel [role="button"] {
  margin-top: 12px;
}
.still-life {
  position: relative;
  min-height: 220px;
  width: 100%;
}
.plate {
  width: 210px;
  height: 210px;
  position: absolute;
  border-radius: 50%;
  background: #f9f7ec;
  border: 20px solid #fefcf4;
  box-shadow:
    12px 18px 28px #46523720,
    inset 0 0 0 2px #dddcc9;
  top: 10px;
  left: 12%;
  transform: rotate(-15deg);
}
.leaf {
  width: 55px;
  height: 90px;
  border-radius: 100% 0 100% 0;
  background: #869161;
  position: absolute;
  top: 40px;
  left: 56px;
  transform: rotate(30deg);
}
.leaf::after {
  content: "";
  position: absolute;
  width: 1px;
  height: 75px;
  background: #d1d6b7;
  transform: rotate(30deg);
  top: 8px;
  left: 28px;
}
.small-plate {
  position: absolute;
  right: 5%;
  top: 140px;
  height: 78px;
  width: 78px;
  border: 8px solid #fdfbf0;
  background: #c6ab7b;
  border-radius: 50%;
  box-shadow: 5px 6px 20px #46523720;
}
.chopsticks {
  position: absolute;
  right: 7%;
  top: 0;
  width: 6px;
  height: 210px;
  background: #947654;
  border-radius: 4px;
  transform: rotate(22deg);
  box-shadow: 12px 0 #947654;
}
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px;
}
.context-panel {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.context-panel small {
  display: block;
  color: var(--muted);
  margin-top: 10px;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  overflow-wrap: anywhere;
}
.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6e5d6;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.badge {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.75rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 24px;
}
.recipe-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.15s;
}
.recipe-card:hover {
  transform: translateY(-3px);
}
.recipe-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.card-body {
  padding: 22px;
}
.card-body h3 {
  margin-bottom: 8px;
}
.card-body p {
  font-size: 0.85rem;
}
.card-body small {
  color: var(--muted);
}
.photo-placeholder {
  background: #e8e6d8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4/3;
  color: #788267;
}
.photo-placeholder > span {
  font-size: 4rem;
  font-weight: 200;
}
.photo-placeholder small {
  font-size: 0.8rem;
}
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 38px 24px;
  margin: 0;
}
.empty-mark {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 14px;
}
.empty-state p {
  max-width: 400px;
  margin: 0 auto 24px;
}
.space-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.space-symbol {
  font-size: 3rem;
}
.search-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin-bottom: 28px;
}
.search-form input {
  margin-bottom: 0;
  min-width: 0;
}
.search-form button {
  flex-shrink: 0;
  margin: 0;
}
.pagination {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 30px;
}
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.85rem;
}
.recipe-detail {
  padding: 0;
  overflow: hidden;
}
.hero-photo {
  width: 100%;
  height: 340px;
  object-fit: cover;
  aspect-ratio: auto;
}
.detail-heading {
  padding: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.detail-heading > div {
  min-width: 0;
}
.detail-heading > a {
  flex-shrink: 0;
}
.recipe-meta {
  display: flex;
  gap: 24px;
  font-size: 0.85rem;
  color: var(--muted);
}
.recipe-columns {
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) minmax(0, 1.5fr);
  gap: 48px;
  padding: 0 36px 36px;
}
.ingredients {
  padding: 0;
}
.ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.ingredients li span {
  overflow-wrap: anywhere;
}
.ingredients li span:last-child {
  color: var(--muted);
  text-align: right;
}
.steps {
  list-style: none;
  padding: 0;
}
.steps li {
  display: flex;
  gap: 20px;
  margin: 24px 0;
}
.step-number {
  font-family: Georgia, serif;
  color: #8c9675;
  font-size: 1.6rem;
}
.steps p {
  color: var(--ink);
  line-height: 1.85;
}
.preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.recipe-detail footer {
  margin: 0;
  padding: 20px 36px;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.editor-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.editor-columns article {
  padding: 24px;
}
.editor-columns input,
.editor-columns textarea {
  font-size: 0.95rem;
}
.ingredient-row,
.step-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 20px;
  margin-bottom: 20px;
}
.ingredient-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 12px;
}
.ingredient-values input {
  padding-inline: 10px;
}
.row-controls {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 12px;
}
.row-controls label {
  flex: 1;
  margin: 0;
}
.row-controls select {
  margin-bottom: 0;
}
.row-controls button {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.8rem;
}
.form-actions {
  display: flex;
  gap: 30px;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 0 30px;
}
.form-actions button {
  margin: 0;
  min-width: 170px;
}
#form-status:not(:empty),
.alert {
  background: #fff0df;
  border: 1px solid #ddc7aa;
  padding: 18px;
  border-radius: 10px;
  color: #77522e;
  margin: 20px 0;
}
#conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.offline {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 24px;
  background: #f5dfb5;
  color: #624a24;
  text-align: center;
}
.login-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: 70vh;
  max-width: 1050px;
  margin: auto;
}
.login-story h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  max-width: 420px;
}
.login-story .still-life {
  max-width: 380px;
  margin-top: 40px;
}
.login-card {
  padding: 36px;
}
.login-card h2 {
  line-height: 1.5;
}
.login-card p {
  font-size: 0.9rem;
}
.login-card button {
  width: 100%;
}
.login-card form {
  margin: 30px 0 0;
}
@media (max-width: 1100px) {
  .sidebar {
    width: 195px;
    padding-inline: 20px;
  }
  .workspace {
    margin-left: 195px;
  }
  main {
    padding: 28px;
  }
  .topbar {
    padding-inline: 28px;
  }
  .home-columns {
    grid-template-columns: 1fr;
  }
  .context-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0;
  }
  .welcome-panel {
    padding: 28px;
  }
  .plate {
    width: 165px;
    height: 165px;
    left: 0;
  }
  .leaf {
    left: 35px;
    top: 22px;
    width: 45px;
    height: 70px;
  }
  .small-plate {
    right: 0;
  }
  .editor-columns {
    grid-template-columns: 1fr;
  }
  .login-layout {
    gap: 40px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: auto;
    padding: 0 8px env(safe-area-inset-bottom);
    background: #fffefaf5;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .sidebar > .wordmark,
  .sidebar > .eyebrow,
  .sidebar-footer {
    display: none;
  }
  .primary-nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    margin: 4px 0;
  }
  .primary-nav a {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    padding: 6px;
    margin: 0;
    min-width: 0;
    border-radius: 8px;
  }
  .primary-nav a[aria-current] {
    background: #e9eddf;
    color: #455936;
  }
  .primary-nav a span {
    font-size: 1.2rem;
  }
  .workspace {
    margin-left: 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .topbar {
    padding: 16px 20px;
    min-height: 72px;
  }
  .breadcrumb {
    display: none;
  }
  .mobile-brand {
    display: inline;
    font-family: Georgia, serif;
    font-size: 1.5rem;
    color: var(--ink);
    font-weight: bold;
  }
  .account-menu {
    gap: 12px;
  }
  .account-menu button {
    padding-inline: 8px;
  }
  main {
    padding: 24px 20px;
  }
  .page-heading {
    margin-top: 4px;
  }
  .page-heading p {
    font-size: 0.9rem;
  }
  .welcome-panel {
    display: block;
    padding: 26px;
    min-height: 0;
    margin-bottom: 30px;
  }
  .welcome-panel .still-life {
    display: none;
  }
  .welcome-panel h1 {
    font-size: 1.8rem;
  }
  .welcome-panel p:not(.eyebrow) {
    font-size: 0.9rem;
  }
  .card-grid {
    gap: 16px;
  }
  .with-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .with-action > a {
    width: 100%;
  }
  .empty-state {
    padding: 30px 20px;
  }
  .section-heading {
    gap: 10px;
  }
  .section-heading a {
    font-size: 0.8rem;
  }
  .context-panel {
    margin-top: 6px;
  }
  .hero-photo {
    height: 240px;
  }
  .detail-heading {
    padding: 24px;
    flex-direction: column;
    gap: 8px;
  }
  .detail-heading h1 {
    font-size: 1.9rem;
  }
  .detail-heading > a {
    width: 100%;
  }
  .recipe-columns {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 24px 24px;
  }
  .recipe-detail footer {
    padding: 20px 24px;
  }
  .recipe-detail {
    margin-inline: -4px;
  }
  .steps li {
    gap: 14px;
  }
  .editor-columns article {
    padding: 20px;
  }
  .editor-columns {
    gap: 0;
  }
  .ingredient-values {
    gap: 8px;
  }
  .editor-columns label {
    font-size: 0.85rem;
  }
  .form-actions {
    padding-bottom: 20px;
  }
  .form-actions button {
    min-width: 150px;
  }
  .login-layout {
    display: block;
    min-height: 0;
  }
  .login-story .still-life {
    display: none;
  }
  .login-story {
    margin: 16px 0 32px;
  }
  .login-story h1 {
    font-size: 2rem;
  }
  .login-card {
    padding: 24px;
  }
}
@media (min-width: 480px) and (max-width: 760px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.search-form button {
  width: auto;
}
