.isgp-app {
  --isgp-bg: #f7f7fb;
  --isgp-panel: #ffffff;
  --isgp-text: #172033;
  --isgp-muted: #657084;
  --isgp-border: #e4e7ef;
  --isgp-primary: #1d4ed8;
  --isgp-primary-dark: #123a9c;
  --isgp-success: #0f766e;
  --isgp-danger: #b91c1c;
  --isgp-shadow: 0 24px 70px rgba(18, 24, 40, 0.10);
  color: var(--isgp-text);
  background: linear-gradient(135deg, #f8fbff 0%, #f4f7fb 52%, #eef7f4 100%);
  border: 1px solid var(--isgp-border);
  border-radius: 28px;
  padding: clamp(18px, 3vw, 34px);
  margin: 24px 0;
  box-shadow: var(--isgp-shadow);
  font-family: inherit;
}

.isgp-app *, .isgp-app *::before, .isgp-app *::after { box-sizing: border-box; }

.isgp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 330px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.isgp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--isgp-primary);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}

.isgp-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.isgp-hero p { margin: 0; color: var(--isgp-muted); font-size: 17px; max-width: 760px; }

.isgp-hero-card {
  background: #111827;
  color: #fff;
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  position: relative;
  overflow: hidden;
}

.isgp-hero-card::before {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  top: -60px;
  inset-inline-end: -50px;
}

.isgp-hero-card strong { font-size: 22px; margin-bottom: 8px; position: relative; }
.isgp-hero-card span { opacity: .82; position: relative; }

.isgp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .75fr);
  gap: 22px;
  align-items: start;
}

.isgp-panel {
  background: var(--isgp-panel);
  border: 1px solid var(--isgp-border);
  border-radius: 24px;
  padding: clamp(16px, 2.6vw, 24px);
  box-shadow: 0 12px 40px rgba(18, 24, 40, 0.06);
}

.isgp-panel-head, .isgp-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.isgp-panel h3, .isgp-panel h4 { margin: 0; }
.isgp-panel p { color: var(--isgp-muted); margin: 6px 0 0; }

