:root {
  --navy: #082f49;
  --teal: #0f766e;
  --orange: #f59e0b;
  --paper: #ffffff;
  --line: #d6e4ed;
  --muted: #42576b;
  --background: #edf4f8;
  --red: #ef1f1f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: #10233f;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}

.guide-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--guide-sidebar-width, 318px) minmax(0, 1fr);
  grid-template-areas: "sidebar main";
}

html[dir="rtl"] .guide-layout {
  grid-template-columns: var(--guide-sidebar-width, 318px) minmax(0, 1fr);
  grid-template-areas: "sidebar main";
}

.page {
  grid-area: main;
  width: min(1380px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 30px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #06223e, #0b4f63);
  box-shadow: 0 18px 44px rgba(5, 31, 52, .18);
}

.brand-block { flex: 0 0 auto; }

.brand {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 34px;
  font-weight: 950;
  line-height: 1.1;
}

.brand span { color: var(--orange); }

.brand-block small {
  display: block;
  margin-top: 5px;
  color: #cdebf2;
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.workflow-link,
.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 11px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(255, 255, 255, .08);
}

.language-switch {
  color: #082f49;
  border-color: #fcd34d;
  background: #fbbf24;
}

.search { display: block; }

.search input {
  width: 330px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 11px;
  outline: 0;
  background: #fff;
  color: #334155;
  font: inherit;
}

.title {
  margin: 28px 0 18px;
  text-align: center;
}

.title h1 {
  margin: 0;
  color: var(--navy);
  font-size: 40px;
  line-height: 1.3;
}

.title p {
  margin: 7px 0 0;
  color: var(--teal);
  font-size: 20px;
  font-weight: 850;
}

.intro {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  margin-bottom: 18px;
}

.card,
.fullshot,
.step,
.field-table-wrap,
.notes-card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(15, 52, 75, .08);
}

.card {
  min-height: 180px;
  padding: 20px 22px;
  border-radius: 16px;
}

.card h2,
.notes-card h2 {
  margin: 0 0 10px;
  color: #08314c;
  font-size: 25px;
}

.card p,
.notes-card li {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid #b7ded5;
  border-radius: 999px;
  background: #e8f6f3;
  color: var(--teal);
  font-size: 15px;
  font-weight: 850;
}

.fullshot {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(8, 47, 73, .13);
}

.fullshot-title {
  position: absolute;
  z-index: 2;
  inset-block-start: 28px;
  inset-inline-start: 28px;
  padding: 8px 13px;
  border-radius: 10px;
  background: rgba(7, 45, 70, .9);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(2, 26, 44, .2);
}

.fullshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 18px;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.4;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 34px;
  flex: 0 0 8px;
  border-radius: 99px;
  background: var(--orange);
}

.steps-list { display: grid; gap: 18px; }

.step {
  display: grid;
  grid-template-columns: 470px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  min-height: 245px;
  padding: 20px 22px;
  border-radius: 18px;
}

.lang-en .step { grid-template-columns: minmax(0, 1fr) 470px; }
.lang-en .step-copy { order: 1; }
.lang-en .visual { order: 2; }

.step.step-visual-dense { grid-template-columns: 590px minmax(0, 1fr); }
.lang-en .step.step-visual-dense { grid-template-columns: minmax(0, 1fr) 590px; }

.step-copy {
  position: relative;
  min-width: 0;
  padding: 4px 70px 4px 6px;
}

.step-emphasis-warning {
  border: 2px solid #eab308;
  background: linear-gradient(135deg, #fff9c9 0%, #fff4a8 55%, #ffef93 100%);
  box-shadow: 0 14px 30px rgba(161, 98, 7, .16);
}

.step-emphasis-warning .step-number {
  color: #fff;
  background: #b45309;
}

.step-emphasis-warning .step-copy h2 {
  color: #713f12;
  font-weight: 950;
}

.step-emphasis-warning .step-copy p,
.step-emphasis-warning .step-copy li {
  color: #854d0e;
  font-weight: 850;
}

.step-emphasis-warning .note {
  border-color: #d97706;
  color: #7c2d12;
  background: rgba(255, 255, 255, .72);
  font-weight: 950;
}

.step-importance {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin: 0 0 7px;
  padding: 4px 10px;
  border: 1px solid rgba(180, 83, 9, .3);
  border-radius: 6px;
  color: #7c2d12;
  background: rgba(255, 255, 255, .76);
  font-size: 12px;
  font-weight: 950;
}

.lang-en .step-copy { padding: 4px 6px 4px 70px; }

.step-number {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: #0b3b5a;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(11, 59, 90, .22);
}

.lang-en .step-number { right: auto; left: 0; }

.step-copy h2 {
  margin: 0 0 8px;
  color: #092f4a;
  font-size: 26px;
  line-height: 1.45;
}

.step-copy p {
  margin: 0 0 10px;
  color: #3b5267;
  font-size: 18px;
}

.step-copy ul {
  margin: 8px 0 0;
  padding-inline-start: 22px;
}

.step-copy li {
  margin-bottom: 5px;
  color: #4b6075;
  font-size: 16px;
}

.note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b7ded5;
  border-radius: 12px;
  background: #e8f6f3;
  color: #0f5f56;
  font-weight: 850;
}

