/* heleum Реформатор — tool styles. Uses theme tokens from styles.css (--teal-*, --ink-*, etc.) */
.rf-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(40px, 6vw, 76px) 0 clamp(28px, 4vw, 40px);
  background:
    radial-gradient(120% 140% at 12% 0%, var(--teal-50), transparent 55%),
    radial-gradient(100% 120% at 100% 100%, rgba(127,219,218,.18), transparent 60%),
    #fff;
}
.brand-xtals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.xtal { position: absolute; border-radius: 22%; background: linear-gradient(150deg, #ffffff 0%, rgba(127,219,218,0.58) 100%); box-shadow: -10px 12px 30px rgba(20,90,90,0.10); animation: xtal-float 9s ease-in-out infinite; }
.xtal--1 { width: 104px; height: 104px; top: 6%;  right: 9%;  animation-delay: -1s; }
.xtal--2 { width: 66px;  height: 66px;  top: 33%; right: 24%; animation-delay: -3s; opacity: .9; }
.xtal--3 { width: 46px;  height: 46px;  top: 3%;  right: 33%; animation-delay: -2s; opacity: .8; }
.xtal--4 { width: 84px;  height: 84px;  top: 58%; right: 5%;  animation-delay: -4s; opacity: .85; }
.xtal--5 { width: 54px;  height: 54px;  top: 16%; left: 7%;   animation-delay: -2.4s; opacity: .8; }
.xtal--6 { width: 38px;  height: 38px;  top: 64%; left: 4%;   animation-delay: -5s; opacity: .6; }
@keyframes xtal-float { 0%,100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(0,-14px); } }
@media (prefers-reduced-motion: reduce) { .xtal { animation: none; } }
@media (max-width: 760px) { .xtal--2, .xtal--3, .xtal--6 { display: none; } .xtal--1 { width: 78px; height: 78px; } .xtal--4 { width: 60px; height: 60px; } }
.rf-hero__inner { max-width: 760px; }
.rf-hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; margin: 16px 0 0; }
.rf-hero h1 .accent { color: var(--teal-700); }
.rf-hero__sub { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-500); margin: 16px 0 0; max-width: 640px; }
.rf-trust { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rf-trust span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--teal-700); background: var(--teal-50); border: 1px solid var(--teal-100); border-radius: 999px; padding: 8px 14px; }
.rf-trust span svg { width: 15px; height: 15px; flex: none; }

