@font-face {
  font-family: LogoArabic;
  src: url("/api/font") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #253b40;
  background: #f5f7f6;
  font-synthesis: none;
  --ink: #163c35;
  --muted: #5f7069;
  --line: #e1e8e4;
  --brand: #246350;
  --soft: #edf5ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button,
a,
input,
textarea,
select {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8abb9c;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #a8c9b0;
  border-color: transparent;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
button {
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.site-header {
  height: 84px;
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-family: LogoArabic, system-ui;
  font-size: 20px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  font-size: 25px;
}
.brand small {
  display: block;
  color: var(--muted);
  font: 11px system-ui;
  margin-top: 2px;
}
.connection {
  font-size: 11px;
  color: #59675f;
  display: flex;
  align-items: center;
  gap: 7px;
}
.connection::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8b77e;
}
.connection.online::before {
  background: #58a77e;
}
.page {
  max-width: 1280px;
  margin: auto;
  padding: 42px 34px 30px;
}
.intro {
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.03em;
  color: #7d9788;
  margin-bottom: 9px;
}
.intro h1 {
  font-family: LogoArabic, system-ui;
  font-size: 34px;
  line-height: 1.7;
  letter-spacing: -0.03em;
}
.intro > p:last-child {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.9;
}
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
  gap: 28px;
  align-items: start;
}
.form-card,
.preview-card,
.history-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.form-card {
  box-shadow: 0 14px 35px #1b453204;
}
.form-section {
  padding: 25px 28px;
  border-bottom: 1px solid #edf0ed;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-title > span {
  font-size: 10px;
  color: #95a39b;
  letter-spacing: 0.06em;
}
.section-title h2 {
  font-size: 15px;
  font-family: LogoArabic, system-ui;
  line-height: 1.8;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
label {
  display: block;
  font-size: 12px;
  color: #50645a;
  margin: 18px 0 8px;
}
label > span {
  color: #9c8178;
}
input:not([type="checkbox"]):not([type="color"]):not([type="range"]),
select,
textarea {
  width: 100%;
  border: 1px solid #dce5de;
  border-radius: 11px;
  padding: 12px 13px;
  background: #fcfdfb;
  color: #2d453a;
  min-width: 0;
  font-size: 13px;
}
textarea {
  resize: vertical;
  min-height: 91px;
  line-height: 1.8;
}
input::placeholder,
textarea::placeholder {
  color: #a2afa5;
  font-size: 12px;
}
select {
  padding-inline-end: 28px;
}
input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #b46c62;
  outline-color: #c8998f;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.field-grid:has(> [hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.optional {
  margin-top: 18px;
  border-top: 1px solid #edf0ed;
  padding-top: 14px;
}
.optional summary {
  cursor: pointer;
  font-size: 12px;
  color: #78897b;
  line-height: 1.8;
}
.optional summary > span {
  font-size: 10px;
  color: #a4afa5;
  margin-inline-start: 5px;
}
.helper {
  font-size: 11px;
  color: #87958a;
  line-height: 1.9;
  margin-top: 9px;
}
.segmented {
  display: flex;
  gap: 9px;
}
.segmented button {
  border: 1px solid #e0e8e0;
  background: #fff;
  border-radius: 12px;
  color: #748477;
}
.segmented button[aria-pressed="true"] {
  background: #eff6ef;
  border-color: #93b59b;
  color: #285b42;
  box-shadow: 0 0 0 2px #a6c3a514;
}
.type-picks button {
  flex: 1;
  min-width: 0;
  text-align: start;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 9px;
  padding: 16px 13px;
  align-items: center;
}
.type-icon {
  grid-row: 1/3;
  font-size: 25px;
  align-self: start;
  line-height: 1.3;
  color: #9cba9c;
}
.type-icon.word-icon {
  font-family: LogoArabic;
  font-size: 20px;
}
.type-picks strong {
  font-size: 12px;
}
.type-picks small {
  font-size: 10px;
  line-height: 1.9;
  color: #8e9d90;
}
.color-mode {
  margin-bottom: 12px;
}
.color-mode button {
  flex: 1;
  padding: 12px;
  font-size: 12px;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.palette {
  border: 1px solid #dfe5da;
  border-radius: 10px;
  padding: 10px;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  gap: 9px;
  text-align: start;
}
.palette[aria-pressed="true"] {
  outline: 2px solid #7ca484;
  outline-offset: 2px;
}
.palette span {
  font-size: 10px;
}
.palette i {
  display: flex;
  gap: 4px;
}
.palette b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #0000000a;
}
.color-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.color-inputs label {
  font-size: 11px;
}
.color-inputs input {
  display: block;
  width: 100%;
  height: 34px;
  padding: 3px;
  border: 1px solid #dce5de;
  border-radius: 7px;
  background: #fff;
  margin-top: 7px;
}
.checkbox {
  display: flex;
  align-items: start;
  gap: 9px;
  line-height: 1.9;
  font-size: 11px;
}
.checkbox input {
  accent-color: var(--brand);
  margin-top: 4px;
  flex-shrink: 0;
}
.inline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.inline input {
  min-width: 0;
}
.inline button {
  flex-shrink: 0;
}
input[type="range"] {
  accent-color: var(--brand);
  width: 100%;
}
.primary,
.secondary,
.text-button {
  border-radius: 11px;
  font-size: 12px;
  padding: 11px 15px;
}
.primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 5px 13px #285b4214;
}
.primary:hover:not(:disabled) {
  background: #194e3b;
}
.secondary {
  background: #f5f8f2;
  border: 1px solid #dbe5d6;
  color: #557047;
}
.secondary:hover:not(:disabled) {
  border-color: #a9bba0;
  background: #eff5e9;
}
.text-button {
  color: #71916c;
  background: none;
  border: 0;
  padding: 9px 0;
}
.wide {
  width: 100%;
  margin-top: 16px;
}
.create-actions {
  padding: 22px 28px;
  background: #fcfdfb;
}
.create-actions .primary {
  width: 100%;
  font-size: 14px;
  padding: 16px;
}
.create-actions p {
  font-size: 10px;
  color: #9aa799;
  text-align: center;
  line-height: 1.8;
  margin-top: 10px;
}
.proposal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.proposal {
  position: relative;
  min-width: 0;
  background: #fff;
  border: 1px solid #dfe6db;
  padding: 6px 6px 12px;
  border-radius: 13px;
  text-align: start;
  overflow: hidden;
}
.proposal img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
}
.proposal strong {
  display: block;
  font-size: 10px;
  color: #5f7258;
  margin: 9px 6px 0;
}
.proposal small {
  position: absolute;
  inset-inline-start: 12px;
  top: 12px;
  font-size: 8px;
  border: 1px solid #e8efdf;
  background: #fffffff0;
  border-radius: 20px;
  color: #5e8454;
  padding: 3px 7px;
}
.proposal[aria-pressed="true"] {
  outline: 2px solid #88a577;
  outline-offset: 1px;
}
.result-column {
  position: sticky;
  top: 22px;
  min-width: 0;
}
.preview-card {
  padding: 24px;
  box-shadow: 0 10px 35px #183c3205;
}
.preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.preview-heading h2 {
  font-family: LogoArabic, system-ui;
  font-size: 16px;
  line-height: 1.7;
}
.preview-heading .eyebrow {
  margin-bottom: 5px;
}
.state-label {
  font-size: 10px;
  color: #6b8e65;
  background: #f2f7ec;
  border: 1px solid #e5eddc;
  border-radius: 20px;
  padding: 5px 9px;
}
.preview-canvas {
  min-height: 300px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5eae0;
  border-radius: 15px;
  overflow: hidden;
  background-color: #fafbf7;
  background-image:
    linear-gradient(45deg, #edf0e8 25%, transparent 25%),
    linear-gradient(-45deg, #edf0e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf0e8 75%),
    linear-gradient(-45deg, transparent 75%, #edf0e8 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}
.preview-canvas img {
  max-width: 100%;
  max-height: 640px;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.empty-state {
  text-align: center;
  background: #fafbf7;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 25px;
}
.empty-state > span {
  font-size: 60px;
  color: #c3d0b8;
  font-weight: 300;
  line-height: 1.4;
}
.empty-state h3 {
  font-size: 14px;
  color: #7c9070;
  margin: 16px 0 9px;
}
.empty-state p {
  font-size: 11px;
  color: #a0ac94;
  line-height: 1.9;
}
.preview-message {
  text-align: center;
  padding: 32px;
  color: #7e8f71;
  background: #fafbf7;
  width: 100%;
  font-size: 13px;
  line-height: 2;
}
.preview-card #status {
  font-size: 11px;
  color: #748768;
  line-height: 1.9;
  min-height: 21px;
  margin-top: 14px;
}
progress {
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  accent-color: var(--brand);
  margin-top: 18px;
}
progress::-webkit-progress-bar {
  background: #edf2e7;
}
progress::-webkit-progress-value {
  background: #79a470;
}
#preview-options {
  margin-top: 5px;
}
#preview-options label {
  font-size: 11px;
}
#preview-options select {
  font-size: 12px;
  padding: 10px;
}
.tools {
  flex-wrap: wrap;
  margin-top: 15px;
  gap: 12px;
}
.tools .secondary {
  margin-inline-start: auto;
  font-size: 11px;
  padding: 9px 11px;
}
.small-previews {
  display: flex;
  align-items: end;
  gap: 24px;
  margin: 16px 0;
}
.small-previews figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.small-previews img {
  object-fit: contain;
  border: 1px solid #ebeee6;
  border-radius: 6px;
  background: #f9fbf6;
}
.small-previews figcaption {
  font-size: 9px;
  color: #97a28e;
}
.history-card {
  margin-top: 18px;
  padding: 20px 24px;
}
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.history-heading h2 {
  font-size: 12px;
  font-family: LogoArabic, system-ui;
}
.history-heading > span {
  font-size: 10px;
  color: #a2ad98;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.history-item {
  border: 1px solid #e5eadd;
  border-radius: 10px;
  background: #fcfdf9;
  padding: 5px 5px 9px;
  overflow: hidden;
  min-width: 0;
}
.history-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 5px;
  display: block;
}
.history-item span {
  display: block;
  font-size: 9px;
  color: #849376;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item:hover {
  border-color: #a2b88e;
}
.notice {
  padding: 12px 17px;
  border-radius: 12px;
  background: #fff4e7;
  border: 1px solid #eed9bf;
  color: #936a37;
  font-size: 12px;
  line-height: 1.9;
  margin-bottom: 22px;
}
footer {
  color: #a6b19b;
  text-align: center;
  padding: 24px;
  font-size: 10px;
  line-height: 1.9;
}
@media (min-width: 1500px) {
  .page {
    padding-top: 50px;
  }
}
@media (max-width: 900px) {
  .studio-grid {
    gap: 18px;
  }
  .page {
    padding: 26px 20px;
  }
  .form-section {
    padding: 22px 20px;
  }
  .create-actions {
    padding: 20px;
  }
  .preview-card {
    padding: 19px;
  }
  .history-card {
    padding: 18px;
  }
  .preview-canvas {
    min-height: 230px;
  }
  .intro h1 {
    font-size: 29px;
  }
  .result-column {
    top: 14px;
  }
}
@media (max-width: 700px) {
  .site-header {
    height: 74px;
    padding: 0 19px;
  }
  .page {
    padding: 23px 16px;
  }
  .intro {
    margin-bottom: 22px;
  }
  .intro h1 {
    font-size: 27px;
  }
  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .result-column {
    position: static;
  }
  .form-section {
    padding: 22px;
  }
  .create-actions {
    padding: 20px 22px;
  }
  .preview-card {
    padding: 21px;
  }
  .preview-canvas {
    min-height: 270px;
  }
  .history-card {
    padding: 20px;
  }
  .field-grid {
    gap: 0 10px;
  }
  .connection {
    font-size: 10px;
  }
  .type-picks button {
    padding: 14px 11px;
  }
  .palette-grid {
    gap: 8px;
  }
  .primary {
    min-height: 46px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
