* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-page: #f6f8fb;
  --bg-card: #ffffff;
  --border: #e3eaf3;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;
  --header-bg: #eef5fc;
  --header-bg-end: #e6f0fa;
  --header-border: #d6e6f5;
  --success: #16a34a;
  --success-bright: #22c55e;
  --success-bg: #ecfdf3;
  --success-border: #bbf7d0;
  --warning: #d97706;
  --error: #dc2626;
  --medal-gold: #f0b429;
  --medal-gold-bg: #fff8e6;
  --medal-silver: #94a3b8;
  --medal-silver-bg: #f1f5f9;
  --medal-bronze: #d97706;
  --medal-bronze-bg: #fff7ed;
  --sidebar-width: 34%;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, var(--bg-page) 0%, #eef2f7 100%);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.75rem;
}

/* Header */
.page-header {
  margin-bottom: 1.25rem;
}

.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, var(--header-bg) 0%, var(--header-bg-end) 100%);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.04);
}

.brand-group {
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
  flex-shrink: 0;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0;
}

.page-subtitle {
  color: #5b6b82;
  margin-top: 0.15rem;
  font-size: 0.875rem;
  margin-left: 2.4rem;
}

/* Two-column layout */
.page-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas: "sidebar main";
  gap: 1rem 1.5rem;
  align-items: start;
}

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0.75rem;
}

.main-panel {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Input */
.input-section {
  padding: 1.25rem 1.25rem 1.125rem;
}

.section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.section-title-sm {
  font-size: 1rem;
  margin-bottom: 0;
}

.section-hint {
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-secondary);
  margin-bottom: 0.875rem;
  line-height: 1.5;
}

