* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --brand: #012F46;
  --accent: #ED0A3A;
  --accent-soft: rgba(237, 10, 58, .09);
  --text: #1f2933;
  --muted: #74808a;
  --line: #d9e1e6;
  --panel: #eef3f6;
  --panel-strong: #e4edf2;
  --surface: #ffffff;
}
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #fbfcfd;
}
.topbar {
  min-height: 96px;
  padding: 16px clamp(18px, 4vw, 48px) 14px;
  display: grid;
  grid-template-columns: auto minmax(360px, 760px);
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 80px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--brand);
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  width: clamp(118px, 13vw, 168px);
  height: auto;
  display: block;
}
.brand-divider {
  width: 1px;
  height: 34px;
  background: var(--line);
}
.brand-title {
  font-size: clamp(22px, 2.5vw, 31px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
}
.shell { padding: 0 clamp(18px, 4vw, 48px); }
.seo-intro {
  max-width: 760px;
  margin: 0;
  color: var(--brand);
  justify-self: end;
  text-align: right;
}
.seo-intro h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.08;
  font-weight: 820;
}
.seo-intro h2 {
  max-width: 760px;
  margin: 8px 0 0;
  color: #52616b;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.35;
  font-weight: 620;
}

.workspace {
  min-height: calc(100vh - 258px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: clamp(14px, 2vw, 26px);
  padding: clamp(14px, 2.2vw, 26px);
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid #e6edf1;
}
.control-panel {
  order: 2;
  display: grid;
  align-content: start;
  gap: 12px;
}
.result-card {
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
}
.result-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255,255,255,.76);
  font-size: 15px;
  font-weight: 720;
}
.time-row {
  display: grid;
  grid-template-columns: minmax(60px, auto) auto minmax(60px, auto) auto;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.78);
  font-size: 18px;
  font-weight: 720;
}
.time-row output {
  min-width: 56px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: #fff;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.main-time {
  margin-top: 14px;
  color: #fff;
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.08;
  font-weight: 820;
}
.speed-control {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 5px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.speed-track {
  position: absolute;
  inset: 5px;
  border-radius: 7px;
  background: #edf3f6;
  pointer-events: none;
}
.speed-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / 3);
  height: 100%;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(237, 10, 58, .22);
  transition: transform .2s ease;
}
.speed-control[data-speed="slow"] .speed-thumb { transform: translateX(0); }
.speed-control[data-speed="medium"] .speed-thumb { transform: translateX(100%); }
.speed-control[data-speed="fast"] .speed-thumb { transform: translateX(200%); }
.speed-control label {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.speed-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.speed-control label span {
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: color .16s ease;
}
.speed-control input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: -3px; }
.speed-control input:checked + span { color: #fff; }
.stats-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 2px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}
.stats-line span { white-space: nowrap; }
.stats-line strong {
  color: var(--brand);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.editor-panel { order: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; }
.editor-label {
  color: var(--brand);
  font-size: 15px;
  font-weight: 780;
}
textarea {
  width: 100%;
  min-height: clamp(360px, 48vh, 560px);
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 2vw, 26px);
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  font-size: clamp(20px, 1.8vw, 23px);
  font-weight: 500;
  line-height: 1.6;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea::placeholder { color: #98a4ad; font-weight: 650; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.site-footer {
  min-height: 122px;
  margin: 18px clamp(18px, 4vw, 48px) 0;
  padding: 24px clamp(20px, 5vw, 56px);
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(230px, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  color: #fff;
  background: var(--brand);
}
.footer-brand {
  display: contents;
}
.footer-logo {
  grid-column: 1;
  justify-self: start;
  width: clamp(138px, 13vw, 192px);
  max-width: 100%;
  display: block;
  border-radius: 0;
  background: transparent;
}
.footer-logo img {
  width: 100%;
  height: auto;
  display: block;
}
.footer-brand-text {
  grid-column: 2;
  max-width: 360px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
}
.footer-metrics {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(34px, 5vw, 86px);
}
.footer-metric { min-width: min(310px, 100%); display: grid; gap: 7px; }
.footer-metric span { color: rgba(255,255,255,.82); font-size: clamp(15px, 1.5vw, 19px); font-weight: 720; }
.footer-metric strong { color: #fff; font-size: clamp(26px, 2.5vw, 34px); line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.footer-metric strong::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: middle;
}
.footer-metric strong span { color: inherit; font: inherit; }


.target-card, .analysis-card {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.target-card { padding: 18px; }
.target-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.target-head span, .analysis-title { color: var(--brand); font-size: 16px; font-weight: 820; }
.target-head strong { color: var(--muted); font-size: 15px; line-height: 1.25; text-align: right; font-weight: 780; }
.target-custom { display: grid; grid-template-columns: minmax(92px, .9fr) minmax(0, 1.6fr); align-items: stretch; gap: 10px; }
.target-toggle { min-width: 0; }
.target-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.target-toggle span {
  min-height: 66px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.05;
  cursor: pointer;
  text-align: center;
}
.target-toggle input:not(:checked) + span { color: var(--brand); background: #edf3f6; }
.target-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-fields label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  padding: 0 14px;
  border-radius: 8px;
  background: #edf3f6;
  color: var(--brand);
  font-size: 18px;
  font-weight: 820;
}
.target-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 27px;
  font-weight: 850;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.target-fields input:disabled { opacity: .42; }
.target-fields label:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 430px) { .target-custom { grid-template-columns: 1fr; } }

.analysis-card {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.target-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.target-head span, .analysis-title { color: var(--brand); font-size: 13px; font-weight: 800; }
.target-head strong { color: var(--muted); font-size: 12px; line-height: 1.25; text-align: right; font-weight: 760; }
.target-custom { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.target-toggle { min-width: 78px; }
.target-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.target-toggle span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  text-align: center;
}
.target-toggle input:not(:checked) + span { color: var(--brand); background: #edf3f6; }
.target-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.target-fields label {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 7px;
  background: #edf3f6;
  color: var(--brand);
  font-size: 12px;
  font-weight: 780;
}
.target-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 15px;
  font-weight: 820;
  text-align: center;
}
.target-fields input:disabled { opacity: .45; }
.analysis-card { display: grid; gap: 9px; margin-top: 0; padding: 12px 14px; }
.analysis-card[hidden] { display: none; }
.analysis-card ul { display: grid; gap: 7px; margin: 0; padding: 0; }
.analysis-card li { list-style: none; position: relative; padding-left: 14px; color: #53636d; font-size: 13px; line-height: 1.35; font-weight: 650; }
.analysis-card li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.analysis-card .analysis-ok::before { background: #1c8b5f; }
@media (max-width: 430px) { .target-custom { grid-template-columns: 1fr; } }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr; justify-content: start; gap: 12px; }
  .seo-intro { justify-self: start; text-align: left; max-width: 760px; }
  .workspace { grid-template-columns: 1fr; }
  .editor-panel { order: 1; }
  .control-panel { order: 2; grid-template-columns: 1fr; align-items: start; }
  .result-card { grid-row: auto; }
  textarea { min-height: 420px; }
}
@media (max-width: 720px) {
  .topbar { min-height: auto; padding-top: 18px; }
  .brand { gap: 11px; flex-wrap: wrap; }
  .brand-logo { width: 112px; }
  .brand-divider { height: 28px; }
  .brand-title { font-size: 22px; }
  .shell { padding-inline: 12px; }
  .seo-intro { margin-bottom: 10px; }
  .seo-intro h1 { font-size: 25px; }
  .seo-intro h2 { font-size: 15px; }
  .workspace { padding: 12px; gap: 14px; }
  .control-panel { grid-template-columns: 1fr; }
  .result-card { padding: 16px; }
  textarea { min-height: 330px; font-size: 20px; padding: 18px; }
  .site-footer { margin: 14px 12px 0; grid-template-columns: 1fr; gap: 18px; padding: 24px 20px; text-align: left; }
  .footer-brand { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); align-items: center; gap: 16px; }
  .footer-logo { grid-column: 1; width: 150px; }
  .footer-brand-text { grid-column: 2; max-width: 260px; font-size: 12px; }
  .footer-metrics { grid-column: 1; width: 100%; flex-direction: row; align-items: stretch; justify-content: space-between; gap: 12px; }
  .footer-metric { min-width: 0; flex: 1 1 0; gap: 6px; }
  .footer-metric span { font-size: 12px; line-height: 1.2; }
  .footer-metric strong { font-size: clamp(21px, 6vw, 28px); white-space: nowrap; }
  .footer-metric strong::before { width: 8px; height: 8px; margin-right: 6px; }
}
@media (max-width: 430px) {
  .topbar { padding-inline: 14px; }
  .brand-divider { display: none; }
  .brand-title { flex-basis: 100%; }
  .time-row { grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr) auto; }
}

.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.clear-button { min-height: 34px; padding: 0 14px; border: 1px solid rgba(1, 47, 70, .14); border-radius: 8px; color: var(--brand); background: #fff; font: inherit; font-size: 13px; font-weight: 760; cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease; }
.clear-button:hover:not(:disabled) { color: #fff; border-color: var(--accent); background: var(--accent); }
.clear-button:disabled { opacity: .45; cursor: default; }
.cookie-modal { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: min(430px, calc(100vw - 36px)); }
.cookie-card { padding: 18px; display: grid; gap: 14px; border: 1px solid rgba(1, 47, 70, .16); border-radius: 8px; background: rgba(255, 255, 255, .98); box-shadow: 0 18px 46px rgba(1, 47, 70, .16); color: var(--text); }
.cookie-card h2 { margin: 0 0 7px; color: var(--brand); font-size: 18px; line-height: 1.15; }
.cookie-card p { margin: 0; color: #53636d; font-size: 13px; line-height: 1.45; font-weight: 560; }
.cookie-details { margin-top: 10px; }
.cookie-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cookie-actions button { min-height: 36px; padding: 0 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 780; cursor: pointer; }
.cookie-more { border: 1px solid var(--line); color: var(--brand); background: #fff; }
.cookie-accept { border: 1px solid var(--accent); color: #fff; background: var(--accent); }
@media (max-width: 720px) { .editor-head { align-items: stretch; flex-direction: column; gap: 8px; } .clear-button { width: 100%; } .cookie-modal { inset: auto 12px 12px 12px; width: auto; } .cookie-actions { display: grid; grid-template-columns: 1fr 1fr; } }

