:root {
  color-scheme: light;
  --ink: #182645;
  --muted: #52647e;
  --line: #dce4ef;
  --accent: #2159d7;
  --pale: #edf3ff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f3f6fb; color: var(--ink); }
.shell { width: min(1100px, calc(100% - 36px)); margin-inline: auto; }
.top { background: #0d1932; color: white; }
.mast { display: flex; justify-content: space-between; align-items: center; min-height: 72px; gap: 10px; }
.mast a { color: #e4edff; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; line-height: 1.15; }
.brand small { display: block; color: #a8bce0; font-size: .74rem; font-weight: 550; margin-top: 3px; }
.mark { display: grid; place-items: center; width: 40px; height: 40px; background: #265bd0; border: 1px solid #5f8aee; border-radius: 12px; }
.intro { margin: 30px 0 24px; padding: clamp(24px, 4vw, 45px); color: #fff; border-radius: 22px; background: radial-gradient(ellipse at 100% 0%, #285fc4, transparent 65%), #13274f; }
.intro h1 { font-size: clamp(1.9rem, 5vw, 3.15rem); line-height: 1.05; margin: 16px 0 10px; letter-spacing: -.045em; }
.intro p { color: #d8e5ff; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #748fc3; border-radius: 30px; padding: 4px 10px; font-size: .77rem; font-weight: 700; }
.badge span { background: #82ecc5; width: 7px; height: 7px; border-radius: 50%; }
.nav { display: flex; gap: 7px; margin-bottom: 17px; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 9px; padding: 9px 13px; font-weight: 650; cursor: pointer; }
button:hover { border-color: #6b8dca; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #4b7bee; outline-offset: 2px; }
button[aria-pressed="true"], .primary { color: white; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #1548b9; }
.panel { padding: clamp(16px, 3vw, 28px); background: #fff; border: 1px solid var(--line); border-radius: 17px; margin-bottom: 30px; }
.heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
h2 { margin: 0; font-size: 1.35rem; }
.heading p, #catalog-list > p { color: var(--muted); margin: 6px 0 0; }
.heading button { flex-shrink: 0; }
label { display: grid; gap: 5px; font-weight: 650; font-size: .89rem; }
input, select, textarea { border: 1px solid #cbd7e7; border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; background: white; color: var(--ink); }
textarea { resize: vertical; }
.filters, .form-grid { display: grid; grid-template-columns: minmax(0,2fr) repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 0; }
.product { display: grid; grid-template-columns: 54px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.product img, #photo-preview { width: 54px; height: 54px; object-fit: contain; background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; }
.product small, .product span, .order small, .photo-field small { display: block; color: var(--muted); margin-top: 3px; font-size: .8rem; }
.product strong { overflow-wrap: anywhere; }
.product-price { text-align: right; }
.pagination { margin-top: 14px; text-align: center; }
#notice { margin: 0 0 12px; padding: 11px 14px; background: #e8f6ed; color: #205b3f; border-radius: 9px; }
#notice.error, .error { color: #9d243a; }
#notice.error { background: #fff0f2; }
form { display: grid; gap: 12px; }
form > button { justify-self: start; }
#settings-form { max-width: 650px; }
.manual { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 16px; }
summary { cursor: pointer; font-weight: 700; }
.manual form { margin-top: 12px; }
.order-filter { max-width: 240px; margin-bottom: 14px; }
.order { padding: 13px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.order-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.order select { width: auto; }
.order ul { padding-left: 22px; }
.order p { white-space: pre-wrap; }
dialog { width: min(560px, calc(100% - 24px)); color: var(--ink); border: 1px solid var(--line); border-radius: 15px; padding: 20px; max-height: calc(100% - 24px); }
dialog::backdrop { background: #0a1736a0; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.dialog-header button { font-size: 1.2rem; padding: 3px 10px; }
.photo-field { display: flex; align-items: center; gap: 10px; }
.photo-field label { flex: 1; min-width: 0; }
.estimate { margin: 0; padding: 9px; background: var(--pale); border-radius: 8px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
@media (max-width: 600px) {
  .shell { width: calc(100% - 22px); }
  .heading { flex-wrap: wrap; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .product { grid-template-columns: 44px minmax(0,1fr) auto; gap: 8px; }
  .product img { width: 44px; height: 44px; }
  .product-price { grid-column: 2; text-align: left; grid-row: 2; }
  .product > button { grid-column: 3; grid-row: 1 / 3; }
}

.login { max-width: 430px; margin-top: 36px; }
.login h1 { margin-top: 0; font-size: 1.5rem; }
.mast-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 8px 12px; }
.mast-actions button { font-size: .86rem; }
