@font-face {
  font-family: IranYekan;
  src: url(fonts/IranYekan-Regular.ttf);
}
@font-face {
  font-family: IranYekanBold;
  src: url(fonts/IranYekan-Bold.ttf);
  font-weight: 700;
}
@font-face {
  font-family: Nastaliq;
  src: url(fonts/NotoNastaliqUrdu-Variable.ttf);
}
@font-face {
  font-family: Vazirmatn;
  src: url(fonts/Vazirmatn-Variable.ttf);
}
@font-face {
  font-family: Lalezar;
  src: url(fonts/Lalezar-Regular.ttf);
}
@font-face {
  font-family: Katibeh;
  src: url(fonts/Katibeh-Regular.ttf);
}
@font-face {
  font-family: "Aref Ruqaa";
  src: url(fonts/ArefRuqaa-Regular.ttf);
}
@font-face {
  font-family: Italiana;
  src: url(fonts/Italiana-Regular.ttf);
}
@font-face {
  font-family: Prata;
  src: url(fonts/Prata-Regular.ttf);
}
@font-face {
  font-family: Parisienne;
  src: url(fonts/Parisienne-Regular.ttf);
}
@font-face {
  font-family: "Pinyon Script";
  src: url(fonts/PinyonScript-Regular.ttf);
}
#textFont {
  flex: 1;
  background: #050914;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 9px;
  padding: 10px;
}
#fontPreview {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #050914;
  border: 1px solid #263249;
  border-radius: 11px;
  padding: 10px;
  font-size: 21px;
}
#fontGallery {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
}
#fontGallery button {
  min-height: 50px;
  font-size: 20px;
  font-weight: 400;
  text-align: left;
  background: #17191f;
  border: 0;
}
#colorDialog {
  width: min(100%, 640px);
  max-height: 78dvh;
  margin-top: auto;
  margin-bottom: 0;
  padding: 22px 18px 18px;
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg,#111318 0%,#101217 58%,#061a31 100%);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 -20px 70px rgba(0,0,0,.62);
}
#colorDialog::backdrop {
  background: rgba(0,0,0,.56);
}
#colorDialog form {
  direction: ltr;
  gap: 12px;
}
.ios-color-header {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
}
.ios-color-header h3 {
  text-align: center;
  font-size: 19px;
  line-height: 1;
}
.ios-color-header button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 38px;
  font-weight: 300;
  color: #fff;
}
#colorDialogClose {
  font-size: 30px !important;
  font-weight: 700 !important;
}
.ios-color-header #pickerEyedropperBtn {
  display: grid;
  place-items: center;
}
.ios-color-header #pickerEyedropperBtn .dropper-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}
.ios-color-header #pickerEyedropperBtn .dropper-icon::before {
  left: 11px;
  height: 24px;
  width: 6px;
  background: #fff;
  box-shadow: none;
}
.ios-color-header #pickerEyedropperBtn .dropper-icon::after {
  left: 7px;
  width: 16px;
  height: 7px;
  background: #fff;
}
.dialog-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: 38px;
  padding: 3px;
  border-radius: 999px;
  background: #1d1d1f;
}
.dialog-segmented button {
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}
.dialog-segmented button.selected {
  background: #69696f;
}
.picker-tabs {
  display: none !important;
}
.picker-tabs button {
  min-height: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 750;
}
#pickerSpectrumTab,
#pickerSlidersTab {
  display: none !important;
}
.mode-segmented {
  grid-template-columns: 1fr;
  height: 32px;
  opacity: .92;
}
.mode-segmented button {
  min-height: 26px;
  height: 26px;
  font-size: 11px;
}
#dialogGradientMode {
  display: none !important;
}
.ios-color-dialog.setup-picker #colorPreview,
.ios-color-dialog.setup-picker .dialog-actions {
  display: none;
}
#colorPreview {
  height: 72px;
  border-radius: 13px;
  border: 1px solid #334155;
}
.color-dot,
.color-trigger {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,.48);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(0,0,0,.28);
}
.color-trigger {
  display: inline-block;
  cursor: pointer;
}
.color-trigger.selected {
  outline: 3px solid #0a84ff;
  outline-offset: 3px;
}
.dialog-color-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #15171c;
  border: 1px solid rgba(255,255,255,.06);
  font-weight: 800;
}
.color-grid-panel {
  display: grid;
  gap: 13px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  touch-action: none;
  user-select: none;
}
.color-grid button {
  min-height: 28px;
  height: clamp(24px, 5.7vw, 40px);
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.color-grid button.selected {
  outline: 3px solid rgba(255,255,255,.9);
  outline-offset: -4px;
}
.recent-colors {
  border-top: 1px solid rgba(255,255,255,.13);
  padding-top: 12px;
  display: grid;
  grid-template-columns: 76px 1fr 44px;
  align-items: center;
  gap: 13px;
}
.current-color-preview {
  width: 76px;
  height: 76px;
  min-height: 76px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #000;
}
.recent-color-list {
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
}
.recent-color-list button {
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  min-height: 33px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.plus-color {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  background: #d9dce1;
  color: #3f4248;
  font-size: 34px;
  line-height: 1;
}
.mg-color-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 15px;
  background: #11141b;
  border: 1px solid rgba(255,255,255,.08);
}
.picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dbe7f6;
  font-size: 12px;
  font-weight: 850;
}
.picker-title code {
  color: #8fc8ff;
  font: 800 12px ui-monospace, Menlo, monospace;
  direction: ltr;
}
#colorField {
  width: 100%;
  height: 154px;
  border-radius: 13px;
  border: 1px solid #334155;
  touch-action: none;
  cursor: crosshair;
}
.hue-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  color: #dbe7f6;
  font-size: 11px;
  font-weight: 850;
}
#colorHue {
  width: 100%;
  accent-color: #0a84ff;
}
.color-sliders-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 15px;
  background: #11141b;
  border: 1px solid rgba(255,255,255,.08);
}
.color-sliders-panel label {
  display: grid;
  grid-template-columns: 54px 42px 1fr;
  align-items: center;
  gap: 9px;
  padding: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}
