.ai-assistant-promo {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 164px;
  margin: 12px 0;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 91, 91, .3);
  border-radius: 15px;
  background:
    radial-gradient(ellipse at 86% 7%, rgba(201, 31, 31, .18), transparent 46%),
    linear-gradient(145deg, rgba(33, 35, 40, .96), rgba(15, 16, 19, .98));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.ai-assistant-promo::after {
  position: absolute;
  z-index: -1;
  top: -50px;
  right: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(209, 36, 36, .12);
  filter: blur(28px);
  content: "";
  transition: opacity .22s ease, transform .22s ease;
}

.ai-assistant-promo:hover,
.ai-assistant-promo:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 107, .72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .32), 0 0 20px rgba(205, 28, 28, .12);
  color: #fff;
  text-decoration: none;
}

.ai-assistant-promo:focus-visible {
  outline: 3px solid rgba(255, 107, 107, .5);
  outline-offset: 3px;
}

.ai-assistant-promo:hover::after {
  transform: scale(1.12);
  opacity: 1;
}

.ai-assistant-promo__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 117, 117, .26);
  border-radius: 30px;
  background: rgba(185, 29, 29, .13);
  color: #ffb1b1;
  font-size: .68rem;
  font-weight: 700;
}

.ai-assistant-promo__badge > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fa5656;
  box-shadow: 0 0 8px rgba(250, 86, 86, .65);
}

.ai-assistant-promo__icon {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 39px;
  height: 39px;
  color: #ff7777;
  animation: ai-icon-glow 3.2s ease-in-out infinite;
}

.ai-assistant-promo__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ai-assistant-promo__content {
  display: grid;
  gap: 5px;
  max-width: 100%;
  padding-left: 28px;
}

.ai-assistant-promo__content strong {
  color: #fff;
  font-size: .98rem;
  line-height: 1.6;
}

.ai-assistant-promo__content > span {
  color: rgba(244, 244, 246, .75);
  font-size: .77rem;
  line-height: 1.8;
}

.ai-assistant-promo__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  color: #ff8c8c;
  font-size: .76rem;
  font-weight: 800;
}

.ai-assistant-promo__action span {
  font-size: 1.1rem;
  transition: transform .2s ease;
}

.ai-assistant-promo:hover .ai-assistant-promo__action span {
  transform: translateX(-3px);
}

.ai-assistant-promo--mobile {
  display: none;
}

.ai-assistant-promo--sidebar {
  display: flex;
}

@keyframes ai-icon-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 90, 90, .12)); }
  50% { filter: drop-shadow(0 0 7px rgba(255, 90, 90, .38)); }
}

@font-face {
  font-family: "Iran Yekan";
  src: url("../fonts/iran-yekan-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Iran Yekan";
  src: url("../fonts/iran-yekan-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

.ai-assistant-page {
  --ai-red: #d52b2b;
  --ai-red-bright: #ed4545;
  --ai-bg: #101114;
  --ai-panel: #181a1f;
  --ai-border: rgba(255, 255, 255, .1);
  --ai-muted: #a4a5ad;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -22%, rgba(178, 30, 30, .17), transparent 52%),
    linear-gradient(180deg, #121316, #101114 56%);
  color: #f5f5f6;
  font-family: "Iran Yekan", Tahoma, Arial, sans-serif;
  overflow-x: hidden;
}

.ai-assistant-page *,
.ai-assistant-page *::before,
.ai-assistant-page *::after {
  box-sizing: border-box;
}

.ai-assistant-page [hidden] {
  display: none !important;
}

.ai-shell {
  display: flex;
  flex-direction: column;
  width: min(100% - 32px, 1120px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 0 16px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--ai-border);
  border-radius: 17px;
  background: rgba(24, 26, 31, .76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .13);
}

.ai-brand {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
}

.ai-brand img {
  display: block;
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.ai-header__copy {
  min-width: 0;
}

.ai-header__copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 2.6vw, 1.28rem);
  line-height: 1.6;
}

.ai-header__copy p {
  margin: 2px 0 0;
  color: var(--ai-muted);
  font-size: .82rem;
}

.ai-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-right: auto;
}

.ai-header__back {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--ai-border);
  border-radius: 10px;
  color: #dadbe0;
  font-size: .8rem;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease;
}

.ai-header__back:hover,
.ai-header__back:focus-visible {
  border-color: rgba(237, 69, 69, .45);
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

.ai-assistant-page :is(a, button, textarea, select, input):focus-visible {
  outline: 2px solid rgba(237, 69, 69, .8);
  outline-offset: 3px;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c1c2c8;
  font-size: .74rem;
  white-space: nowrap;
}

.ai-status i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #d79b48;
}

.ai-status.is-ready i {
  background: #53c68b;
  box-shadow: 0 0 8px rgba(83, 198, 139, .35);
}

.steel-calculator {
  margin-bottom: 15px;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 92% 0, rgba(213, 43, 43, .11), transparent 42%),
    rgba(24, 26, 31, .94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .2);
}

