:root {
  --ink: #142c2b;
  --muted: #6b7f7d;
  --line: #dfe8e5;
  --canvas: #f3f7f5;
  --card: #ffffff;
  --green: #0b6b5e;
  --green-dark: #07564c;
  --green-soft: #e4f3ee;
  --orange: #e27436;
  --orange-soft: #fff0e7;
  --red: #b74747;
  --shadow: 0 20px 50px rgba(21, 53, 49, .13);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.permission-layout {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.permission-users {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #f6faf8;
}

.permission-user {
  display: flex;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  flex-direction: column;
  gap: 3px;
}

.permission-user.active { border-color: var(--green); background: var(--green-soft); }
.permission-user span, .permission-user small { color: var(--muted); }
.permission-form { padding: 24px; }
.permission-active { display: flex !important; align-items: center; gap: 8px; }
.permission-active input { width: auto; }
.permission-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.permission-groups fieldset { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.permission-groups legend { padding: 0 6px; font-weight: 700; }
.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-options label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.permission-options input { width: auto; }
.permission-hint { display: block; margin-top: 12px; color: var(--muted); }
.permission-admin-note { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); }

@media (max-width: 900px) {
  .permission-layout, .permission-groups { grid-template-columns: 1fr; }
  .permission-users { border-right: 0; border-bottom: 1px solid var(--line); }
}

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #102e2b; color: white; padding: 28px 20px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; background: var(--orange); letter-spacing: -.04em; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { color: #abc2be; font-size: 11px; margin-top: 3px; }
nav { display: grid; gap: 7px; }
.nav-item { border: 0; color: #bcd0cd; background: transparent; text-align: left; border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; gap: 11px; align-items: center; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.10); }
.nav-item span { width: 18px; text-align: center; }

main { padding: 36px 44px 48px; min-width: 0; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 7px; color: var(--orange); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 23px; }
h3 { margin-bottom: 5px; font-size: 16px; }
.top-actions { display: flex; gap: 10px; }
.top-actions .compact-select { height: 40px; max-width: 150px; border-radius: 9px; }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; font-weight: 700; font-size: 13px; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: white; box-shadow: 0 5px 14px rgba(11,107,94,.2); }
.button.primary:hover { background: var(--green-dark); }
.button.ghost { color: var(--ink); background: white; border-color: var(--line); }
.button.danger { color: var(--red); background: white; border-color: #e8c3c3; }
.button.danger:hover { background: #fff1f1; }
.button.small { min-height: 34px; padding: 0 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -28px; width: 70px; height: 70px; border-radius: 50%; background: var(--green-soft); }
.stat-card:nth-child(2)::after { background: var(--orange-soft); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 26px; line-height: 1.1; margin: 9px 0 6px; letter-spacing: -.04em; }

.content-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.toolbar { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.search-wrap { flex: 1; max-width: 420px; height: 39px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: #f5f8f7; border: 1px solid transparent; border-radius: 9px; }
.search-wrap:focus-within { border-color: #6aa99e; background: white; box-shadow: 0 0 0 3px var(--green-soft); }
.search-wrap span { color: var(--muted); font-size: 21px; transform: rotate(-15deg); }
.search-wrap input { width: 100%; height: 100%; margin: 0; padding: 0; outline: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; }
.search-wrap input:focus { border: 0; box-shadow: none; }
.catalog-filters { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.compact-select { width: auto; max-width: 170px; height: 34px; margin: 0; padding: 0 28px 0 10px; color: var(--muted); border-color: var(--line); border-radius: 999px; background-color: white; font-size: 12px; cursor: pointer; }
.filter-group { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 999px; height: 34px; padding: 0 12px; cursor: pointer; font-size: 12px; }
.chip.active { border-color: var(--green); color: var(--green); background: var(--green-soft); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th { color: var(--muted); background: #fafcfb; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 11px 12px; font-weight: 700; }
.counter-reset { display: block; margin-top: 5px; padding: 0; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 700; }
.shipment-sequence { white-space: nowrap; color: var(--green); font-weight: 800; }
td { padding: 14px 12px; border-top: 1px solid #edf1f0; vertical-align: middle; font-size: 13px; }
.code-column { width: 56px; }
.product-code { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fbfdfc; }
.product-cell { display: flex; align-items: center; min-width: 125px; }
.image-frame { position: relative; width: 52px; height: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, var(--green-soft), #c9e5dc); display: grid; place-items: center; color: var(--green); font-size: 11px; font-weight: 800; }
.image-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: white; }
.image-frame.empty { color: #91aaa6; background: #f1f5f4; font-size: 10px; }
.image-frame.load-error { color: var(--red); background: #fff0f0; }
.image-button { padding: 0; cursor: zoom-in; }
.image-button:hover { border-color: #6aa99e; box-shadow: 0 0 0 3px var(--green-soft); }
.product-cell strong, .supplier-cell strong { display: block; max-width: 190px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.product-cell span, .supplier-cell span, .value-note { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.supplier-cell a { color: var(--orange); text-decoration: none; font-size: 11px; font-weight: 700; }
.price strong { display: block; font-size: 14px; }
.price span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { color: #9a661d; background: #fff3d8; }
.status.active { color: var(--green); background: var(--green-soft); }
.status.archived { color: #6f7473; background: #ecefef; }
.status.order-paid { color: #9a661d; background: #fff3d8; }
.status.order-completed { color: var(--green); background: var(--green-soft); }
.status.order-canceled { color: var(--red); background: #fff0f0; }
.status.order-unpaid, .status.order-payment_processing { color: #596f9f; background: #edf1fb; }
.status.order-refunded, .status.order-partially_refunded { color: #7b5a8e; background: #f4ecf8; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.generation-action { min-width: 58px; height: 33px; padding: 0 9px; border: 1px solid #b9d7d1; border-radius: 8px; color: var(--green); background: var(--green-soft); cursor: pointer; white-space: nowrap; font-size: 11px; font-weight: 800; }
.generation-action:hover { color: white; border-color: var(--green); background: var(--green); }
.icon-button { width: 33px; height: 33px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 19px; }
.icon-button:hover { color: var(--ink); background: #edf4f2; }
.icon-button.danger:hover { color: var(--red); background: #fff0f0; }
.table-footer { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pagination label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; }
.pagination select { width: auto; height: 30px; margin: 0; padding: 0 24px 0 8px; border-radius: 7px; font-size: 11px; }
.pagination button { min-height: 30px; padding: 0 10px; color: var(--green); border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; }
.pagination button:hover:not(:disabled) { border-color: var(--green); background: var(--green-soft); }
.pagination button:disabled { color: #a9b6b4; cursor: not-allowed; background: #f3f6f5; }
.pagination #page-info { min-width: 70px; text-align: center; }
.empty-state { padding: 60px 20px; display: grid; justify-items: center; gap: 7px; color: var(--muted); }
.empty-state div { width: 52px; height: 52px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 50%; font-size: 27px; }

.etsy-config-notice { margin-bottom: 18px; padding: 14px 17px; display: flex; align-items: center; gap: 12px; border: 1px solid #edcca2; border-radius: 11px; color: #81551c; background: #fff8ea; }
.etsy-config-notice strong { white-space: nowrap; }
.etsy-config-notice span { color: #936e40; font-size: 12px; }
.shop-strip { padding: 12px 18px; display: flex; gap: 10px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fafcfb; }
.shop-pill { min-width: 220px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.shop-pill strong, .shop-pill span { display: block; }
.shop-pill strong { font-size: 12px; }
.shop-pill span, .shop-pill small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.shop-pill small { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-pill small.error { color: var(--red); }
.order-table { min-width: 1900px; }
.order-table th:nth-child(5) { width: 30%; }
.order-number { color: var(--green); font-variant-numeric: tabular-nums; }
.order-items-cell { min-width: 300px; }
.order-item-line + .order-item-line { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.order-item-line { display: flex; align-items: center; gap: 10px; }
.order-item-image, .order-item-placeholder { width: 52px; height: 52px; flex: 0 0 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f1f5f4; }
.order-item-image { padding: 0; cursor: zoom-in; }
.order-item-image:hover { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.order-item-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.order-item-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.order-item-copy { min-width: 0; }
.order-item-copy strong, .order-item-copy span, .order-item-copy small { display: block; }
.order-item-copy strong { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.order-item-copy span, .order-item-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.order-notes-cell { min-width: 230px; }
.order-notes-input { width: 220px; min-height: 72px; margin: 0; padding: 7px 8px; resize: vertical; font-size: 11px; line-height: 1.4; }
.order-notes-input.saving { opacity: .65; }
.order-notes-cell small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.order-ship-by { min-width: 155px; color: var(--orange); font-weight: 700; white-space: nowrap; }
.order-buyer { min-width: 145px; }
.order-buyer span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.order-address { min-width: 190px; }
.order-address span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.copy-address { margin-top: 7px; padding: 4px 7px; color: var(--green); border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; font-size: 10px; }
.copy-address:hover { border-color: var(--green); background: var(--green-soft); }
.order-money { min-width: 130px; }
.order-money span, .order-money strong { display: block; }
.order-money span { margin-bottom: 2px; color: var(--muted); font-size: 9px; }
.order-money strong + span { margin-top: 8px; }
.manual-shipping { min-width: 96px; }
.manual-shipping label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.manual-shipping input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.manual-shipping span { color: var(--muted); font-size: 10px; }
.actual-shipped-at { min-width: 118px; white-space: nowrap; }
.actual-shipped-at span, .actual-shipped-at small { display: block; }
.actual-shipped-at small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.package-photo { min-width: 86px; }
.package-photo-preview, .package-photo-empty { width: 50px; height: 50px; border-radius: 8px; }
.package-photo-preview { display: block; padding: 0; overflow: hidden; border: 1px solid var(--line); background: #f1f5f4; cursor: zoom-in; }
.package-photo-preview:hover { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.package-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.package-photo-empty { display: grid; place-items: center; color: var(--muted); background: #f1f5f4; font-size: 10px; }
.package-photo-upload { display: inline-block; margin-top: 5px; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 700; }
.package-photo-upload input { display: none; }
.yunexpress-cell { min-width: 118px; }
.yunexpress-action { min-height: 31px; padding: 0 9px; color: var(--green); border: 1px solid #b9d7d1; border-radius: 7px; background: var(--green-soft); cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.yunexpress-action:hover { color: white; border-color: var(--green); background: var(--green); }
.yunexpress-cell small { display: block; max-width: 118px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.yunexpress-cell small.error { color: var(--red); }
.yunexpress-cell small.tracking { color: var(--green); }
.yunexpress-label-select { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--muted); cursor: pointer; font-size: 9px; white-space: nowrap; }
.yunexpress-label-select input { width: 13px; height: 13px; margin: 0; accent-color: var(--green); }

.finance-toolbar { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: end; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.finance-toolbar label { min-width: 190px; color: var(--muted); font-size: 11px; font-weight: 700; }
.finance-toolbar input, .finance-toolbar select { height: 38px; margin: 5px 0 0; }
.finance-toolbar span { margin-left: auto; padding-bottom: 10px; color: var(--muted); font-size: 11px; }
.finance-stats-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.finance-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr); gap: 18px; }
.finance-summary-card, .finance-adjustment-card { padding: 20px; }
.finance-breakdown { margin: 0; }
.finance-breakdown div { padding: 10px 0; display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.finance-breakdown dt { color: var(--muted); font-size: 12px; }
.finance-breakdown dd { margin: 0; font-weight: 800; }
.compact-form { gap: 11px; }
.compact-form label { font-size: 11px; }
.compact-form input, .compact-form textarea { margin-top: 5px; }
.finance-orders-card .section-heading { padding: 18px 20px 10px; }
.finance-table { min-width: 1500px; }
.finance-table th:nth-child(3) { width: 25%; }
.finance-item + .finance-item { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.finance-item strong, .finance-item span { display: block; }
.finance-item strong { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.finance-item span, .finance-money-cell span, .finance-profit span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.finance-money-cell span, .finance-money-cell strong, .finance-profit strong, .finance-profit span { display: block; }
.finance-costs { min-width: 112px; }
.finance-cost-input { width: 104px; height: 31px; margin: 0; padding: 5px 7px; font-size: 11px; }
.finance-month-select { min-width: 138px; height: 31px; margin: 0; padding: 4px 7px; font-size: 10px; }
.finance-notes-cell { min-width: 230px; }
.finance-notes-input { width: 220px; min-height: 64px; margin: 0; padding: 7px 8px; resize: vertical; font-size: 11px; line-height: 1.4; }
.finance-adjustment-card input[readonly] { color: var(--green); background: var(--green-soft); font-weight: 800; }
.finance-profit strong { color: var(--green); font-size: 14px; }
.dashboard-toolbar { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: end; gap: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.dashboard-toolbar label { min-width: 190px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dashboard-toolbar select { height: 38px; margin: 5px 0 0; }
.dashboard-toolbar > span { margin-left: auto; padding-bottom: 10px; color: var(--muted); font-size: 11px; }
.dashboard-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-profit-card strong, .dashboard-profit-value { color: var(--green); }
.dashboard-profit-card strong.negative, .dashboard-profit-value.negative { color: var(--danger); }
.dashboard-grid { margin-bottom: 18px; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); gap: 18px; }
.dashboard-chart-card, .dashboard-cost-card, .dashboard-table-card { padding: 20px; }
.dashboard-legend { margin: -8px 0 8px; display: flex; justify-content: flex-end; gap: 16px; color: var(--muted); font-size: 11px; }
.dashboard-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dashboard-legend i { width: 9px; height: 9px; border-radius: 50%; }
.dashboard-legend .sales-dot { background: var(--orange); }
.dashboard-legend .profit-dot { background: var(--green); }
.dashboard-chart { min-height: 290px; }
.dashboard-chart svg { display: block; width: 100%; height: 290px; overflow: visible; }
.dashboard-chart text { fill: var(--muted); font-size: 10px; }
.dashboard-chart-axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
.dashboard-sales-line, .dashboard-profit-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.dashboard-sales-line { stroke: var(--orange); }
.dashboard-profit-line { stroke: var(--green); }
.dashboard-sales-point { fill: white; stroke: var(--orange); stroke-width: 2; }
.dashboard-profit-point { fill: white; stroke: var(--green); stroke-width: 2; }
.dashboard-chart-empty { height: 290px; display: grid; place-items: center; color: var(--muted); }
.dashboard-table-card { margin-bottom: 18px; }
.dashboard-table { min-width: 1040px; }
.dashboard-table td { white-space: nowrap; }
.dashboard-profit-value small { display: block; margin-top: 3px; color: var(--orange); font-size: 9px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(4, 25, 23, .58); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 22px; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; border-radius: 15px; background: white; box-shadow: var(--shadow); }
.generation-modal { width: min(920px, 100%); }
.yunexpress-modal { width: min(820px, 100%); }
.system-settings-card { max-width: 920px; padding: 0; overflow: hidden; }
.settings-tabs { display: flex; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #f7faf9; }
.settings-tabs button { padding: 9px 14px; color: var(--muted); border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 700; }
.settings-tabs button.active { color: var(--green); border-color: #b9d7d1; background: white; }
.settings-panel { padding: 4px 24px 24px; }
.settings-panel form { padding: 0; }
.settings-status { color: var(--green); font-size: 13px; font-weight: 700; }
.settings-connect-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.settings-connect-row select { margin: 0; }
.settings-list { display: grid; gap: 9px; }
.settings-list.compact { gap: 7px; }
.settings-list-item { min-height: 58px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf9; }
.settings-list-item strong, .settings-list-item span { display: block; }
.settings-list-item strong { font-size: 12px; }
.settings-list-item span, .settings-list-item small, .settings-empty { color: var(--muted); font-size: 10px; }
.settings-list-item small.error { color: var(--red); }
.etsy-shop-settings-info { min-width: 0; }
.etsy-shop-settings-info small { display: block; margin-top: 5px; }
.etsy-shop-settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.etsy-auth-status { font-weight: 700; white-space: nowrap; }
.etsy-auth-status.ready { color: var(--green); }
.etsy-auth-status.needs-auth { color: var(--orange); }
.etsy-shop-settings-actions .button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.settings-empty { padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 9px; }
.settings-summary-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.settings-summary-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf9; }
.settings-summary-grid span, .settings-summary-grid strong { display: block; }
.settings-summary-grid span { color: var(--muted); font-size: 10px; }
.settings-summary-grid strong { margin-top: 5px; font-size: 13px; }
.settings-reference-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-reference-grid h3 { margin-bottom: 10px; font-size: 13px; }
.modal-header { position: sticky; top: 0; z-index: 2; padding: 20px 24px 17px; display: flex; justify-content: space-between; align-items: start; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.modal-subtitle { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal form { padding: 22px 24px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-grid .wide { grid-column: 1 / -1; }
label { color: #4f6663; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; color: var(--ink); background: white; border: 1px solid #cedbd8; border-radius: 8px; outline: 0; padding: 9px 10px; margin-top: 7px; font-weight: 400; }
input, select { height: 40px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #6aa99e; box-shadow: 0 0 0 3px var(--green-soft); }
.image-url-preview { min-height: 54px; margin-top: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.image-url-preview img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #f1f5f4; }
.image-url-preview small { color: var(--muted); font-weight: 500; }
.image-url-preview small.success { color: var(--green); }
.image-url-preview small.error { color: var(--red); }
.section-heading { margin: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-heading p { color: var(--muted); font-size: 11px; margin-bottom: 0; }
.variant-card { background: #f7faf9; border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 10px; }
.variant-top { display: grid; grid-template-columns: 1.3fr 1fr 36px; gap: 10px; align-items: end; }
.variant-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.variant-preview { margin-top: 12px; border-top: 1px dashed #cbd9d6; padding-top: 10px; display: flex; gap: 18px; flex-wrap: wrap; }
.variant-preview span { color: var(--muted); font-size: 10px; }
.variant-preview strong { color: var(--green); font-size: 12px; margin-left: 4px; }
.modal-actions { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.formula-box { padding: 12px 14px; margin-bottom: 18px; color: var(--green-dark); background: var(--green-soft); border-radius: 9px; font-size: 12px; line-height: 1.6; }
.form-section-title { margin: 22px 0 12px; color: var(--ink); font-size: 14px; }
.form-section-title:first-of-type { margin-top: 0; }
.yunexpress-notice, .yunexpress-ioss, .yunexpress-result { margin-bottom: 16px; padding: 11px 13px; color: var(--green-dark); border: 1px solid #b9d7d1; border-radius: 9px; background: var(--green-soft); font-size: 11px; line-height: 1.5; }
.yunexpress-ioss, .yunexpress-result { margin: 18px 0 0; }
.yunexpress-notice.error, .yunexpress-ioss.error, .yunexpress-result.error { color: var(--red); border-color: #efcaca; background: #fff3f3; }
.yunexpress-result-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.yunexpress-result-row > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.yunexpress-result-row small { color: var(--muted); font-size: 9px; }
.yunexpress-result-row strong { overflow-wrap: anywhere; font-size: 11px; }
.copy-inline { min-height: 26px; padding: 0 8px; color: var(--green); border: 1px solid #b9d7d1; border-radius: 6px; background: white; cursor: pointer; font-size: 9px; font-weight: 800; white-space: nowrap; }
.copy-inline:hover { color: white; border-color: var(--green); background: var(--green); }
.copy-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.copy-input .copy-inline { min-height: 37px; }
.yunexpress-tracking { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfa; }
.yunexpress-tracking-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.yunexpress-tracking-header h3 { margin: 0; font-size: 14px; }
.yunexpress-tracking-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.yunexpress-tracking-actions { display: flex; align-items: center; gap: 9px; }
.yunexpress-tracking-status { padding: 5px 9px; color: var(--green-dark); border-radius: 999px; background: var(--green-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.yunexpress-tracking-error { margin-top: 12px; padding: 9px 11px; color: var(--red); border-radius: 8px; background: #fff0f0; font-size: 10px; line-height: 1.5; }
.yunexpress-tracking-error.is-warning { color: #925b0d; background: #fff4df; }
.yunexpress-tracking-events { margin: 15px 0 0; padding: 0; list-style: none; }
.yunexpress-tracking-events li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 0 0 15px; }
.yunexpress-tracking-events li:not(:last-child)::before { position: absolute; top: 11px; bottom: -1px; left: 5px; width: 1px; background: #c7d9d5; content: ''; }
.yunexpress-tracking-events li.empty { display: block; padding: 4px 0 0; color: var(--muted); font-size: 11px; }
.yunexpress-tracking-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px #9fc5bd; }
.yunexpress-tracking-events time, .yunexpress-tracking-events strong, .yunexpress-tracking-events small { display: block; }
.yunexpress-tracking-events time { color: var(--muted); font-size: 9px; }
.yunexpress-tracking-events strong { margin-top: 3px; color: var(--ink); font-size: 11px; line-height: 1.45; }
.yunexpress-tracking-events small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.yunexpress-tracking-events em { display: inline-block; margin-top: 5px; padding: 2px 5px; color: var(--green-dark); border-radius: 4px; background: var(--green-soft); font-size: 8px; font-style: normal; }
.etsy-complete { margin-top: 18px; padding: 15px; border: 1px solid #b9d7d1; border-radius: 10px; background: #f7fbfa; }
.etsy-complete-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.etsy-complete-header h3 { margin: 0; font-size: 14px; }
.etsy-complete-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.etsy-complete-status { padding: 5px 9px; color: var(--green-dark); border-radius: 999px; background: var(--green-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.etsy-complete-fields { margin-top: 15px; }
.etsy-complete-message { margin-top: 13px; padding: 9px 11px; color: var(--green-dark); border-radius: 8px; background: var(--green-soft); font-size: 10px; line-height: 1.5; }
.etsy-complete-message.error { color: var(--red); background: #fff0f0; }
.etsy-complete-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.generation-body { padding: 20px 24px 24px; }
.generation-body form { padding: 0; }
.worker-state { min-height: 58px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 11px; background: #f7faf9; }
.worker-state-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #c5cfcd; box-shadow: 0 0 0 5px rgba(197,207,205,.22); }
.worker-state strong, .worker-state small { display: block; }
.worker-state strong { font-size: 13px; }
.worker-state small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.worker-state.checking .worker-state-dot { background: #d49b4c; box-shadow: 0 0 0 5px rgba(212,155,76,.15); }
.worker-state.connected { color: var(--green-dark); border-color: #b9d7d1; background: var(--green-soft); }
.worker-state.connected .worker-state-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(11,107,94,.13); }
.worker-state.disconnected { color: var(--red); border-color: #efcaca; background: #fff3f3; }
.worker-state.disconnected .worker-state-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(183,71,71,.12); }
.generation-plan { margin-top: 16px; padding: 12px 14px; color: var(--green-dark); border-radius: 9px; background: var(--green-soft); font-size: 12px; line-height: 1.6; }
.generation-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.generation-progress-heading strong, .generation-progress-heading small { display: block; }
.generation-progress-heading strong { font-size: 16px; }
.generation-progress-heading small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.generation-progress-actions { display: flex; align-items: center; gap: 8px; }
.progress-track { height: 8px; margin: 14px 0 18px; overflow: hidden; border-radius: 999px; background: #e7eeec; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.generation-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.generation-task { min-width: 0; padding: 10px; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.generation-task.running { border-color: #ddc28e; background: #fff9ee; }
.generation-task.completed { border-color: #b9d7d1; background: #f3faf7; }
.generation-task.failed { border-color: #efcaca; background: #fff5f5; }
.generation-task-visual { width: 78px; height: 78px; margin: 0; padding: 0; overflow: hidden; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: #e9f0ee; font-size: 11px; }
button.generation-task-visual { cursor: zoom-in; }
.generation-task-visual img { width: 100%; height: 100%; display: block; object-fit: cover; }
.generation-task strong, .generation-task span, .generation-task small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generation-task strong { font-size: 13px; }
.generation-task span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.generation-task small { margin-top: 6px; color: var(--green); font-size: 10px; }
.generation-task.failed small { color: var(--red); }
.generation-task.cancelled small, .generation-task.cancelling small { color: var(--muted); }
.generation-task-actions { min-width: 58px; text-align: right; }
.generation-task-button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: white; cursor: pointer; font-size: 10px; font-weight: 800; white-space: nowrap; }
.generation-task-button:hover { border-color: var(--green); background: var(--green-soft); }
.generation-task-button.stop { color: var(--red); }
.generation-task-button.stop:hover { border-color: var(--red); background: #fff1f1; }
.generation-task-button:disabled { opacity: .55; cursor: default; }
.toast { position: fixed; z-index: 40; right: 24px; bottom: 24px; min-width: 220px; max-width: 380px; background: #102e2b; color: white; padding: 13px 16px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #8f3434; }
.image-backdrop { background: rgba(4, 20, 18, .82); }
.image-lightbox { position: relative; width: min(920px, 92vw); max-height: 90vh; display: grid; justify-items: center; gap: 12px; }
.image-lightbox img { display: block; max-width: 100%; max-height: calc(90vh - 54px); object-fit: contain; border-radius: 12px; box-shadow: var(--shadow); }
.image-lightbox p { margin: 0; color: white; font-size: 13px; }
.image-close { position: absolute; z-index: 2; top: -16px; right: -16px; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; color: white; background: rgba(8,31,28,.82); cursor: pointer; font-size: 25px; line-height: 1; }
.image-close:hover { background: var(--orange); }

/* Competitor analysis */
.competitor-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.competitor-start-card { margin-bottom: 20px; }
.competitor-start-form { padding: 18px 18px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.competitor-start-form label { min-width: 0; }
.competitor-start-card > p { padding: 0 18px 18px; }
.competitor-hot-launch { position: relative; padding: 22px; overflow: hidden; background: linear-gradient(135deg, #fff 0%, #f7fbf9 62%, #edf7f3 100%); }
.competitor-hot-launch::after { content: ""; position: absolute; top: -70px; right: -45px; width: 190px; height: 190px; border-radius: 50%; background: rgba(11, 107, 94, .055); pointer-events: none; }
.competitor-hot-launch-copy { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.competitor-hot-launch-copy h3 { margin: 0 0 4px; font-size: 18px; }
.competitor-hot-launch-copy p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.competitor-hot-launch-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--green); box-shadow: 0 8px 18px rgba(11, 107, 94, .22); font-size: 22px; font-weight: 800; }
.competitor-hot-start-form { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(220px, 1fr) 112px 174px 142px; gap: 12px; align-items: end; margin-top: 18px; }
.competitor-hot-start-form label { min-width: 0; }
.competitor-hot-start-form input { height: 44px; margin-top: 6px; border-radius: 10px; background: rgba(255,255,255,.92); }
.competitor-hot-start-form input:focus { border-color: #68a99f; box-shadow: 0 0 0 3px rgba(11,107,94,.1); }
.competitor-hot-submit { min-height: 44px; gap: 5px; border-radius: 10px; }
.competitor-hot-submit span { font-size: 17px; line-height: 1; }
.competitor-hot-rules { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.competitor-hot-rules span { padding: 5px 9px; border: 1px solid #d7e8e3; border-radius: 999px; color: #56716d; background: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.competitor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.competitor-runs-card { position: sticky; top: 24px; padding: 18px; }
.competitor-runs-card .section-heading { margin: 0 0 12px; }
.competitor-runs { display: grid; gap: 10px; }
.competitor-run-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.competitor-run { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.competitor-run:hover,
.competitor-run.active { border-color: var(--green); background: var(--green-soft); }
.competitor-run strong,
.competitor-run span,
.competitor-run small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.competitor-run span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.competitor-run small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.competitor-run .competitor-run-report-ready { margin-top: 6px; color: var(--green); font-weight: 800; }
.competitor-run-delete { align-self: stretch; padding: 0 10px; border: 1px solid #efc7c3; border-radius: 12px; background: #fff7f6; color: #b5473e; cursor: pointer; }
.competitor-run-delete:hover { border-color: #b5473e; background: #fff0ee; }
.competitor-analysis-notice { display: grid; gap: 4px; margin: 14px 0; padding: 13px 15px; border: 1px solid #b7dbd2; border-radius: 13px; background: var(--green-soft); color: var(--green); }
.competitor-analysis-notice span { color: var(--muted); font-size: 13px; }
.competitor-analysis-notice.error { border-color: #efc7c3; background: #fff0ee; color: #b5473e; }
.competitor-detail { min-width: 0; }
.competitor-detail > .content-card { margin-bottom: 20px; padding: 20px; }
.competitor-detail > .content-card:last-child { margin-bottom: 0; }
.competitor-detail .section-heading { margin: 0 0 16px; }
.competitor-empty { min-height: 220px; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); }
.competitor-empty strong { color: var(--ink); font-size: 20px; }
.competitor-section { margin-bottom: 20px; }
.competitor-section:last-child { margin-bottom: 0; }
.competitor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.competitor-heading h2,
.competitor-heading h3 { margin: 0; }
.competitor-heading p { margin: 5px 0 0; color: var(--muted); }
.competitor-progress-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.competitor-progress-grid article { padding: 14px; border-radius: 14px; background: var(--green-soft); }
.competitor-progress-grid article strong,
.competitor-progress-grid article span,
.competitor-progress-grid article small { display: block; }
.competitor-progress-grid article strong { margin-top: 5px; font-size: 22px; }
.competitor-progress-grid article span,
.competitor-progress-grid article small { color: var(--muted); font-size: 12px; }
.competitor-progress { height: 6px; margin: 10px 0 7px; overflow: hidden; border-radius: 999px; background: #cfe4de; }
.competitor-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.competitor-shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.competitor-shop-grid article { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.competitor-shop-grid span,
.competitor-shop-grid strong { display: block; }
.competitor-shop-grid span { color: var(--muted); font-size: 12px; }
.competitor-shop-grid strong { margin-top: 5px; font-size: 18px; }
.competitor-table-wrap { overflow-x: auto; }
.competitor-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.competitor-table th,
.competitor-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.competitor-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.competitor-table a { color: var(--green); font-weight: 700; text-decoration: none; }
.competitor-table a:hover { text-decoration: underline; }
.competitor-review-text { max-width: 520px; white-space: normal; overflow-wrap: anywhere; }
.competitor-meta { color: var(--muted); font-size: 13px; }
.competitor-status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.competitor-report { margin: 0; max-height: 720px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font: 13px/1.75 inherit; }
.competitor-hot-table { min-width: 940px; }
.competitor-hot-rank-column { width: 64px; }
.competitor-hot-price-column { width: 170px; }
.competitor-hot-demand-column { width: 250px; }
.competitor-hot-position-column { width: 150px; }
.competitor-hot-table th,
.competitor-hot-table td { padding: 14px 12px; }
.competitor-hot-table th:first-child,
.competitor-hot-table td:first-child { padding-right: 8px; padding-left: 4px; text-align: center; }
.competitor-hot-table td:last-child { white-space: nowrap; }
.competitor-hot-rank span { display: inline-grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; }
.competitor-hot-product { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: start; }
.competitor-hot-product > div { min-width: 0; }
.competitor-hot-image { width: 88px; height: 72px; padding: 0; overflow: hidden; border: 1px solid transparent; border-radius: 10px; background: var(--green-soft); cursor: zoom-in; }
.competitor-hot-image:hover,
.competitor-hot-image:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); outline: none; }
.competitor-hot-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.competitor-hot-product a { display: -webkit-box; overflow: hidden; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.competitor-hot-product strong,
.competitor-hot-product span { display: block; }
.competitor-hot-product span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.competitor-price-current,
.competitor-price-detail { display: block; }
.competitor-price-current { color: var(--ink); font-size: 16px; font-weight: 800; white-space: nowrap; }
.competitor-price-detail { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.competitor-price-empty { color: var(--muted); }
.competitor-demand-count { color: var(--green); font-size: 18px; font-weight: 800; white-space: nowrap; }
.competitor-selection-report { background: linear-gradient(145deg, #fff 0%, #f7fbf9 100%); }
.competitor-selection-summary { margin-bottom: 16px; padding: 15px 17px; border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; background: var(--green-soft); color: var(--ink); font-size: 14px; line-height: 1.7; }
.competitor-selection-trends { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.competitor-selection-trends article { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.competitor-selection-trends article > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.competitor-selection-trends strong,
.competitor-selection-trends small { display: block; overflow-wrap: anywhere; }
.competitor-selection-trends strong { margin-top: 7px; color: var(--green); font-size: 13px; }
.competitor-selection-trends small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.competitor-selection-directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.competitor-selection-directions article { padding: 15px; border: 1px solid #cfe4de; border-radius: 14px; background: #fff; }
.competitor-selection-directions span { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.competitor-selection-directions strong,
.competitor-selection-directions small { display: block; }
.competitor-selection-directions strong { margin-top: 9px; font-size: 15px; }
.competitor-selection-directions small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.competitor-selection-directions p { margin: 8px 0; color: var(--ink); font-size: 12px; line-height: 1.6; }
.competitor-selection-directions div { display: flex; flex-wrap: wrap; gap: 5px; }
.competitor-selection-directions em { padding: 3px 7px; border-radius: 999px; color: #5a6f6b; background: #f1f6f4; font-size: 10px; font-style: normal; }
.competitor-selection-full-report { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.competitor-selection-full-report summary { color: var(--green); cursor: pointer; font-size: 12px; font-weight: 800; }
.competitor-selection-full-report .competitor-report { margin-top: 14px; padding: 16px; border-radius: 12px; background: #f7faf9; }

.login-page { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at top right, var(--green-soft), var(--canvas) 45%); }
.login-card { width: min(420px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { font-size: 27px; }
.login-copy { margin: 10px 0 24px; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 16px; }
.login-card .button { width: 100%; margin-top: 4px; }
.login-error { margin: 0; padding: 10px 12px; color: var(--red); background: #fff0f0; border-radius: 8px; font-size: 12px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 78px minmax(0,1fr); }
  .sidebar { padding: 24px 12px; }
  .brand { padding-inline: 6px; justify-content: center; }
  .brand > div:last-child, .nav-item:not(.active) span + * { display: none; }
  .nav-item { justify-content: center; font-size: 0; }
  .nav-item span { font-size: 17px; }
  main { padding: 30px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-wrap { max-width: none; }
  .catalog-filters { justify-content: flex-start; }
  .finance-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .competitor-layout { grid-template-columns: 1fr; }
  .competitor-runs-card { position: static; }
  .competitor-progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competitor-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competitor-hot-start-form { grid-template-columns: minmax(180px, 1fr) 104px 160px 132px; }
  .competitor-selection-trends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .competitor-hot-start-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competitor-hot-keyword-field,
  .competitor-hot-submit { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .etsy-shop-settings-item { align-items: flex-start; }
  .etsy-shop-settings-actions { align-items: flex-end; flex-direction: column; gap: 7px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  main { padding: 22px 14px 36px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions .button { flex: 1; }
  .top-actions { flex-wrap: wrap; }
  .top-actions .compact-select { width: 100%; max-width: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 22px; }
  .catalog-filters { align-items: stretch; flex-direction: column; }
  .finance-toolbar { align-items: stretch; flex-direction: column; }
  .finance-toolbar label { min-width: 0; }
  .finance-toolbar span { margin-left: 0; padding-bottom: 0; }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-toolbar label { min-width: 0; }
  .dashboard-toolbar > span { margin-left: 0; padding-bottom: 0; }
  .dashboard-stats-grid { grid-template-columns: 1fr 1fr; }
  .competitor-start-form { grid-template-columns: 1fr; }
  .competitor-hot-start-form { grid-template-columns: 1fr; }
  .competitor-start-form .button { width: 100%; }
  .competitor-hot-start-form .button { width: 100%; }
  .competitor-hot-launch { padding: 18px; }
  .competitor-hot-launch-copy { align-items: flex-start; }
  .competitor-hot-launch-icon { width: 38px; height: 38px; }
  .competitor-heading { flex-direction: column; }
  .competitor-progress-grid { grid-template-columns: 1fr 1fr; }
  .competitor-shop-grid { grid-template-columns: 1fr 1fr; }
  .competitor-selection-trends,
  .competitor-selection-directions { grid-template-columns: 1fr; }
  .compact-select { width: 100%; max-width: none; }
  .filter-group { overflow-x: auto; }
  .form-grid, .variant-numbers, .variant-top { grid-template-columns: 1fr; }
  .settings-tabs { overflow-x: auto; }
  .settings-tabs button { white-space: nowrap; }
  .settings-connect-row, .settings-reference-grid { grid-template-columns: 1fr; }
  .settings-summary-grid { grid-template-columns: 1fr 1fr; }
  .generation-task-grid { grid-template-columns: 1fr; }
  .generation-progress-heading { align-items: flex-start; }
  .generation-progress-actions { flex-direction: column; align-items: stretch; }
  .variant-top .icon-button { position: absolute; right: 36px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 15px 15px 0 0; }
  .table-footer { gap: 10px; flex-direction: column; }
  .pagination { flex-wrap: wrap; }
}