.color-sliders-panel output {
  text-align: right;
  color: #b6c7db;
  font-variant-numeric: tabular-nums;
}
.color-sliders-panel input {
  width: 100%;
  accent-color: #0a84ff;
}
.pick-image-button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  align-content: center;
}
.pick-image-button span,
.dropper-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pick-image-button small {
  display: block;
  color: #9aa7ba;
  font-size: 11px;
  font-weight: 600;
}
.dropper-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transform: rotate(-45deg);
}
.dropper-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 1px;
  width: 5px;
  height: 15px;
  border-radius: 4px;
  background: linear-gradient(#fff,#8fc8ff);
  box-shadow: 0 0 0 1px rgba(10,132,255,.65);
}
.dropper-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 11px;
  height: 5px;
  border-radius: 2px;
  background: #0a84ff;
}
.sample-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding-top: 38px;
}
#colorSampleCanvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(42dvh, 360px);
  border-radius: 12px;
  border: 1px solid #334155;
  touch-action: none;
  cursor: crosshair;
}
.clear-picked-image {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 30px;
  height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border-color: rgba(255,69,58,.35);
  background: rgba(255,69,58,.16);
  color: #ff706b;
  font-size: 11px;
  font-weight: 850;
  z-index: 6;
}
.dropper-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.58);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.dropper-cursor {
  --picked-color: #ffffff;
  position: absolute;
  width: 46px;
  height: 46px;
  margin-left: -15px;
  margin-top: -45px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(38,40,45,.84);
  box-shadow: 0 10px 25px rgba(0,0,0,.42), 0 0 0 1px rgba(0,0,0,.45);
  backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: 5;
}
.dropper-cursor::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--picked-color);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45);
}
.dropper-cursor .dropper-icon {
  width: 25px;
  height: 25px;
  flex-basis: 25px;
}
.dropper-cursor .dropper-icon::before {
  left: 10px;
  height: 22px;
  width: 6px;
  background: #fff;
  box-shadow: none;
}
.dropper-cursor .dropper-icon::after {
  left: 6px;
  width: 15px;
  height: 7px;
  background: #fff;
}
.color-loupe {
  --picked-color: #ffffff;
  position: absolute;
  width: 82px;
  height: 82px;
  margin-left: -41px;
  margin-top: -96px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #111827;
  box-shadow: 0 16px 45px rgba(0,0,0,.52), 0 0 0 1px rgba(10,132,255,.75);
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}
.color-loupe::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255,255,255,.95) 49%, rgba(255,255,255,.95) 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(255,255,255,.95) 49%, rgba(255,255,255,.95) 51%, transparent 52%),
    radial-gradient(circle, transparent 58%, rgba(0,0,0,.42));
}
.color-loupe::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 20px;
  height: 20px;
  transform: translateX(-50%) rotate(45deg);
  background: #fff;
  border-radius: 3px;
  z-index: 1;
}
.color-loupe canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.color-loupe span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--picked-color);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #0a84ff;
  z-index: 3;
}
.text-controls {
  grid-template-columns: 1fr 1fr;
}
.text-controls label {
  min-width: 0;
}
.line-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}
.line-controls label {
  background: #15171c;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
}
.line-controls input[type="range"] {
  width: 100%;
}
.rotate-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}
.rotate-control input[type="range"] {
  width: 100%;
  min-width: 0;
}
.rotate-number {
  width: 64px !important;
  height: 34px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #050914;
  color: #fff;
  padding: 4px 6px;
  text-align: center;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.line-controls button {
  grid-column: 1/-1;
}
.line-direction {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 7px;
  background: #15171c;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
}
.line-direction button {
  grid-column: auto;
  padding: 9px 6px;
  font-size: 10px;
}
.line-direction button.selected {
  background: #1677ff;
  border-color: #1677ff;
}
.layouts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 55vh;
  overflow: auto;
}
.layout-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  text-align: left;
  background: #0b1220;
  border: 2px solid transparent;
}
.layout-card.selected {
  border-color: #1683ff;
}
.layout-card img,
.layout-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 7px;
  background: #050914;
}
.layout-placeholder {
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 28px;
  font-weight: 800;
}
.layout-card small {
  color: #94a3b8;
}
.export-options {
  display: grid;
  gap: 10px;
  min-width: min(76vw, 320px);
}