.steel-calculator [hidden] {
  display: none !important;
}

.steel-calculator__heading,
.steel-calculator__result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.steel-calculator__eyebrow,
.steel-calculator__result-heading > div > span {
  color: #ff8989;
  font-size: .72rem;
  font-weight: 800;
}

.steel-calculator h2 {
  margin: 4px 0;
  color: #fff;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
}

.steel-calculator__heading p {
  margin: 4px 0 0;
  color: #a7a8b0;
  font-size: .78rem;
  line-height: 1.8;
}

.steel-calculator__toggle,
.steel-calculator__reset,
.steel-calculator__copy {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: #dedee2;
  font: inherit;
  font-size: .73rem;
  cursor: pointer;
}

.steel-calculator__selectors,
.steel-calculator__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.steel-calculator__fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steel-calculator__control,
.steel-calculator__field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: #d7d8de;
  font-size: .75rem;
}

.steel-calculator__control > label,
.steel-calculator__field > label {
  color: #d7d8de;
}

.ai-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.ai-select {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
}

.ai-select.is-open {
  z-index: 40;
}

.ai-select__trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 11px;
  background: linear-gradient(145deg, #24262d, #1c1e23);
  color: #f5f5f6;
  font: inherit;
  font-size: .82rem;
  line-height: 1.7;
  text-align: right;
  direction: rtl;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.ai-select__trigger:hover {
  border-color: rgba(237, 69, 69, .42);
  background: #25272d;
}

.ai-select__trigger:focus-visible,
.ai-select.is-open .ai-select__trigger {
  border-color: rgba(237, 69, 69, .72);
  box-shadow: 0 0 0 3px rgba(200, 39, 39, .13);
  outline: 0;
}

.ai-select__trigger:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ai-select__value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-select__chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 1.5px solid #c9cbd2;
  border-bottom: 1.5px solid #c9cbd2;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.ai-select.is-open .ai-select__chevron {
  transform: rotate(225deg) translate(-2px, -1px);
}

.ai-select__list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: min(320px, 42dvh);
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 13px;
  background: #1b1d22;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .48), 0 3px 12px rgba(0, 0, 0, .28);
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, .24) transparent;
  scrollbar-width: thin;
}

.ai-select__list[data-placement="top"] {
  top: auto;
  bottom: calc(100% + 7px);
}

.ai-select__group-label {
  display: block;
  padding: 9px 10px 5px;
  color: #ef8585;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.6;
}