.section-hint code {
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  color: var(--text-primary);
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

textarea::placeholder {
  color: var(--text-muted);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

button {
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-secondary {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
}

.btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.product-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.product-count-badge:empty {
  display: none;
}

/* Progress */
.progress-section {
  padding: 1.125rem 1.25rem;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.progress-counter {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.progress-bar-wrap {
  background: #eef2f6;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.progress-bar {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.35s ease;
  border-radius: 999px;
}

.progress-list-wrap {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.progress-list-wrap::-webkit-scrollbar {
  width: 6px;
}

.progress-list-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.progress-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.progress-item {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.progress-item-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.progress-item-num {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
}

.progress-item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.progress-item-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding-left: 1.1rem;
}

.progress-icon {
  font-size: 0.8125rem;
  line-height: 1;
}

.progress-item--done .progress-item-status,
.progress-icon--done {
  color: var(--success);
}

.progress-item--searching .progress-item-status,
.progress-item--checking .progress-item-status,
.progress-icon--active {
  color: var(--accent);
}

.progress-item--waiting .progress-item-status,
.progress-icon--waiting {
  color: var(--text-muted);
}

.progress-item--error .progress-item-status,
.progress-icon--error {
  color: var(--error);
}

.progress-item--not_found .progress-item-status {
  color: var(--warning);
}

/* Info card */
.info-card {
  padding: 1rem 1.125rem;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.info-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--accent);
  flex-shrink: 0;
}

.info-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Results panel */
.results-header {
  padding: 1.125rem 1.25rem;
}

.results-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-header-top h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-excel-icon {
  font-size: 0.9375rem;
  line-height: 1;
}

.btn-excel:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.btn-excel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.results-checked-at {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.results-summary-stats {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.stat-found {
  color: var(--success);
  font-weight: 600;
}

.stat-not-found {
  color: var(--warning);
  font-weight: 500;
}

.stat-not-found-zero {
  color: var(--text-muted);
  font-weight: 500;
}

.results-empty {
  padding: 2rem 1.5rem;
  text-align: center;
}

.results-empty.hidden {
  display: none;
}

.results-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.results-empty-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.error-box {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: none;
  font-size: 0.875rem;
}

.error-box.visible {
  display: block;
}

.results-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.results-section:empty {
  display: none;
}

/* Product cards */
.product-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem;
}

.product-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.product-block.is-collapsed .product-block-header {
  margin-bottom: 0;
}

.product-block-body {
  margin-top: 1rem;
}

.product-block.is-collapsed .product-block-body {
  display: none;
}

.product-block-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef2f6;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.product-block.is-collapsed .product-block-summary {
  display: flex;
}

.product-summary-text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.product-summary-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.btn-collapse {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1;
  flex-shrink: 0;
}

.btn-collapse:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.product-title-group h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.product-title-group h2.title-article-only {
  margin-bottom: 0;
}

.product-title-group h2.title-article-only {
  margin-bottom: 0;
}

.product-title-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.match-badge--exact {
  color: #15803d;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.match-badge--model {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.match-badge--review {
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.match-badge--mismatch {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.btn-search-more {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.btn-search-more:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text-primary);
}

.btn-search-more:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.purchase-total-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef2f6;
}

.purchase-total-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.purchase-total-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e3a5f;
}

.purchase-total-hint,
.purchase-total-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.purchase-total-note {
  color: #b45309;
}

.product-index {
  color: var(--text-muted);
  font-weight: 600;
}

.article-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
}

.article-mismatch {
  color: #b45309;
  font-weight: 600;
  border-bottom: 1px dashed #b45309;
  cursor: help;
}

.product-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.btn-refresh {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.btn-refresh:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--text-primary);
}

.btn-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-block--refreshing {
  opacity: 0.88;
}

.refresh-hint {
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 0.875rem;
  font-weight: 500;
}

.product-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-DONE { background: var(--success-bg); color: var(--success); }
.status-NOT_FOUND { background: #fff7ed; color: #c2410c; }
.status-ERROR { background: #fef2f2; color: #b91c1c; }
.status-SEARCHING,
.status-CHECKING { background: var(--accent-light); color: var(--accent); }
.status-WAITING { background: #f1f5f9; color: #64748b; }

.not-found-body {
  padding: 1rem 0 0.25rem;
}

.not-found-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.not-found-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.product-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.product-footer-stats {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: #475569;
  background: #eef5fc;
  border: 1px solid #d6e6f5;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  line-height: 1.45;
}

.verified-info-icon {
  color: var(--accent);
  font-size: 0.875rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 640px;
}

.offers-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.offers-table td {
  padding: 1rem 0.875rem;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}

.offers-table tbody tr:last-child td {
  border-bottom: none;
}

.offers-table tbody tr:hover td {
  background: #fafbfc;
}

.col-num { width: 44px; }

.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
}

.rank-medal-1 { background: var(--medal-gold-bg); color: #a67c00; box-shadow: inset 0 0 0 1px rgba(240, 180, 41, 0.35); }
.rank-medal-2 { background: var(--medal-silver-bg); color: #7b8798; box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35); }
.rank-medal-3 { background: var(--medal-bronze-bg); color: #b87333; box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.25); }

.col-seller {
  font-weight: 600;
  color: var(--text-primary);
}

a.seller-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

a.seller-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.price-best {
  color: var(--success-bright);
  font-weight: 700;
  font-size: 1.0625rem;
}

.price-regular {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
}

.price-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 999px;
  vertical-align: middle;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.availability-in_stock .availability-dot { background: var(--success-bright); }
.availability-available_to_order .availability-dot { background: var(--warning); }
.availability-out_of_stock .availability-dot { background: #ef4444; }
.availability-unknown .availability-dot { background: #94a3b8; }

.link-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

a.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
}

a.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.link-icon {
  width: 13px;
  height: 13px;
}

.details-toggle {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
}

.details-toggle:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.details-toggle.open {
  background: var(--accent-light);
  border-color: var(--accent-border);
  color: var(--accent);
}

.details-panel {
  display: none;
  margin-top: 0.5rem;
  padding: 0.75rem 0.875rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.details-panel.open { display: block; }

.details-panel strong {
  color: var(--text-primary);
  font-weight: 600;
}

.details-panel div + div { margin-top: 0.3rem; }

.product-footer {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef2f6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checked-at {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.message {
  font-size: 0.8125rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-sm);
}

.message-info {
  color: #1e4f8f;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
}

.message-info-soft {
  color: #1e4f8f;
  background: #eef5fc;
  border: 1px solid #d6e6f5;
}

.message-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.message-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.debug-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  margin-top: 0.875rem;
  font-size: 0.75rem;
}

.debug-block h4 { margin-bottom: 0.4rem; font-size: 0.8125rem; }
.debug-block ul { list-style: none; padding: 0; }
.debug-block li { padding: 0.1rem 0; color: var(--text-secondary); }

.rejected-list {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.4rem;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.35rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}

.page-footer-tagline {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.page-footer-copy {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Контекстное меню */
.context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 168px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.14);
  padding: 0.3rem 0;
}

.context-menu.hidden {
  display: none;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover:not(:disabled) {
  background: var(--accent-light);
  color: var(--accent);
}

.context-menu button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 38%;
  }

  .container {
    padding: 1.25rem 1rem 2rem;
  }
}

/* Mobile — single column */
@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
  }

  .sidebar {
    position: static;
  }

  .page-subtitle {
    margin-left: 0;
  }

  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-secondary {
    flex: 1;
  }

  textarea {
    min-height: 140px;
  }
}

@media (max-width: 640px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

  .input-section,
  .product-block,
  .progress-section,
  .results-header {
    padding: 1rem;
  }

  .offers-table {
    font-size: 0.8125rem;
    min-width: 560px;
  }

  .offers-table th,
  .offers-table td {
    padding: 0.65rem 0.5rem;
  }
}
