:root {
  --bg: #f5f1ff;
  --surface: #ffffff;
  --surface-soft: #fbf9ff;
  --text: #291851;
  --muted: #6f6095;
  --faint: #9b8abc;
  --purple: #7c4dff;
  --purple-2: #9c7bff;
  --purple-soft: #f2edff;
  --border: rgba(124, 77, 255, 0.14);
  --border-strong: rgba(124, 77, 255, 0.24);
  --shadow: 0 24px 68px rgba(71, 39, 151, 0.14);
  --shadow-soft: 0 14px 34px rgba(71, 39, 151, 0.09);
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font: Tahoma, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  direction: rtl;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 50% 8%, rgba(156, 123, 255, 0.20), transparent 22rem),
    radial-gradient(circle at 8% 92%, rgba(124, 77, 255, 0.14), transparent 20rem),
    linear-gradient(180deg, #fefcff 0%, #f4efff 100%);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.page-shell {
  width: min(calc(100% - 24px), 450px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 28px;
}
.app {
  min-height: calc(100vh - 46px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.app-header {
  position: relative;
  min-height: 166px;
  padding: 20px 18px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 22% 8%, rgba(255,255,255,.24), transparent 9rem),
    linear-gradient(135deg, #a184ff 0%, #7c4dff 55%, #6940de 100%);
}
.app-header::after {
  content: "";
  position: absolute;
  right: -10%; left: -10%; bottom: -26px;
  height: 58px;
  border-radius: 50% 50% 0 0;
  background: rgba(255,255,255,0.98);
}
.header-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark, .back-button, .home-link {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 16px;
  background: rgba(255,255,255,.17);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-mark { min-width: 48px; height: 48px; border-radius: 18px; font-size: 22px; font-weight: 900; }
.brand-text { display: grid; gap: 3px; }
.brand-text strong { font-size: 14px; font-weight: 900; }
.brand-text span { color: rgba(255,255,255,.84); font-size: 11px; line-height: 1.6; }
.back-button { font-size: 24px; font-weight: 900; }
.home-link { min-width: auto; padding: 0 14px; font-size: 12px; font-weight: 900; }
.header-copy { position: relative; z-index: 1; margin-top: 18px; }
.eyebrow { margin: 0 0 7px; color: rgba(255,255,255,.86); font-size: 12px; font-weight: 900; }
.page-title { margin: 0; font-size: 24px; line-height: 1.7; font-weight: 900; letter-spacing: -.02em; }
.page-subtitle { margin: 4px 0 0; max-width: 350px; color: rgba(255,255,255,.88); font-size: 13px; line-height: 1.95; }
.app-content { position: relative; z-index: 1; padding: 14px 14px 20px; }
.section-title { margin: 0 0 12px; font-size: 16px; line-height: 1.8; font-weight: 900; }
.section-grid, .category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.section-card, .category-card, .device-card, .error-card, .preview-card, .detail-hero, .detail-block, .search-panel, .empty-state, .placeholder-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #fbf9ff);
  box-shadow: var(--shadow-soft);
}
.section-card, .category-card {
  display: block;
  min-height: 214px;
  padding: 10px;
  overflow: hidden;
  border-radius: 20px;
  text-align: center;
  transition: transform .2s ease, border-color .2s ease;
}
.section-card:hover, .category-card:hover, .device-card:hover, .error-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.section-card.is-pending { opacity: .86; }
.card-media-square, .category-media {
  display: grid;
  place-items: center;
  height: 110px;
  margin: 0 0 8px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f4efff);
}
.card-media-square img, .category-media img, .card-media img, .preview-media img, .detail-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.section-card h2, .category-card h2 { margin: 0; font-size: 14px; line-height: 1.8; font-weight: 900; }
.section-card p, .category-card p { margin: 3px 0 0; min-height: 40px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.section-card .badge-row, .category-card .badge-row { justify-content: center; }
.badge-row.compact { margin-top: 0; }
.pill, .code-badge, .severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(124,77,255,.13);
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
}
.code-badge { direction: ltr; letter-spacing: .04em; }
.severity.low { color: #6b53c8; background: #f2edff; }
.severity.medium { color: #5e3bc2; background: #e9e0ff; }
.severity.high { color: #5730bc; background: #ddceff; }
.severity.critical { color: #fff; background: linear-gradient(135deg, #916fff, #7045ef); }
.info-callout {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #faf7ff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.95;
}
.preview-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 14px; padding: 10px; border-radius: 22px; }
.preview-media { display: grid; place-items: center; width: 104px; height: 88px; overflow: hidden; border-radius: 16px; background: linear-gradient(180deg, #fff, #f4efff); }
.preview-copy h2 { margin: 0; font-size: 15px; line-height: 1.8; font-weight: 900; }
.preview-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.device-list, .error-list, .detail-grid { display: grid; gap: 12px; }
.device-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) 24px; gap: 11px; align-items: center; min-height: 118px; padding: 10px; border-radius: 22px; transition: transform .2s ease, border-color .2s ease; }
.card-media { display: grid; place-items: center; width: 112px; height: 96px; overflow: hidden; margin: 0; border-radius: 17px; background: linear-gradient(180deg, #fff, #f4efff); }
.card-copy h2, .error-copy h2 { margin: 0; font-size: 14px; line-height: 1.8; font-weight: 900; }
.card-copy p, .error-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.card-chevron { color: #9a86d5; font-size: 26px; font-weight: 900; }
.search-panel { margin-bottom: 12px; padding: 10px; border-radius: 20px; }
.search-wrap { position: relative; }
.search-input { width: 100%; height: 50px; padding: 0 46px 0 14px; border: 1px solid rgba(124,77,255,.16); border-radius: 16px; outline: none; background: #fff; color: var(--text); font-size: 13px; font-weight: 700; }
.search-input::placeholder { color: #9b8cbf; }
.search-input:focus { border-color: rgba(124,77,255,.34); box-shadow: 0 0 0 4px rgba(124,77,255,.08); }
.search-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--purple); font-size: 18px; font-weight: 900; }
.error-card { display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; gap: 10px; min-height: 100px; padding: 12px; border-radius: 20px; transition: transform .2s ease, border-color .2s ease; }
.empty-state { display: none; padding: 20px 14px; border-radius: 20px; text-align: center; }
.empty-state.visible { display: block; }
.empty-state h3 { margin: 0; font-size: 14px; line-height: 1.8; font-weight: 900; }
.empty-state p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.detail-hero, .detail-block { padding: 13px; border-radius: 22px; }
.detail-media { display: grid; place-items: center; height: 184px; overflow: hidden; margin: 0 0 12px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f4efff); }
.detail-hero h2 { margin: 12px 0 0; font-size: 20px; line-height: 1.8; font-weight: 900; }
.detail-hero p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 2; }
.summary-box { margin-top: 12px; padding: 11px; border: 1px solid var(--border); border-radius: 16px; background: #faf7ff; }
.summary-box strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 12px; font-weight: 900; }
.summary-box span { color: var(--muted); font-size: 12px; line-height: 1.8; }
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: 16px; font-weight: 900; }
.block-title { margin: 0; font-size: 15px; line-height: 1.8; font-weight: 900; }
.detail-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.detail-item { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid rgba(124,77,255,.10); border-radius: 16px; background: #fcfbff; color: var(--muted); font-size: 12px; line-height: 1.95; }
.detail-number { display: inline-grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 50%; color: #fff; background: var(--purple); font-size: 10px; font-weight: 900; }
.note-bar { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 11px; border: 1px solid var(--border); border-radius: 16px; background: #faf7ff; }
.note-dot { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 12px; color: #fff; background: var(--purple); font-size: 12px; font-weight: 900; }
.note-bar strong { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 900; }
.note-bar p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.placeholder-card { padding: 18px; border-radius: 22px; text-align: center; }
.placeholder-card figure { height: 190px; margin: 0 0 12px; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #fff, #f4efff); }
.placeholder-card figure img { width: 100%; height: 100%; object-fit: contain; }
.placeholder-card h2 { margin: 0; font-size: 18px; line-height: 1.8; font-weight: 900; }
.placeholder-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 2; }
.action-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 14px; padding: 0 16px; border-radius: 999px; background: linear-gradient(135deg, var(--purple-2), var(--purple)); color: #fff; font-size: 13px; font-weight: 900; }
@media (max-width: 370px) {
  .page-shell { width: min(calc(100% - 16px), 450px); }
  .app-content { padding-inline: 10px; }
  .section-grid, .category-grid { gap: 9px; }
  .section-card, .category-card { min-height: 202px; }
  .device-card { grid-template-columns: 96px minmax(0, 1fr) 18px; }
  .card-media { width: 96px; height: 88px; }
  .preview-card { grid-template-columns: 90px minmax(0, 1fr); }
  .preview-media { width: 90px; }
}
@media (min-width: 768px) { body { display: grid; place-items: center; } .page-shell { padding: 28px 0; } }