.ai-select__option {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 11px;
  border-radius: 8px;
  color: #dedfe4;
  font-size: .78rem;
  line-height: 1.7;
  text-align: right;
  direction: rtl;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.ai-select__option:hover,
.ai-select__option.is-active {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.ai-select__option[aria-selected="true"] {
  background: rgba(213, 43, 43, .18);
  box-shadow: inset -3px 0 #d52b2b;
  color: #fff;
}

.ai-select__option[aria-disabled="true"] {
  opacity: .48;
  cursor: not-allowed;
}

.steel-calculator__control select:not(.ai-select__native),
.steel-calculator__field input,
.steel-calculator__field select:not(.ai-select__native) {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  outline: 0;
  background: #202228;
  color: #f5f5f6;
  font: inherit;
  font-size: .82rem;
}

.steel-calculator__control select:not(.ai-select__native):focus,
.steel-calculator__field input:focus,
.steel-calculator__field select:not(.ai-select__native):focus {
  border-color: rgba(218, 66, 66, .7);
  box-shadow: 0 0 0 3px rgba(200, 39, 39, .1);
}

.steel-calculator__field small {
  color: #858791;
  font-size: .67rem;
}

.steel-calculator__notice,
.steel-calculator__source,
.steel-calculator__rounding {
  margin: 12px 0 0;
  color: #a5a6ae;
  font-size: .72rem;
  line-height: 1.8;
}

.steel-calculator__error {
  margin: 12px 0 0;
  color: #ff9a9a;
  font-size: .8rem;
}

.steel-calculator__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.steel-calculator__submit {
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #e04444, #b61e1e);
  color: #fff;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}

.steel-calculator__submit:disabled {
  opacity: .6;
  cursor: wait;
}

.steel-calculator__result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.steel-calculator__result-heading {
  align-items: center;
}

.steel-calculator__result h3 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 1rem;
}

.steel-calculator__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.steel-calculator__metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
}

.steel-calculator__metric span {
  color: #989aa3;
  font-size: .7rem;
}

.steel-calculator__metric strong {
  color: #fff;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.steel-calculator__details {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) 1.3fr;
  gap: 7px 12px;
  margin: 14px 0 0;
  font-size: .75rem;
}

.steel-calculator__details dt {
  color: #92949e;
}

.steel-calculator__details dd {
  margin: 0;
  color: #e6e6e9;
  overflow-wrap: anywhere;
}

.steel-calculator__formula {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-right: 2px solid #d52b2b;
  background: rgba(255, 255, 255, .025);
  color: #d5d6dc;
  font-size: .75rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.steel-calculator__formula strong {
  color: #fff;
}

.ai-workspace {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: min(720px, calc(100dvh - 154px));
  min-height: 500px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--ai-border);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 92% 0, rgba(213, 43, 43, .065), transparent 34%),
    rgba(24, 26, 31, .94);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .035);
  backdrop-filter: blur(12px);
}

.ai-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 26px clamp(16px, 4vw, 42px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
  scrollbar-width: thin;
}

.ai-message {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(100%, 790px);
  animation: ai-message-in .2s ease-out both;
}

.ai-message--assistant {
  align-self: flex-start;
}

.ai-message--user {
  align-self: flex-end;
  max-width: min(88%, 660px);
}

.ai-welcome {
  width: 100%;
  max-width: 930px;
  gap: 11px;
  margin: auto 0;
  padding: 8px 0;
}

.ai-welcome__eyebrow {
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid rgba(237, 69, 69, .2);
  border-radius: 30px;
  background: rgba(213, 43, 43, .09);
  color: #ff9a9a;
  font-size: .7rem;
  font-weight: 700;
}

.ai-welcome h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  line-height: 1.7;
}

.ai-welcome > p {
  max-width: 720px;
  margin: 0;
  color: #b7b8bf;
  font-size: .86rem;
  line-height: 2;
}

.ai-welcome > .ai-welcome__note {
  color: #898b95;
  font-size: .75rem;
}

.ai-bubble {
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 16px 16px 16px 5px;
  background: #22242a;
  color: #e8e8ec;
  font-size: .9rem;
  line-height: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
  direction: rtl;
  unicode-bidi: plaintext;
  white-space: pre-wrap;
}

.ai-message--assistant {
  width: 100%;
  max-width: 100%;
}

.ai-message--assistant .ai-bubble {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e8e8ec;
  overflow: visible;
  white-space: normal;
}

.ai-markdown {
  min-width: 0;
  direction: rtl;
  unicode-bidi: plaintext;
  line-height: 2;
  overflow-wrap: anywhere;
}

.ai-markdown > :first-child { margin-top: 0; }
.ai-markdown > :last-child { margin-bottom: 0; }

.ai-markdown p {
  margin: 0 0 1rem;
}

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3,
.ai-markdown h4,
.ai-markdown h5,
.ai-markdown h6 {
  margin: 1.45em 0 .55em;
  color: #fff;
  font-weight: 700;
  line-height: 1.65;
}

.ai-markdown h1 { font-size: 1.45rem; }
.ai-markdown h2 { font-size: 1.25rem; }
.ai-markdown h3 { font-size: 1.08rem; }
.ai-markdown h4,
.ai-markdown h5,
.ai-markdown h6 { font-size: .98rem; }