.isgp-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.isgp-app input[type="search"],
.isgp-app input[type="text"],
.isgp-app input[type="number"],
.isgp-app select {
  width: 100%;
  border: 1px solid var(--isgp-border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 44px;
  color: var(--isgp-text);
  font: inherit;
}

.isgp-app input:focus,
.isgp-app select:focus {
  outline: 3px solid rgba(29,78,216,.14);
  border-color: rgba(29,78,216,.45);
}

.isgp-primary, .isgp-secondary, .isgp-link-button, .isgp-template-row button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.isgp-primary {
  background: var(--isgp-primary);
  color: #fff;
  box-shadow: 0 10px 25px rgba(29,78,216,.22);
}

.isgp-primary:hover { background: var(--isgp-primary-dark); transform: translateY(-1px); }

.isgp-secondary, .isgp-template-row button, .isgp-link-button {
  background: #eef2ff;
  color: var(--isgp-primary);
}

.isgp-wide { width: 100%; margin-top: 12px; }

.isgp-suggestions {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.isgp-suggestions button {
  width: 100%;
  border: 1px solid var(--isgp-border);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  text-align: start;
  align-items: center;
  cursor: pointer;
}

.isgp-suggestions button:hover { border-color: rgba(29,78,216,.45); box-shadow: 0 8px 25px rgba(18,24,40,.07); }
.isgp-suggestions small { color: var(--isgp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isgp-suggestions em { font-size: 11px; color: #7c3aed; background: #f3e8ff; border-radius: 999px; padding: 2px 6px; font-style: normal; }

.isgp-template-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.isgp-template-row button { padding: 9px 12px; font-size: 13px; }

.isgp-list { display: grid; gap: 10px; }
.isgp-list-summary { color: var(--isgp-muted); font-size: 14px; margin-bottom: 2px; }
.isgp-empty { padding: 26px; border: 1px dashed var(--isgp-border); border-radius: 18px; color: var(--isgp-muted); text-align: center; }

.isgp-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(170px, 230px);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--isgp-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.isgp-item.isgp-done { opacity: .62; }
.isgp-item.isgp-done .isgp-item-main strong { text-decoration: line-through; }

.isgp-check { position: relative; margin-top: 3px; }
.isgp-check input { position: absolute; opacity: 0; pointer-events: none; }
.isgp-check span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: #fff;
}
.isgp-check input:checked + span { background: var(--isgp-success); border-color: var(--isgp-success); }
.isgp-check input:checked + span::after { content: '✓'; color: #fff; display: block; text-align: center; line-height: 20px; font-weight: 900; }

.isgp-item-main { min-width: 0; }
.isgp-item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isgp-item-main small { display: block; color: var(--isgp-muted); margin: 2px 0 8px; }
.isgp-item-main input { min-height: 38px; padding: 9px 11px; }

.isgp-item-controls { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; }
.isgp-item-controls input, .isgp-item-controls select { min-height: 38px; padding: 8px; }
.isgp-item-controls button { width: 38px; height: 38px; border-radius: 12px; border: 0; background: #fee2e2; color: var(--isgp-danger); font-size: 22px; cursor: pointer; }

.isgp-compare label { display: block; margin: 14px 0 6px; font-weight: 800; }
.isgp-options { display: grid; gap: 9px; margin: 14px 0; color: var(--isgp-muted); }
.isgp-options label { font-weight: 500; margin: 0; display: flex; gap: 8px; align-items: flex-start; }

.isgp-status { min-height: 22px; margin-top: 12px; color: var(--isgp-muted); }
.isgp-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #cbd5e1; border-top-color: var(--isgp-primary); border-radius: 50%; animation: isgp-spin 1s linear infinite; vertical-align: -3px; margin-inline-end: 6px; }
@keyframes isgp-spin { to { transform: rotate(360deg); } }

.isgp-results { display: grid; gap: 12px; margin-top: 12px; }
.isgp-best-card {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fff;
  border-radius: 20px;
  padding: 18px;
  display: grid;
  gap: 6px;
}
.isgp-best-card span, .isgp-best-card small { opacity: .82; }
.isgp-best-card h4 { font-size: 18px; }
.isgp-best-card strong { font-size: 34px; line-height: 1; }

.isgp-alert { padding: 12px 14px; border-radius: 16px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

.isgp-split {
  padding: 14px;
  border: 1px solid #ccfbf1;
  background: #f0fdfa;
  border-radius: 18px;
}
.isgp-good, .isgp-muted-pill { border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.isgp-good { background: #ccfbf1; color: #115e59; }
.isgp-muted-pill { background: #eef2ff; color: #3730a3; }
.isgp-split-group { border-top: 1px solid rgba(15,118,110,.16); padding-top: 10px; margin-top: 10px; display: grid; gap: 6px; }
.isgp-split-group > span { color: var(--isgp-success); font-weight: 900; }
.isgp-split ul, .isgp-store-card ul { margin: 6px 0 0; padding-inline-start: 20px; }
.isgp-split li, .isgp-store-card li { margin: 4px 0; }

.isgp-store-list { display: grid; gap: 10px; }
.isgp-store-card {
  border: 1px solid var(--isgp-border);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.isgp-store-card summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
}
.isgp-store-card summary span { font-weight: 900; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.isgp-store-card summary strong { color: var(--isgp-primary); font-size: 18px; }
.isgp-store-card summary small { grid-column: 1 / -1; color: var(--isgp-muted); }
.isgp-store-card ul { padding: 0 18px 14px 34px; }
.isgp-store-card li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.isgp-store-card li small { grid-column: 1 / -1; color: var(--isgp-muted); }

.isgp-muted { color: var(--isgp-muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .isgp-hero, .isgp-grid { grid-template-columns: 1fr; }
  .isgp-item { grid-template-columns: auto minmax(0, 1fr); }
  .isgp-item-controls { grid-column: 2; grid-template-columns: 80px minmax(90px, 1fr) auto; }
}

@media (max-width: 560px) {
  .isgp-app { border-radius: 20px; padding: 14px; }
  .isgp-search-row { grid-template-columns: 1fr; }
  .isgp-suggestions button { grid-template-columns: 1fr; }
  .isgp-item { grid-template-columns: 1fr; }
  .isgp-check { display: none; }
  .isgp-item-controls { grid-column: 1; grid-template-columns: 1fr 1fr auto; }
}

@media print {
  .isgp-app { box-shadow: none; border: 0; background: #fff; }
  .isgp-compare, .isgp-search-row, .isgp-suggestions, .isgp-template-row, .isgp-link-button { display: none !important; }
  .isgp-grid { display: block; }
  .isgp-panel { border: 0; box-shadow: none; }
}
