/* 07 · Maxsus eskiz (eskiz.js). UI tokenlar bilan; chizma varag'i doim oq (haqiqiy qog'oz kabi). */

.esk h2 {
  font-size: 15px;
  margin: 14px 0 6px;
  color: var(--ink-2);
}
.esk button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.esk-hb {
  justify-self: start;
  min-height: 48px;
  padding: 0 8px 0 0;
  border: 0;
  background: none;
  color: inherit;
}
.esk-hb:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* sarlavha + ko'rsatma doim ko'rinadi (ruletka maydoni ham) — fokusda sahifa sakramaydi */
.esk-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
}
.esk-sticky .top {
  position: static;
}
.esk-guide-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px;
}
/* ko'rsatma paneli: balandligi zaxiralangan — varaq sakramaydi */
.esk-guide {
  min-height: 112px;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--navy-soft);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.esk-guide.cap {
  border-color: var(--navy);
}
.esk-say {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}
.esk-okmsg {
  color: var(--ok);
  font-weight: 600;
}
.esk-row {
  display: grid;
  gap: 6px;
  align-items: center;
}
.esk-dimrow {
  grid-template-columns: minmax(0, 1fr) 72px 48px;
}
.esk-textrow {
  grid-template-columns: minmax(0, 1fr) 48px 48px;
}
.esk-selrow {
  grid-template-columns: minmax(0, 1fr) 48px;
}
.esk-tapef {
  min-width: 0;
}
.esk-tapef .tape {
  font-size: 24px;
  min-height: 52px;
  padding: 6px 8px;
}
.esk-tapef .tape-err {
  display: block;
}
.esk-label,
.esk-text {
  min-height: 52px;
  padding: 8px;
  font-size: 16px;
}
.esk-label {
  text-align: center;
  font-weight: 700;
}
.esk-del,
.esk-ok {
  width: 48px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--danger);
  font-size: 20px;
}
.esk-ok {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
  font-weight: 700;
}

/* asboblar: 5 ustun × 2 qator, oxirgi ustun — Bekor / Qaytar */
.esk-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 8px 0;
}
.esk-tools button,
.esk-tpl button {
  min-height: 56px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}
.esk-tools button[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
  font-weight: 700;
}
.esk-tools .esk-ur {
  border-style: dashed;
  color: var(--navy);
  font-weight: 700;
}
.esk-tools .esk-ur:disabled {
  color: var(--ink-2);
  opacity: 0.45;
  cursor: default;
}
.esk-ico {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* rang, qalinlik, punktir */
.esk-style {
  margin: 0 0 8px;
}
.esk-colors,
.esk-widths {
  display: grid;
  gap: 4px;
}
.esk-colors {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0; /* 320 px da ham har biri 48 px */
  margin-bottom: 4px;
  box-shadow: inset 0 0 0 1px var(--line); /* chegara eni olmasin */
  border-radius: 8px;
  background: var(--surface);
}
.esk-colors button {
  border: 0;
  background: none;
}
.esk-widths {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.esk-colors button,
.esk-widths button {
  min-height: 48px;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}
.esk-colors i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px var(--ink-2);
}
.esk-colors button[aria-pressed="true"] i {
  box-shadow: inset 0 0 0 1px var(--ink-2), 0 0 0 3px var(--surface), 0 0 0 6px var(--navy);
}
.esk-widths button[aria-pressed="true"] {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
  font-weight: 700;
}
.esk-widths button {
  grid-template-rows: 14px auto;
  gap: 2px;
}
.esk-widths i {
  width: 70%;
  height: var(--lw, 4px);
  border-radius: 4px;
  background: currentColor;
}
.esk-widths .esk-dash {
  height: 0;
  border-top: 4px dashed currentColor;
  background: none;
  border-radius: 0;
}

/* varaq */
.esk-paper {
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line), var(--paper-shadow);
  color-scheme: light;
  overflow: hidden;
  touch-action: none;
}
.esk-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
}

/* tayyor shakllar */
.esk-tpl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.esk-tpl button {
  min-height: 60px;
  font-size: 13px;
  color: var(--navy);
  font-weight: 600;
}

/* o'lchamlar ro'yxati (blankadagi «Nuqta / tomon ID — O'lcham» jadvali) */
.esk-dims {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px;
}
.esk-dims .hint {
  grid-column: 1 / -1;
  margin: 0;
}
.esk-dimbtn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.esk-dimbtn b {
  min-width: 22px;
  color: var(--navy);
}
.esk-dimbtn span {
  font-weight: 700;
}
.esk-dimbtn.miss {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.esk-dimbtn.miss span {
  color: var(--warn);
  font-size: 14px;
  font-weight: 600;
}
.esk-dimbtn[aria-pressed="true"] {
  border-color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}

.esk .field {
  margin-top: 14px;
}
.esk-err {
  color: var(--danger);
  font-weight: 600;
  margin: 0 0 8px;
}
.esk-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 24px;
}
.esk-bottom .btn-line {
  min-height: 48px;
  padding: 10px 8px;
}

/* ro'yxat */
.esk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.esk-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.esk-thumb {
  width: 72px;
  height: auto;
  flex: none;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line);
  background: var(--paper);
}
.esk-it {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.esk-it b {
  overflow-wrap: anywhere;
}
.esk-it > span {
  font-size: 14px;
  color: var(--ink-2);
}
.esk-it > .esk-miss {
  color: var(--warn);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .esk .tape.tape-ok {
    animation: none;
  }
}