.ai-markdown ul,
.ai-markdown ol {
  margin: .4rem 0 1rem;
  padding-inline-start: 1.7rem;
}

.ai-markdown li {
  padding-inline-start: .2rem;
}

.ai-markdown li + li {
  margin-top: .2rem;
}

.ai-markdown li > ul,
.ai-markdown li > ol {
  margin: .2rem 0 .35rem;
}

.ai-markdown blockquote {
  margin: 1rem 0;
  padding: .65rem 1rem;
  border-inline-start: 3px solid var(--ai-red-bright);
  border-radius: 5px;
  background: rgba(255, 255, 255, .045);
  color: #c9c9cf;
}

.ai-markdown blockquote > :last-child {
  margin-bottom: 0;
}

.ai-markdown hr {
  height: 1px;
  margin: 1.4rem 0;
  border: 0;
  background: rgba(255, 255, 255, .14);
}

.ai-markdown strong {
  color: #fff;
}

.ai-markdown a {
  color: #ffaaaa;
  text-decoration: underline;
  text-decoration-color: rgba(255, 170, 170, .55);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.ai-markdown a:hover,
.ai-markdown a:focus-visible {
  color: #fff;
}

.ai-markdown code {
  display: inline-block;
  max-width: 100%;
  padding: .05em .4em;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 5px;
  background: rgba(255, 255, 255, .07);
  color: #ffd1d1;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: Consolas, "Courier New", monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}

.ai-code-block {
  max-width: 100%;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  background: #111216;
}

.ai-code-block__toolbar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #a4a5ad;
  font-family: Consolas, "Courier New", monospace;
  font-size: .72rem;
  direction: ltr;
}

.ai-code-block__copy {
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: transparent;
  color: #dedee2;
  font: inherit;
  font-family: "Iran Yekan", Tahoma, Arial, sans-serif;
  cursor: pointer;
  direction: rtl;
}

.ai-code-block__copy:hover,
.ai-code-block__copy:focus-visible {
  border-color: rgba(237, 69, 69, .55);
  color: #ffb0b0;
}

.ai-code-block pre {
  max-width: 100%;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  color: #f0f0f2;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  white-space: pre;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.ai-code-block pre code {
  display: block;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: .86rem;
  line-height: 1.7;
  overflow-wrap: normal;
}

.ai-table-scroll {
  max-width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  direction: rtl;
  -webkit-overflow-scrolling: touch;
}

.ai-markdown table {
  width: 100%;
  border-collapse: collapse;
  color: #e8e8ec;
  line-height: 1.8;
}

.ai-markdown th,
.ai-markdown td {
  min-width: 90px;
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  text-align: start;
}

.ai-markdown th {
  background: rgba(213, 43, 43, .12);
  color: #fff;
  font-weight: 700;
}

.ai-markdown tr:last-child td {
  border-bottom: 0;
}

.ai-message__actions {
  display: flex;
  align-items: center;
}

.ai-bubble a {
  color: #ffaaaa;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ai-bubble a:hover {
  color: #fff;
}

.ai-message--user .ai-bubble {
  border-color: rgba(223, 57, 57, .2);
  border-radius: 16px 16px 5px 16px;
  background: rgba(172, 37, 37, .16);
  color: #fff;
}

.ai-typing .ai-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  color: #bfc0c7;
  font-size: .8rem;
}

.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a8a9b0;
  animation: ai-typing 1s ease-in-out infinite;
}

.ai-typing__label {
  margin-right: 5px;
}

.ai-typing i:nth-child(2) { animation-delay: .14s; }
.ai-typing i:nth-child(3) { animation-delay: .28s; }

.ai-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.ai-starter {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  color: #dedee2;
  font: inherit;
  font-size: .77rem;
  text-align: right;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ai-starter__icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(237, 69, 69, .2);
  border-radius: 10px;
  background: rgba(213, 43, 43, .09);
  color: #ff9292;
  direction: ltr;
  font-size: .68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ai-starter > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ai-starter strong {
  color: #f2f2f4;
  font-size: .78rem;
}

.ai-starter small {
  color: #999ba4;
  font-size: .68rem;
  line-height: 1.6;
}

.ai-starter:hover,
.ai-starter:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(239, 79, 79, .35);
  background: rgba(180, 39, 39, .09);
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .12);
}

