:root {
  --ink: #20211e;
  --muted: #686b62;
  --line: #ded9cc;
  --paper: #f7f4ec;
  --panel: #fff;
  --accent: #213f34;
  --soft: #e9eee7;
  --warm: #c39a52;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
.page { min-height: 100svh; padding: 8px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 8px; background: #17352f; color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand span { overflow: hidden; color: #f4e6c8; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.admin-link, .button, button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-weight: 750; }
.admin-link { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); }
.browser-hint { margin: 10px 0; padding: 12px 14px; border: 1px solid #f2b8b5; border-radius: 8px; background: #fff3f2; color: #b3261e; font-size: 15px; font-weight: 800; line-height: 1.45; }
.toolbar, .panel { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.toolbar { position: sticky; top: 0; z-index: 5; display: grid; gap: 10px; }
.toolbar input, .toolbar select, .panel input, .panel select, .panel textarea { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.panel textarea { min-height: 86px; padding-top: 10px; resize: vertical; }
.toolbar label, .panel label { display: grid; gap: 6px; color: var(--accent); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.grid { display: grid; gap: 9px; }
.product { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 8px 10px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.product img { grid-row: 1 / span 4; width: 92px; aspect-ratio: 1; border-radius: 8px; object-fit: contain; background: var(--soft); }
.sku { width: fit-content; padding: 5px 7px; border-radius: 8px; background: var(--soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.product h2 { display: -webkit-box; overflow: hidden; margin: 0; font-size: 16px; line-height: 1.22; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.folders { display: grid; grid-template-columns: 1fr; gap: 10px; }
.folder { min-height: 124px; align-content: end; display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg,#fff,#eef4ef); }
.folder strong { font-size: 28px; line-height: 1.05; }
.folder span { color: var(--muted); }
.product-info-panel { display: grid; gap: 12px; }
.product-info-panel h2 { margin: 0; }
.product-info-copy { color: var(--ink); line-height: 1.65; white-space: normal; }
.info-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.copy-info-button { min-height: 40px; }
.copy-status { margin: 0; color: var(--accent); font-weight: 700; }
.save-hint { margin: -4px 0 14px; padding: 12px 14px; border: 1px solid #f2b8b5; border-radius: 8px; background: #fff3f2; color: #b3261e; font-size: 15px; font-weight: 800; line-height: 1.45; }
.media-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.media { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.preview { flex: 0 0 auto; background: #fff; }
.preview img { width: 100%; height: auto; display: block; }
.preview video { width: 100%; height: auto; display: block; background: linear-gradient(135deg,#1c241f,#0d0f0e); }
.media .button { width: calc(100% - 14px); min-height: 36px; margin: auto 7px 7px; background: var(--warm); color: #1d1b16; font-size: 12px; }
.back { display: inline-flex; align-items: center; width: fit-content; margin: 18px 0 14px; color: var(--accent); font-weight: 750; line-height: 1.2; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.section-head h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.section-head span { color: var(--muted); font-size: 13px; font-weight: 700; }
.feedback-section { margin-top: 18px; }
.feedback-grid, .feedback-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.feedback-card, .feedback-admin-item { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.feedback-card img, .feedback-admin-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.feedback-card .button { width: calc(100% - 14px); min-height: 36px; margin: 7px; background: var(--warm); color: #1d1b16; font-size: 12px; }
.feedback-admin { display: grid; gap: 12px; }
.feedback-admin-item { display: grid; gap: 7px; padding: 7px; }
.feedback-admin-item button { min-height: 38px; }
.admin-layout { display: grid; gap: 12px; }
.stack-form { display: grid; gap: 10px; }
.editor-panel { display: grid; gap: 10px; }
.admin-product-panel { max-height: none; }
.panel h2 { margin: 0 0 14px; font-size: 24px; line-height: 1.15; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.mini-link { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); font-weight: 800; }
.admin-filter { display: grid; gap: 9px; margin-bottom: 10px; }
.admin-filter button { width: 100%; }
.count-line { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.product-list { max-height: 54svh; overflow: auto; padding-right: 2px; }
.empty-note { padding: 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.upload-progress { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; }
.upload-progress[hidden] { display: none; }
.upload-progress div { overflow: hidden; height: 10px; border-radius: 999px; background: var(--soft); }
.upload-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--warm); transition: width .18s ease; }
.upload-progress p { margin: 0; color: var(--muted); font-size: 13px; }
.upload-button:disabled { cursor: wait; opacity: .72; }
.message { margin: 10px 0; padding: 12px; border-radius: 8px; background: #eef8f0; color: var(--accent); font-weight: 700; }
.danger { background: #872f28; }
.list-card { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; }
.list-card.active { border-color: var(--accent); background: var(--soft); }
.list-card strong { color: var(--accent); }
.list-card span, .list-card small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions, .delete-form { display: flex; gap: 8px; flex-wrap: wrap; }
.delete-form { margin: 0; }
.delete-form button { width: 100%; }
.login-wrap { display: grid; min-height: calc(100svh - 92px); place-items: start center; padding: 18px 0; }
.login-card { width: min(100%, 430px); margin: 0 auto; padding: 18px; }
.login-card h1 { margin: 14px 0 16px; color: var(--ink); font-size: 26px; line-height: 1.15; }
.login-card button { width: 100%; margin-top: 4px; }
.login-card input { min-height: 52px; font-size: 18px; }
.login-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 800; }
.login-brand img { width: 38px; height: 38px; border-radius: 9px; }
@media (min-width: 860px) {
  .page { max-width: 1680px; margin: 0 auto; padding: 22px; }
  .catalog { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-layout { grid-template-columns: minmax(280px,.8fr) minmax(360px,1fr) minmax(330px,.9fr); align-items: start; }
  .folders { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .media-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .feedback-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .feedback-admin-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .admin-filter { grid-template-columns: 1fr; }
  .product-list { max-height: 620px; }
}
@media (max-width: 520px) {
  .hero { padding: 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand span { font-size: 15px; }
  .admin-link, .button, button { min-height: 44px; padding: 0 12px; }
  .toolbar, .panel { padding: 10px; }
  .product { grid-template-columns: 78px minmax(0,1fr); }
  .product img { width: 78px; }
  .folder { min-height: 112px; }
  .folder strong { font-size: 24px; }
  .info-title-row { align-items: stretch; flex-direction: column; }
  .copy-info-button { width: 100%; }
  .media-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .media .button { font-size: 13px; }
  .panel h2 { font-size: 22px; }
  .product-list { max-height: 38svh; }
  .back { margin: 16px 0 12px; font-size: 18px; }
}