.visual {
  position: relative;
  direction: ltr;
  justify-self: start;
  max-width: 100%;
  min-height: 185px;
  overflow: hidden;
  border: 1px solid #cbdde8;
  border-radius: 14px;
  background: #f8fbfd;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 8px 22px rgba(8, 47, 73, .09);
  cursor: zoom-in;
}

.visual:focus-visible {
  outline: 4px solid rgba(37, 99, 235, .28);
  outline-offset: 3px;
}

.lang-en .visual { justify-self: end; }

.crop-image {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
}

.callout {
  position: absolute;
  border: 4px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .96), 0 0 0 9999px rgba(239, 31, 31, .025);
  pointer-events: none;
}

.guide-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  max-width: calc(100% - 78px);
  padding: 7px 12px;
  border: 2px solid var(--red);
  border-radius: 10px;
  background: #fff;
  color: #d71920;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.guide-label::after {
  content: "";
  position: absolute;
  right: -42px;
  top: 50%;
  width: 38px;
  height: 3px;
  background: var(--red);
}

.guide-label::before {
  content: "";
  position: absolute;
  right: -49px;
  top: calc(50% - 6px);
  border-width: 7px 0 7px 10px;
  border-style: solid;
  border-color: transparent transparent transparent var(--red);
}

.zoom-hint {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #0b3b5a;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(8, 47, 73, .24);
}

.visual-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 54px;
  border: 0;
  background: rgba(2, 20, 34, .88);
  cursor: zoom-out;
}

.visual-lightbox-frame {
  position: relative;
  overflow: visible;
  max-width: calc(100vw - 108px);
  max-height: calc(100vh - 108px);
}

.visual-lightbox .visual {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  margin: 0;
  order: 0;
  justify-self: start !important;
  cursor: default;
  transform-origin: top left;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .4);
}

.visual-lightbox-close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 20px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  color: #fff;
  background: #b91c1c;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

body.visual-lightbox-open { overflow: hidden; }

.field-table-wrap {
  overflow: hidden;
  border-radius: 14px;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.field-table th {
  padding: 13px 15px;
  background: #0b3b5a;
  color: #fff;
  font-size: 16px;
  text-align: start;
}

.field-table td {
  padding: 12px 15px;
  border-top: 1px solid #e1ebf2;
  color: #43566a;
  font-size: 16px;
  vertical-align: top;
}

.field-table td:first-child {
  width: 240px;
  color: var(--teal);
  font-weight: 950;
}

.notes-card {
  margin-top: 22px;
  padding: 20px 24px;
  border-color: #b7ded5;
  border-radius: 16px;
  background: #e8f6f3;
}

.notes-card ul { margin: 0; padding-inline-start: 22px; }

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.page-nav a {
  display: grid;
  gap: 2px;
  min-width: 260px;
  padding: 13px 17px;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 9px 22px rgba(15, 118, 110, .17);
}

.page-nav small { color: #c8f1e8; }
.page-nav b { font-size: 16px; }

.hidden-by-search { display: none !important; }

@media (max-width: 1180px) {
  .guide-layout,
  html[dir="rtl"] .guide-layout { display: block; }
}

@media (max-width: 1100px) {
  .header { align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .intro,
  .step,
  .lang-en .step { grid-template-columns: 1fr; }
  .step-copy,
  .lang-en .step-copy { order: 0; }
  .visual,
  .lang-en .visual { order: 0; justify-self: center; }
}

@media (max-width: 1320px) {
  .step,
  .lang-en .step,
  .step.step-visual-dense,
  .lang-en .step.step-visual-dense { grid-template-columns: 1fr; }
  .step-copy,
  .lang-en .step-copy { order: 0; }
  .visual,
  .lang-en .visual { order: 0; justify-self: center; }
}

@media (max-width: 720px) {
  .page { width: min(100% - 20px, 1480px); padding-top: 10px; }
  .header { flex-direction: column; padding: 18px; }
  .header-actions { width: 100%; justify-content: stretch; }
  .workflow-link,
  .language-switch { flex: 1; }
  .title h1 { font-size: 29px; }
  .title p { font-size: 16px; }
  .card { min-height: 0; }
  .step { padding: 16px; }
  .step-copy { padding-inline-start: 62px; }
  .lang-ar .step-copy { padding-right: 62px; padding-left: 0; }
  .step-copy h2 { font-size: 21px; }
  .step-copy p { font-size: 16px; }
  .visual { width: 100% !important; overflow-x: auto; }
  .visual-lightbox { padding: 56px 12px 12px; }
  .page-nav { flex-direction: column; }
  .page-nav a { min-width: 0; width: 100%; }
}