.ai-result {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
}

.ai-result h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: .93rem;
}

.ai-result__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.ai-result__item {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .17);
}

.ai-result__item span {
  display: block;
  margin-bottom: 5px;
  color: #92949e;
  font-size: .7rem;
}

.ai-result__item strong {
  display: block;
  color: #e9e9ed;
  font-size: .81rem;
  overflow-wrap: anywhere;
}

.ai-result__item--price strong {
  color: #ff7777;
}

.ai-result__note {
  margin: 10px 0 0;
  color: #b7b8bf;
  font-size: .76rem;
  line-height: 1.9;
}

.ai-result__formula {
  display: block;
  margin-top: 8px;
  color: #898b95;
  font-size: .7rem;
}

.ai-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-result__actions button,
.ai-result__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: transparent;
  color: #dedee2;
  font: inherit;
  font-size: .73rem;
  text-decoration: none;
  cursor: pointer;
}

.ai-result__actions button:hover,
.ai-result__actions a:hover {
  border-color: rgba(243, 84, 84, .45);
  color: #ff9a9a;
}

.ai-composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 clamp(12px, 3vw, 28px) 13px;
  padding: 11px 12px 27px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  background: #202228;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.ai-composer:focus-within {
  border-color: rgba(218, 66, 66, .55);
  box-shadow: 0 0 0 3px rgba(200, 39, 39, .08);
}

.ai-composer textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  overflow-y: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f6f6f7;
  font: inherit;
  font-size: .88rem;
  line-height: 1.8;
}

.ai-composer textarea::placeholder {
  color: #888a94;
}

.ai-send {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #e04444, #b61e1e);
  color: #fff;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.ai-send:hover,
.ai-send:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.ai-send:disabled {
  opacity: .55;
  cursor: wait;
}

.ai-send svg {
  width: 20px;
  height: 20px;
}

.ai-composer__hint {
  position: absolute;
  right: 13px;
  bottom: 5px;
  margin: 0;
  color: #898b95;
  font-size: .64rem;
}

.ai-message__copy {
  align-self: flex-start;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 8px;
  background: transparent;
  color: #9c9ea7;
  font: inherit;
  font-size: .68rem;
  cursor: pointer;
}

.ai-message__copy:hover,
.ai-message__copy:focus-visible {
  border-color: rgba(237, 69, 69, .35);
  color: #ffaaaa;
}

.ai-message__copy,
.ai-code-block__copy {
  touch-action: manipulation;
}

.ai-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 3px 0;
  color: #777983;
  font-size: .7rem;
  line-height: 1.8;
}

.ai-footer a {
  color: #b7b8bf;
  text-decoration: none;
}

