.ai-page { min-width: 0; overflow-x: hidden; background: #f4f4f4; }
.ai-page [hidden] { display: none !important; }
.ai-page-header { background: #fff; box-shadow: 0 12px 28px -12px rgba(0, 11, 48, .2); }
.ai-page-header-inner { display: flex; align-items: center; justify-content: space-between; width: min(1160px, calc(100% - 40px)); min-height: 90px; margin: 0 auto; }
.ai-page-logo { display: block; width: 92px; }
.ai-page-logo img { display: block; width: 100%; height: auto; }
.ai-page-nav { display: flex; align-items: center; gap: 12px; }
.ai-page-nav a { border-radius: 999px; padding: 11px 18px; font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s; }
.ai-page-nav a:hover { color: #cf8210; background: #fff7e8; }
.ai-page-generations { color: #8f5b06; background: #fff4dc; }
.ai-page-generations:hover { color: #fff !important; background: #cf8210 !important; }
.ai-page-back { border: 1px solid #dfdfdf; }
.ai-page-back span { margin-right: 5px; }
.ai-page-main { width: 100%; padding: 50px 0 80px; }
.ai-design-section { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 56px clamp(20px, 5vw, 68px) 64px; border-radius: 24px; background: #fff; box-shadow: 0 10px 35px rgba(0, 11, 48, .08); }
.ai-design-heading { max-width: 710px; margin: 0 auto 38px; text-align: center; }
.ai-design-kicker { display: inline-block; margin-bottom: 10px; color: #cf8210; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ai-design-heading h1 { margin: 0 0 15px; font-size: 44px; font-weight: 600; line-height: 1.16; }
.ai-design-heading p { margin: 0; color: #777; font-size: 18px; font-weight: 300; line-height: 1.5; }
.ai-access-loading { margin: 38px 0; color: #888; font-size: 15px; text-align: center; }
.ai-access-card { width: min(560px, 100%); margin: 0 auto; border: 1px solid #e4e4e4; border-radius: 22px; padding: 36px 32px 32px; background: #fafafa; text-align: center; }
.ai-access-card[hidden], .ai-access-loading[hidden], .ai-usage[hidden] { display: none; }
.ai-access-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: #fff; background: #efa00b; box-shadow: 0 8px 22px rgba(239, 160, 11, .25); font-size: 19px; font-weight: 700; }
.ai-access-card h2 { margin: 0 0 11px; font-size: 27px; line-height: 1.2; }
.ai-access-card > p { max-width: 420px; margin: 0 auto; color: #777; font-size: 15px; font-weight: 300; line-height: 1.5; }
.ai-access-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 25px; }
.ai-access-actions .orange-button, .ai-yandex-button { min-height: 56px; border-radius: 999px; padding: 12px 18px; font-size: 14px; font-weight: 600; }
.ai-yandex-button { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; color: #fff; background: #080808; cursor: pointer; transition: background-color .2s, transform .2s; }
.ai-yandex-button:hover { background: #252525; transform: translateY(-1px); }
.ai-yandex-button span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: #fc3f1d; font-size: 18px; font-weight: 600; }
.ai-usage { margin: -12px 0 18px; color: #777; font-size: 14px; text-align: right; }
.ai-usage strong { color: #111; font-weight: 600; }
.ai-design-form { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(300px, 1.1fr); align-items: stretch; gap: 24px; }
.ai-mode-switch { grid-column: 1 / -1; min-width: 0; margin: 0; border: 0; padding: 0; }
.ai-mode-switch legend { width: 100%; margin-bottom: 11px; padding: 0; color: #333; font-size: 16px; font-weight: 600; text-align: center; }
.ai-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 660px; margin: 0 auto 6px; padding: 5px; border-radius: 20px; background: #f2f2f2; }
.ai-mode-options label { position: relative; min-width: 0; cursor: pointer; }
.ai-mode-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ai-mode-options span { display: grid; min-height: 72px; align-content: center; gap: 3px; border: 1px solid transparent; border-radius: 16px; padding: 11px 16px; color: #777; text-align: center; transition: color .2s, border-color .2s, background-color .2s, box-shadow .2s, transform .2s; }
.ai-mode-options strong { color: inherit; font-size: 15px; font-weight: 600; }
.ai-mode-options small { font-size: 11px; font-weight: 300; line-height: 1.3; }
.ai-mode-options input:checked + span { border-color: #f0b24b; color: #111; background: #fff; box-shadow: 0 5px 16px rgba(207, 130, 16, .14); }
.ai-mode-options label:hover span { transform: translateY(-1px); }
.ai-mode-options input:focus-visible + span { outline: 3px solid rgba(239, 160, 11, .25); outline-offset: 2px; }
.ai-design-form.is-text-mode .ai-photo-picker { display: none; }
.ai-design-form.is-text-mode .ai-design-fields { grid-column: 1 / -1; width: min(700px, 100%); margin: 0 auto; }
.ai-design-form.is-text-mode .ai-wishes-field textarea { min-height: 230px; }
.ai-photo-picker { position: relative; display: grid; min-height: 320px; place-items: center; overflow: hidden; border: 2px dashed #d3d3d3; border-radius: 18px; color: #555; background: #fafafa; cursor: pointer; transition: border-color .2s, background-color .2s; }
.ai-photo-picker:hover, .ai-photo-picker:focus-within { border-color: #e89a1b; background: #fffaf0; }
.ai-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ai-photo-placeholder { display: grid; justify-items: center; gap: 10px; padding: 25px; text-align: center; }
.ai-photo-placeholder svg { width: 46px; height: 46px; fill: none; stroke: #cf8210; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.ai-photo-placeholder strong { color: #111; font-size: 18px; }
.ai-photo-placeholder small { color: #999; font-size: 12px; font-weight: 300; line-height: 1.35; }
.ai-photo-preview { display: block; width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.ai-design-fields { display: flex; min-width: 0; flex-direction: column; }
.ai-wishes-field { display: grid; gap: 10px; }
.ai-wishes-field > span { color: #333; font-size: 16px; font-weight: 600; }
.ai-wishes-field textarea { min-height: 190px; resize: vertical; border-color: #d6d6d6; border-radius: 18px; padding: 17px 18px; color: #111; font-size: 16px; font-weight: 300; line-height: 1.45; }
.ai-wishes-field textarea::placeholder { color: #aaa; }
.ai-design-hint { margin: 12px 0 20px; color: #999; font-size: 12px; font-weight: 300; line-height: 1.4; }
.ai-submit { align-self: flex-start; min-width: 228px; min-height: 58px; margin-top: auto; padding: 0 30px; }
.ai-submit:disabled { cursor: wait; opacity: .68; }
.ai-submit-loading[hidden], .ai-submit-label[hidden] { display: none; }
.ai-design-status { min-height: 20px; margin: 10px 0 0; color: #777; font-size: 13px; line-height: 1.35; }
.ai-design-status.is-error { color: #b3261e; }
.ai-design-result { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(320px, 1.28fr); gap: 28px; align-items: center; }
.ai-result-copy h2 { margin: 0 0 9px; font-size: 31px; line-height: 1.2; }
.ai-result-copy p { margin: 0; color: #777; font-size: 16px; font-weight: 300; line-height: 1.45; }
.ai-result-image-wrap { overflow: hidden; border-radius: 18px; background: #eee; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.ai-result-image-wrap img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #eee; }
.ai-result-actions { display: flex; grid-column: 1 / -1; justify-content: center; gap: 14px; }
.ai-result-actions .orange-button, .ai-result-actions .outline-button, .ai-edit-open { min-height: 56px; padding: 0 25px; font-size: 14px; }
.ai-edit-open { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 999px; color: #fff; background: #111; font-weight: 600; cursor: pointer; transition: background-color .2s, transform .2s, opacity .2s; }
.ai-edit-open:hover { background: #2b2b2b; transform: translateY(-1px); }
.ai-edit-open:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.ai-edit-open svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.ai-result-status { grid-column: 1 / -1; margin: -8px 0 0; border-radius: 12px; padding: 11px 15px; color: #3d6b34; background: #eff8ec; font-size: 13px; text-align: center; }
.ai-edit-form { display: grid; grid-column: 1 / -1; gap: 15px; margin-top: 4px; border: 1px solid #ead8b9; border-radius: 20px; padding: 26px; background: #fffbf3; }
.ai-edit-heading { text-align: center; }
.ai-edit-heading .ai-design-kicker { margin-bottom: 6px; }
.ai-edit-heading h3 { margin: 0 0 7px; font-size: 24px; line-height: 1.2; }
.ai-edit-heading p { margin: 0; color: #777; font-size: 14px; font-weight: 300; line-height: 1.45; }
.ai-edit-form label { display: grid; gap: 9px; }
.ai-edit-form label > span { color: #333; font-size: 15px; font-weight: 600; }
.ai-edit-form textarea { width: 100%; min-height: 125px; resize: vertical; border: 1px solid #d8c8ac; border-radius: 15px; padding: 15px 16px; color: #111; background: #fff; font-size: 15px; font-weight: 300; line-height: 1.45; }
.ai-edit-form textarea:focus { border-color: #e89a1b; outline: 3px solid rgba(239, 160, 11, .16); }
.ai-edit-form textarea::placeholder { color: #aaa; }
.ai-edit-limit-note { margin: -3px 0 0; color: #8b6b35; font-size: 12px; font-weight: 300; text-align: center; }
.ai-edit-actions { display: flex; justify-content: center; gap: 10px; }
.ai-edit-actions .orange-button, .ai-edit-actions .outline-button { min-height: 52px; padding: 0 24px; font-size: 14px; }
.ai-edit-status { min-height: 19px; margin: -3px 0 0; color: #777; font-size: 13px; text-align: center; }
.ai-edit-status.is-error { color: #b3261e; }
.ai-page.ai-is-generating, .ai-page.ai-size-open { overflow: hidden; }
.ai-generation-overlay { position: fixed; z-index: 10000; inset: 0; display: grid; overflow-y: auto; place-items: center; padding: 22px; background: rgba(18, 18, 18, .66); backdrop-filter: blur(9px); }
.ai-generation-card { width: min(440px, 100%); border: 1px solid rgba(255, 255, 255, .7); border-radius: 28px; padding: 38px 30px 30px; background: rgba(255, 255, 255, .97); box-shadow: 0 24px 80px rgba(0, 0, 0, .28); text-align: center; }
.ai-generation-art { position: relative; width: 116px; height: 154px; margin: 0 auto 24px; }
.ai-generation-panel { position: relative; width: 100%; height: 100%; overflow: hidden; border: 8px solid #171717; border-radius: 5px; background: #214b44; box-shadow: 8px 10px 0 rgba(0, 0, 0, .12), 0 18px 34px rgba(0, 0, 0, .2); transform: perspective(500px) rotateY(-8deg); }
.ai-generation-shape { position: absolute; display: block; border: 3px solid #171717; background: #efa00b; box-shadow: 3px 3px 0 #171717; }
.ai-generation-shape-one { top: 25px; left: 28px; width: 45px; height: 45px; border-radius: 50%; }
.ai-generation-shape-two { top: 70px; left: 17px; width: 65px; height: 26px; border-radius: 45% 55% 42% 58%; background: #f2d2a2; transform: rotate(-8deg); }
.ai-generation-shape-three { right: 16px; bottom: 15px; width: 32px; height: 24px; border-radius: 4px; background: #cf5a3d; }
.ai-generation-scan { position: absolute; z-index: 2; top: -45%; left: -20%; width: 140%; height: 38%; background: linear-gradient(to bottom, transparent, rgba(255, 190, 58, .48), transparent); animation: ai-scan 2.25s ease-in-out infinite; }
.ai-generation-spark { position: absolute; z-index: 3; color: #efa00b; line-height: 1; animation: ai-spark 1.7s ease-in-out infinite; }
.ai-generation-spark-one { top: -9px; right: -21px; font-size: 27px; }
.ai-generation-spark-two { bottom: 16px; left: -23px; font-size: 18px; animation-delay: -.75s; }
.ai-generation-card .ai-design-kicker { margin-bottom: 8px; }
.ai-generation-card h2 { margin: 0; font-size: 29px; line-height: 1.18; }
.ai-generation-stage { min-height: 25px; margin: 13px 0 17px; color: #555; font-size: 16px; font-weight: 400; }
.ai-generation-progress { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: #ececec; }
.ai-generation-progress span { position: absolute; inset-block: 0; left: -42%; width: 42%; border-radius: inherit; background: linear-gradient(90deg, #e78f08, #ffc44d); animation: ai-progress 1.55s ease-in-out infinite; }
.ai-generation-note { margin: 20px 0 16px; color: #777; font-size: 14px; font-weight: 300; line-height: 1.55; }
.ai-generation-note strong { color: #222; font-weight: 600; }
.ai-generation-timer { display: inline-flex; min-height: 34px; align-items: center; border-radius: 999px; padding: 0 14px; color: #8b5b0c; background: #fff4de; font-size: 13px; font-weight: 600; }
.ai-size-overlay { position: fixed; z-index: 10001; inset: 0; display: grid; overflow-y: auto; place-items: center; padding: 22px; background: rgba(18, 18, 18, .62); backdrop-filter: blur(8px); }
.ai-size-card { position: relative; width: min(430px, 100%); border: 1px solid rgba(255, 255, 255, .75); border-radius: 26px; padding: 37px 30px 30px; background: #fff; box-shadow: 0 25px 75px rgba(0, 0, 0, .3); text-align: center; }
.ai-size-card .ai-design-kicker { margin-bottom: 7px; }
.ai-size-card h2 { margin: 0; color: #111; font-size: 28px; line-height: 1.18; }
.ai-size-card > p { margin: 12px auto 23px; color: #777; font-size: 15px; font-weight: 300; line-height: 1.45; }
.ai-size-close { position: absolute; top: 13px; right: 13px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; color: #333; background: #f2f2f2; font-size: 28px; font-weight: 300; line-height: 1; cursor: pointer; transition: color .2s, background-color .2s, transform .2s; }
.ai-size-close:hover { color: #fff; background: #222; transform: rotate(90deg); }
.ai-size-options { display: grid; gap: 10px; }
.ai-size-options button { display: flex; width: 100%; min-height: 72px; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #e2dfd7; border-radius: 16px; padding: 14px 18px; color: #151515; background: #fffdf8; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s, transform .2s; }
.ai-size-options button:hover, .ai-size-options button:focus-visible { border-color: #e7a331; background: #fff7e8; box-shadow: 0 8px 18px rgba(207, 130, 16, .14); outline: none; transform: translateY(-2px); }
.ai-size-options strong { font-size: 18px; font-weight: 600; }
.ai-size-options span { white-space: nowrap; color: #b66f06; font-size: 17px; font-weight: 700; }
@keyframes ai-scan { 0% { transform: translateY(0); opacity: 0; } 18% { opacity: 1; } 82% { opacity: 1; } 100% { transform: translateY(380%); opacity: 0; } }
@keyframes ai-spark { 0%, 100% { transform: scale(.75) rotate(0); opacity: .4; } 50% { transform: scale(1.15) rotate(18deg); opacity: 1; } }
@keyframes ai-progress { 0% { left: -42%; } 60%, 100% { left: 100%; } }

@media (max-width: 760px) {
  .ai-page-header-inner { width: calc(100% - 24px); min-height: 78px; }
  .ai-page-logo { width: 70px; }
  .ai-page-nav { gap: 6px; }
  .ai-page-nav a { padding: 9px 12px; font-size: 13px; }
  .ai-page-nav a:first-child { display: none; }
  .ai-page-generations { padding-inline: 11px !important; }
  .ai-page-main { padding: 18px 0 45px; }
  .ai-design-section { width: calc(100% - 24px); padding: 34px 16px 42px; border-radius: 18px; }
  .ai-design-heading { margin-bottom: 27px; }
  .ai-design-heading h1 { font-size: 30px; }
  .ai-design-heading p { font-size: 16px; }
  .ai-access-card { border-radius: 18px; padding: 28px 18px 22px; }
  .ai-access-card h2 { font-size: 23px; }
  .ai-access-actions { grid-template-columns: 1fr; }
  .ai-usage { margin: -5px 0 14px; text-align: center; }
  .ai-design-form, .ai-design-result { grid-template-columns: 1fr; gap: 15px; }
  .ai-mode-options { grid-template-columns: 1fr; }
  .ai-mode-options span { min-height: 62px; }
  .ai-photo-picker, .ai-photo-preview { min-height: 230px; }
  .ai-wishes-field textarea { min-height: 150px; }
  .ai-submit { width: 100%; }
  .ai-design-status { text-align: center; }
  .ai-result-copy { text-align: center; }
  .ai-result-copy h2 { font-size: 26px; }
  .ai-result-actions { display: grid; grid-column: auto; gap: 10px; }
  .ai-result-actions .orange-button, .ai-result-actions .outline-button, .ai-edit-open { width: 100%; }
  .ai-result-status, .ai-edit-form { grid-column: auto; }
  .ai-edit-form { padding: 21px 15px; }
  .ai-edit-heading h3 { font-size: 21px; }
  .ai-edit-actions { display: grid; }
  .ai-edit-actions .orange-button, .ai-edit-actions .outline-button { width: 100%; }
  .ai-generation-overlay { align-items: center; padding: 16px; }
  .ai-generation-card { border-radius: 24px; padding: 30px 20px 25px; }
  .ai-generation-art { width: 94px; height: 125px; margin-bottom: 20px; }
  .ai-generation-panel { border-width: 7px; }
  .ai-generation-shape-one { top: 19px; left: 22px; width: 38px; height: 38px; }
  .ai-generation-shape-two { top: 56px; left: 13px; width: 55px; height: 23px; }
  .ai-generation-shape-three { right: 12px; bottom: 11px; width: 27px; height: 20px; }
  .ai-generation-card h2 { font-size: 25px; }
  .ai-size-overlay { padding: 16px; }
  .ai-size-card { border-radius: 22px; padding: 33px 18px 20px; }
  .ai-size-card h2 { font-size: 25px; }
  .ai-size-options button { min-height: 66px; padding: 12px 15px; }
  .ai-size-options strong { font-size: 16px; }
  .ai-size-options span { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-generation-scan, .ai-generation-spark, .ai-generation-progress span { animation-duration: 4s; }
}