/* Tool shell */
.rf-tool-wrap { padding: clamp(20px, 3vw, 32px) 0 clamp(48px, 6vw, 72px); }
.rf-tool { background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.rf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 16px clamp(16px, 2vw, 22px); border-bottom: 1px solid var(--ink-100); background: linear-gradient(180deg, #fff, var(--ink-50)); }
.rf-toolbar__group { display: flex; align-items: center; gap: 10px; }
.rf-toolbar__group--right { margin-left: auto; }
.rf-toolbar__label { font-family: var(--font-head); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-500); }
.rf-seg { display: inline-flex; background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: 10px; padding: 3px; gap: 2px; }
.rf-seg button { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink-500); padding: 8px 14px; border-radius: 7px; transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.rf-seg button:hover { color: var(--ink-900); }
.rf-seg button.is-active { background: #fff; color: var(--teal-700); box-shadow: var(--shadow-sm); }
.rf-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink-700); background: #fff; border: 1px solid var(--ink-100); border-radius: 999px; padding: 7px 13px 7px 11px; cursor: pointer; user-select: none; transition: border-color .2s, background .2s, color .2s; }
.rf-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rf-chip .rf-chip__dot { width: 16px; height: 16px; border-radius: 5px; flex: none; border: 1.5px solid var(--ink-300); background: #fff; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.rf-chip .rf-chip__dot svg { width: 10px; height: 10px; opacity: 0; transition: opacity .15s; color: #fff; }
.rf-chip:hover { border-color: var(--teal-300); }
.rf-chip:has(input:checked) { border-color: var(--teal-300); background: var(--teal-50); color: var(--teal-900); }
.rf-chip:has(input:checked) .rf-chip__dot { background: var(--teal-500); border-color: var(--teal-500); }
.rf-chip:has(input:checked) .rf-chip__dot svg { opacity: 1; }
.rf-chip:focus-within { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.rf-chip--extra { border-style: dashed; }
.rf-chip--extra .rf-chip__tag { font-size: 10px; font-family: var(--font-head); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-600); background: rgba(245,166,35,.12); border-radius: 4px; padding: 1px 5px; margin-left: 2px; }
.rf-pop { position: relative; }
.rf-pop__btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink-700); border: 1px solid var(--ink-100); border-radius: 10px; padding: 8px 13px; background: #fff; transition: border-color .2s; }
.rf-pop__btn:hover { border-color: var(--teal-300); }
.rf-pop__btn svg { width: 15px; height: 15px; }
.rf-pop__badge { font-family: var(--font-head); font-weight: 700; font-size: 11px; color: #fff; background: var(--teal-500); border-radius: 999px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.rf-pop__panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(340px, 86vw); background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 16px; display: none; }
.rf-pop.is-open .rf-pop__panel { display: block; }
.rf-pop__panel .rf-opts { flex-direction: column; align-items: stretch; gap: 6px; }
.rf-pop__panel .rf-chip { justify-content: flex-start; border-radius: 10px; }
.rf-pop__sep { height: 1px; background: var(--ink-100); margin: 12px 0; }
.rf-lang { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); font-family: var(--font-head); font-weight: 600; }
.rf-lang select { border: 1px solid var(--ink-100); border-radius: 8px; padding: 6px 10px; background: #fff; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink-900); }
.rf-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; font-family: var(--font-head); font-weight: 600; font-size: 13px; border-radius: 10px; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.rf-btn svg { width: 15px; height: 15px; }
.rf-btn:active { transform: translateY(1px); }
.rf-btn--copy { background: var(--orange-500); color: #fff; box-shadow: var(--shadow-orange); }
.rf-btn--copy:hover { background: var(--orange-600); transform: translateY(-1px); }
.rf-btn--ghost { background: #fff; color: var(--ink-700); border: 1px solid var(--ink-100); }
.rf-btn--ghost:hover { border-color: var(--teal-300); color: var(--teal-700); }
.rf-cols { display: grid; grid-template-columns: 1fr 1px 1fr; }
.rf-divider { background: var(--ink-100); }
.rf-pane { display: flex; flex-direction: column; min-width: 0; }
.rf-pane__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px clamp(16px, 2vw, 20px); border-bottom: 1px solid var(--ink-50); }
.rf-pane__title { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-900); display: inline-flex; align-items: center; gap: 8px; }
.rf-pane__title .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-500); }
.rf-pane__head--out .rf-pane__title .dot { background: var(--orange-500); }
.rf-live { font-family: var(--font-head); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-700); display: inline-flex; align-items: center; gap: 6px; }
.rf-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 0 rgba(77,216,216,.6); animation: rfpulse 2s infinite; }
@keyframes rfpulse { 0% { box-shadow: 0 0 0 0 rgba(77,216,216,.5);} 70%{ box-shadow: 0 0 0 7px rgba(77,216,216,0);} 100%{ box-shadow:0 0 0 0 rgba(77,216,216,0);} }
.rf-area { flex: 1; min-height: clamp(320px, 48vh, 560px); padding: clamp(16px, 2vw, 22px); overflow: auto; font-family: var(--font-body); font-size: 15.5px; line-height: 1.65; color: var(--ink-900); outline: none; }
#rf-input:empty::before { content: attr(data-placeholder); color: var(--ink-300); pointer-events: none; }
#rf-input { white-space: pre-wrap; word-break: break-word; }
#rf-input h1, #rf-input h2, #rf-input h3, #rf-input h4, #rf-input h5, #rf-input h6,
#rf-output h1, #rf-output h2, #rf-output h3, #rf-output h4, #rf-output h5, #rf-output h6 { line-height: 1.2 !important; margin: .45em 0 .25em !important; }
#rf-input > :first-child, #rf-output > :first-child { margin-top: 0 !important; }
#rf-input p, #rf-output p { margin: 0 0 .6em !important; line-height: 1.5 !important; }
#rf-input ul, #rf-input ol, #rf-output ul, #rf-output ol { margin: 0 0 .6em; padding-left: 1.4em; }
.rf-out-stack { position: relative; flex: 1; display: flex; min-width: 0; }
#rf-output { width: 100%; background: var(--ink-50); white-space: pre-wrap; word-break: break-word; }
#rf-output.rf-area--rendered { background: #fff; }
#rf-code { width: 100%; flex: 1; min-height: clamp(320px, 48vh, 560px); resize: none; border: 0; padding: clamp(16px, 2vw, 22px); background: #0E2A2A; color: #d7f5f5; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; outline: none; white-space: pre-wrap; word-break: break-word; overflow: auto; margin: 0; }
.rf-out-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--ink-500); pointer-events: none; }
.rf-out-empty.is-hidden { display: none; }
.rf-out-empty ol { text-align: left; margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; max-width: 280px; }
.rf-out-empty li { display: flex; gap: 10px; align-items: flex-start; }
.rf-out-empty .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal-50); color: var(--teal-700); font-family: var(--font-head); font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.rf-out-empty .rf-out-empty__ico { width: 34px; height: 34px; color: var(--ink-300); }
.rf-tool__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px clamp(16px, 2vw, 22px); border-top: 1px solid var(--ink-100); background: var(--ink-50); }
#rf-stats { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink-700); }
#rf-stats b { color: var(--teal-700); }
.rf-removed { font-size: 12.5px; color: var(--ink-500); }
.rf-removed b { color: var(--orange-600); }
.rf-priv { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-500); }
.rf-priv svg { width: 14px; height: 14px; color: var(--teal-600); }
.rf-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink-900); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 14px; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 9px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80; }
.rf-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rf-toast svg { width: 16px; height: 16px; color: var(--teal-300); }
.rf-prose { max-width: 760px; }
h2:has(+ .rf-prose) { max-width: 760px; }
.rf-prose p { color: var(--ink-500); }
.rf-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); margin-top: 8px; }
.rf-step { background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); }
.rf-step__n { width: 38px; height: 38px; border-radius: 11px; background: var(--teal-50); color: var(--teal-700); font-family: var(--font-head); font-weight: 800; font-size: 17px; display: grid; place-items: center; margin-bottom: 14px; }
.rf-step__t { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--ink-900); margin: 0 0 6px; }
.rf-step p { font-size: 14.5px; color: var(--ink-500); margin: 0; }
.rf-why { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rf-why__item { display: flex; gap: 14px; background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-md); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.rf-why__ico { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.rf-why__ico svg { width: 21px; height: 21px; }
.rf-why__t { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--ink-900); margin: 2px 0 5px; }
.rf-why__item p { font-size: 14px; color: var(--ink-500); margin: 0; }
@media (max-width: 920px) {
  .rf-cols { grid-template-columns: 1fr; }
  .rf-divider { display: none; }
  .rf-pane[data-pane="output"] { border-top: 1px solid var(--ink-100); }
  .rf-area, #rf-code { min-height: clamp(200px, 30vh, 300px); }
  .rf-toolbar { gap: 12px; padding: 14px; }
  .rf-toolbar__group { width: 100%; flex-wrap: wrap; }
  .rf-toolbar__group--right { margin-left: 0; }
  .rf-seg { width: 100%; }
  .rf-seg button { flex: 1; text-align: center; }
  .rf-pop { width: 100%; }
  .rf-pop__btn { width: 100%; justify-content: flex-start; }
  .rf-pop__panel { width: 100%; }
  .rf-toolbar__group--right .rf-btn { flex: 1 1 auto; justify-content: center; }
  .rf-btn--copy { flex: 1 1 100%; }
  .rf-btn { height: 46px; }
  .rf-steps { grid-template-columns: 1fr; }
  .rf-why { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .rf-toolbar__label { width: 100%; } .rf-tool__foot { gap: 8px; } .rf-priv { margin-left: 0; } }