.ai-footer a:hover {
  color: #ff9b9b;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ai-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ai-typing {
  0%, 60%, 100% { opacity: .4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (min-width: 768px) {
  .ai-assistant-promo--mobile { display: none; }
  .ai-assistant-promo--sidebar { display: flex; }
}

@media (max-width: 767px) {
  .ai-assistant-promo--mobile { display: flex; }
  .ai-assistant-promo--sidebar { display: none; }
  .ai-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 0;
    overflow: visible;
  }
  .ai-header {
    display: grid;
    grid-template-areas:
      "brand copy"
      "actions actions";
    grid-template-columns: 43px minmax(0, 1fr);
    row-gap: 7px;
    min-height: 61px;
    gap: 9px;
    margin: 10px 10px 12px;
    padding: 8px 10px;
    border-radius: 14px;
  }
  .ai-brand {
    grid-area: brand;
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    border-radius: 12px;
  }
  .ai-brand img { width: 35px; height: 35px; }
  .ai-header__copy { grid-area: copy; min-width: 0; }
  .ai-header__copy h1 { font-size: .9rem; }
  .ai-header__copy p { display: none; }
  .ai-header__actions {
    grid-area: actions;
    width: 100%;
    justify-content: space-between;
    gap: 7px;
    margin: 0;
    padding: 0 2px;
  }
  .ai-status { gap: 5px; font-size: .63rem; }
  .ai-header__back { min-height: 36px; padding: 6px 8px; font-size: .66rem; }
  .steel-calculator {
    margin: 10px;
    padding: 14px;
    border-radius: 15px;
  }
  .steel-calculator__heading { gap: 8px; }
  .steel-calculator__heading p { font-size: .7rem; }
  .steel-calculator__toggle { padding: 7px; font-size: .65rem; }
  .steel-calculator__selectors,
  .steel-calculator__fields { grid-template-columns: 1fr 1fr; gap: 9px; }
  .steel-calculator__selectors .steel-calculator__control:first-child { grid-column: 1 / -1; }
  .ai-select__trigger {
    min-height: 48px;
    padding: 11px 12px;
    font-size: .77rem;
  }
  .ai-select__list { max-height: min(360px, 44dvh); }
  .ai-select__option { min-height: 48px; padding: 10px 12px; }
  .steel-calculator__control select:not(.ai-select__native),
  .steel-calculator__field input,
  .steel-calculator__field select:not(.ai-select__native) { min-height: 41px; font-size: .75rem; }
  .steel-calculator__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steel-calculator__metric { padding: 9px; }
  .steel-calculator__metric strong { font-size: .79rem; }
  .ai-workspace {
    width: auto;
    height: min(74dvh, 760px);
    min-height: 460px;
    flex: none;
    margin: 0 10px;
    border-radius: 15px;
  }
  .ai-messages {
    min-height: 0;
    gap: 15px;
    padding: 17px 13px;
    scroll-behavior: auto;
  }
  .ai-welcome { gap: 9px; padding: 3px 0; }
  .ai-welcome h2 { font-size: 1.18rem; }
  .ai-welcome > p { font-size: .78rem; }
  .ai-welcome > .ai-welcome__note { font-size: .7rem; }
  .ai-bubble {
    padding: 12px 13px;
    font-size: .84rem;
  }
  .ai-starters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ai-starter { min-height: 64px; gap: 7px; padding: 8px; }
  .ai-starter__icon { width: 29px; height: 29px; flex-basis: 29px; border-radius: 8px; }
  .ai-starter strong { font-size: .71rem; }
  .ai-starter small { font-size: .62rem; }
  .ai-message--assistant { max-width: 100%; }
  .ai-message--user { max-width: 94%; }
  .ai-code-block__toolbar { min-height: 44px; }
  .ai-code-block pre { padding: 12px; }
  .ai-code-block pre code { font-size: .8rem; }
  .ai-message__copy,
  .ai-code-block__copy { min-height: 44px; }
  .ai-markdown h1 { font-size: 1.22rem; }
  .ai-markdown h2 { font-size: 1.1rem; }
  .ai-markdown h3 { font-size: 1rem; }
  .ai-markdown th,
  .ai-markdown td { min-width: 110px; padding: .5rem .65rem; }
  .ai-result { padding: 11px; }
  .ai-result__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .ai-composer {
    margin: 0 9px 8px;
    padding: 8px 9px 25px;
  }
  .ai-composer textarea { min-height: 44px; font-size: 16px; }
  .ai-composer__hint { font-size: .61rem; }
  .ai-footer {
    padding: 8px 12px max(12px, env(safe-area-inset-bottom));
    font-size: .64rem;
  }
}

@media (max-width: 380px) {
  .ai-header { gap: 7px; margin-right: 7px; margin-left: 7px; padding-right: 8px; padding-left: 8px; }
  .ai-header__actions { gap: 5px; }
  .ai-header__back { padding-right: 6px; padding-left: 6px; font-size: .61rem; }
  .ai-status { font-size: .59rem; }
  .ai-workspace { width: auto; margin-right: 7px; margin-left: 7px; }
  .ai-starter { gap: 5px; padding: 7px 6px; }
  .ai-starter small { font-size: .59rem; }
  .ai-result__grid { grid-template-columns: 1fr 1fr; }
  .steel-calculator__heading { flex-direction: column; }
  .steel-calculator__fields { grid-template-columns: 1fr; }
  .ai-footer { flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant-promo__icon,
  .ai-message,
  .ai-typing i {
    animation: none;
  }
  .ai-assistant-promo,
  .ai-assistant-promo::after,
  .ai-assistant-promo__action span,
  .ai-starter,
  .ai-header__back,
  .ai-send {
    transition: none;
  }
  .ai-messages { scroll-behavior: auto; }
}
