:root { --brown: #8a5a33; --dark: #2b1d12; --bg: #f5f1ea; --line: #e3d9cc; --muted: #6b6158; --red: #b3261e; --green: #2f6a3a; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: #1f1a16; font-size: 16px; }
h1, h2, h3 { margin: 0 0 12px; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; margin-top: 18px; }
[hidden] { display: none !important; }
.small { font-size: .85rem; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.hint { font-size: .85rem; color: var(--muted); margin: 4px 0 12px; }
label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; margin-bottom: 12px; }
input, select, textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
textarea { resize: vertical; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; }
.btn.primary { background: var(--brown); color: #fff; border-color: var(--brown); }
.btn.danger { color: var(--red); border-color: #f0c9c6; }
.btn:disabled { opacity: .6; }
.small-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--brown); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 0; margin-bottom: 8px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; margin-bottom: 16px; }
.error { color: var(--red); min-height: 1.2em; }
.status { min-height: 1.2em; font-weight: 600; margin: 10px 0 0; }
.status.ok { color: var(--green); } .status.err { color: var(--red); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.grid2, .grid3 { display: grid; gap: 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 20px; height: 20px; }

.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 380px; }
.login img { margin-bottom: 12px; }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--dark); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.topbar-right a { color: #e2c49d; }
.tabs { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; }
.tabs button { flex: 1; background: transparent; color: #e7d9c6; border: 0; font: inherit; padding: 10px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.pill { background: #d9822b; color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .75rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px 16px 60px; }

.album-list { display: grid; gap: 12px; }
.album-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; text-align: left; font: inherit; width: 100%; }
.album-item img, .album-item .noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #eadfce; flex: none; }
.album-item .info { min-width: 0; flex: 1; }
.album-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: .72rem; border-radius: 999px; padding: 2px 8px; background: #eee5d8; margin: 4px 4px 0 0; }
.tag.draft { background: #f6dcc4; } .tag.feat { background: #d8e8d6; }

.lang-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.lang-tabs button { border: 0; background: #fff; font: inherit; font-weight: 600; padding: 8px 18px; cursor: pointer; }
.lang-tabs button.active { background: var(--dark); color: #fff; }

.dropzone { position: relative; display: grid; place-items: center; text-align: center; gap: 4px; border: 2px dashed #cdb79c; border-radius: 12px; padding: 28px 16px; background: #fbf7f1; cursor: pointer; font-weight: 400; }
.dropzone.over { background: #f1e5d4; border-color: var(--brown); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone span { color: var(--muted); font-size: .85rem; }
.progress { margin-top: 12px; background: #eee5d8; border-radius: 999px; height: 26px; position: relative; overflow: hidden; }
.progress div { background: var(--brown); height: 100%; width: 0; transition: width .2s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; font-weight: 600; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.photo { background: #fbf7f1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.photo.cover { outline: 3px solid var(--brown); }
.photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.photo .actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.photo .actions button { flex: 1; min-height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: .8rem; padding: 4px; }
.photo details { padding: 0 6px 6px; font-size: .8rem; }
.photo details input { padding: 6px 8px; font-size: 14px; margin-top: 4px; }
.photo .badge { font-size: .7rem; background: var(--brown); color: #fff; padding: 2px 8px; text-align: center; }

.msg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.msg.unread { border-left: 4px solid #d9822b; }
.msg header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.msg p { white-space: pre-line; margin: 8px 0; }
.msg .contact a { margin-right: 12px; color: var(--brown); font-weight: 600; }

@media (min-width: 700px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
  .tabs { order: 0; width: auto; }
  .tabs button { flex: none; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .album-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .panel { padding: 24px; }
}

.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.logo-row img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
input[type=color] { height: 48px; padding: 4px; }
#texts-search { margin: 4px 0 12px; }
.text-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.text-group summary { padding: 12px 14px; cursor: pointer; font-weight: 600; }
.text-row { padding: 10px 14px; border-top: 1px solid var(--line); }
.text-row .key { font-size: .75rem; color: var(--muted); margin-bottom: 6px; font-family: ui-monospace, monospace; }
.text-row label { font-weight: 500; margin-bottom: 6px; grid-template-columns: 32px 1fr; align-items: start; }
.text-row textarea { min-height: 42px; font-size: 14px; padding: 8px 10px; }
.sticky-save { position: sticky; bottom: 0; background: #fff; padding: 12px 0 4px; display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; }
.sub-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 6px; flex-wrap: wrap; }
.sub-row span { color: var(--muted); font-size: .85rem; }
.estimate-box { background: #f6efe5; border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: .9rem; }
.estimate-box p { margin: 4px 0 0; }
.price-grid { display: grid; gap: 0 14px; }
.price-input { display: flex; align-items: center; gap: 8px; }
.price-input input { max-width: 140px; }
.price-input small { color: var(--muted); font-weight: 400; }
@media (min-width: 700px) { .price-grid { grid-template-columns: 1fr 1fr; } }
.cat-section { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; margin: 16px 0; background: #fff; }
.cat-section summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.cat-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fcfaf7; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch-mini { width: 24px; height: 24px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); flex: none; }
.type-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.type-checks .check { margin-bottom: 4px; }
.cat-item .hint { margin: 2px 0 4px; }
.price-input select { width: auto; }
.placeholders { line-height: 1.9; }
.placeholders code { background: #eee5d8; border-radius: 4px; padding: 1px 6px; font-size: .85em; }
