:root {
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #162b2a;
  background: #f1f5f2;
  --accent: #165e51;
  --line: #d8e2dc;
  --muted: #4d625b;
  --paper: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9c551f; outline-offset: 3px; }
.wrap { width: min(100% - 2rem, 56rem); margin-inline: auto; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row, .header-actions, .brand, .language, .page-title {
  display: flex; align-items: center; gap: .65rem;
}
.header-row { justify-content: space-between; min-height: 4.4rem; }
.brand { text-decoration: none; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { width: 1.9rem; aspect-ratio: 1; border-radius: .55rem; background: var(--accent); display: grid; place-items: center; }
.brand-mark::after {
  content: ""; width: .9rem; height: .5rem; border: 1.5px solid white; border-radius: .6rem;
  background: linear-gradient(90deg, white 50%, transparent 50%); transform: rotate(-40deg);
}
.language { gap: .15rem; padding: .16rem; border: 1px solid var(--line); border-radius: .65rem; }
.language button, .quiet { background: transparent; border: 0; color: var(--muted); }
.language button { min-height: 44px; border-radius: .45rem; padding-inline: .55rem; font-size: .84rem; }
.language button[aria-pressed="true"] { color: var(--accent); background: #e4f1eb; font-weight: 700; }
button.quiet { min-height: 44px; padding: 0 .25rem; }
main.wrap { padding-block: clamp(1.75rem, 6vw, 4rem); }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.15; margin: 0; letter-spacing: -.045em; }
.page-title { justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 44px; padding: .55rem .85rem; border: 1px solid var(--line);
  border-radius: .65rem; background: var(--paper); color: inherit;
  font-weight: 650; text-decoration: none;
}
.button:hover { border-color: var(--accent); }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #104c41; }
.catalog, .card { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.catalog-controls { padding: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.search { display: flex; gap: .4rem; align-items: center; }
input:not([type="hidden"]), select {
  width: 100%; min-width: 0; min-height: 44px; padding: .5rem .72rem;
  border: 1px solid #8ca399; border-radius: .6rem; background: white; color: inherit;
}
.filter { display: flex; gap: .35rem; }
.filter a {
  min-height: 44px; display: inline-flex; align-items: center; border-radius: .6rem;
  padding-inline: .75rem; color: var(--muted); text-decoration: none;
}
.filter a[aria-current] { color: var(--accent); background: #e4f1eb; font-weight: 700; }
.products { list-style: none; margin: 0; padding: 0; }
.products li { border-top: 1px solid var(--line); }
.product-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: .75rem; padding: .8rem 1rem; text-decoration: none;
}
.product-row:hover { background: #f6faf7; }
.product-row:focus-visible { outline-offset: -4px; }
.product-row:last-child { border-radius: 0 0 .95rem .95rem; }
.product-text { display: grid; gap: .2rem; overflow-wrap: anywhere; }
.product-text .muted { font-size: .87rem; }
.picture {
  position: relative; display: grid; place-items: center; width: 3rem; aspect-ratio: 1;
  background: #eaf0ec; border-radius: .6rem; overflow: hidden;
}
.picture::before {
  content: ""; width: 41%; height: 43%; background: #b4c5bc;
  clip-path: polygon(0 24%, 50% 0, 100% 24%, 100% 77%, 50% 100%, 0 77%);
}
.picture img { position: absolute; width: 100%; height: 100%; object-fit: contain; background: white; }
.stock {
  border-radius: .5rem; padding: .27rem .45rem; font-size: .8rem; font-weight: 700;
  color: #18583c; background: #e5f3e9;
}
.stock.open { color: #70440f; background: #faf0dc; }
.stock.empty { color: #4e5b56; background: #ebefed; }
.arrow { color: var(--muted); font-size: 1.3rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state p { margin: .45rem 0 0; color: var(--muted); }
.muted, small { color: var(--muted); }
.narrow { max-width: 34rem; margin-inline: auto; }
.login { max-width: 26rem; }
.back { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin-bottom: .3rem; }
.fields { display: grid; gap: 1rem; margin-top: 1.25rem; padding: clamp(1rem, 4vw, 1.5rem); }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 650; }
.fields > .button { justify-self: start; }
.errorlist, .notice { color: #922d24; }
.errorlist { padding-left: 1.15rem; margin: 0; }
.notice { padding: 1rem; background: #fff2ea; border-radius: .6rem; overflow-wrap: anywhere; }
.feedback { margin: 0 0 1rem; padding: .8rem 1rem; color: var(--accent); background: #e4f1eb; border-radius: .65rem; }
.danger-link { margin-top: 1rem; color: #922d24; }
.danger { color: white; background: #922d24; border-color: #922d24; }
.danger:hover { background: #78251e; border-color: #78251e; }
.confirm-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.fields > p { margin: 0; overflow-wrap: anywhere; }
.image-fields { display: grid; gap: .7rem; border: 1px solid var(--line); border-radius: .6rem; margin: 0; padding: .8rem; min-width: 0; }
.image-fields .button { justify-self: start; }
.image-fields p { margin: 0; }
.preview { width: 7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 380px) {
  .header-row { flex-wrap: wrap; padding-block: .35rem; }
  .header-actions, .product-row, .search { gap: .3rem; }
  .product-row { padding-inline: .65rem; }
  .picture:not(.preview) { width: 2.35rem; }
  .button { padding-inline: .55rem; }
}
