:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #eef5f7;
  --ink: #102029;
  --muted: #62717b;
  --border: #d9e5ea;
  --accent: #00c77b;
  --accent-strong: #03a96b;
  --blue: #246bfe;
  --warn: #f59f00;
  --danger: #e03131;
  --shadow: 0 22px 55px rgba(24, 44, 56, 0.12);
  --shadow-soft: 0 10px 28px rgba(24, 44, 56, 0.08);
  --shadow-lift: 0 18px 46px rgba(24, 44, 56, 0.13);
  --focus-ring: rgba(36, 107, 254, 0.38);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #071216;
  --surface: #0e1c22;
  --surface-soft: #13272f;
  --ink: #f2fbff;
  --muted: #9eb1ba;
  --border: #24414b;
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(36, 107, 254, 0.12), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--surface-soft));
  color: var(--ink);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  text-decoration-skip-ink: auto;
}

button,
a,
select,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--accent);
}

.brand-mark svg {
  width: 25px;
  fill: currentColor;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  max-width: min(42vw, 210px);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(18, 38, 48, 0.06);
  font-size: 0.9rem;
  font-weight: 850;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

[data-theme="dark"] .language-switcher {
  background: rgba(14, 28, 34, 0.86);
}

.topbar-actions .unit-select {
  display: none;
}

.icon-button,
.unit-select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(18, 38, 48, 0.06);
  transition: transform 120ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

[data-theme="dark"] .icon-button,
[data-theme="dark"] .unit-select {
  background: rgba(14, 28, 34, 0.86);
}

.icon-button {
  display: grid;
  width: 40px;
  place-items: center;
  padding: 0;
}

.icon-button:hover,
.install-button:hover,
.language-switcher:hover,
.unit-select:hover {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--border));
  box-shadow: var(--shadow-soft);
}

.icon-button:active,
.install-button:active,
.mode-button:active,
.unit-button:active,
.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.converter-tab:active,
.converter-chip:active,
.calculator-presets button:active {
  transform: scale(0.96);
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.unit-select {
  padding: 0 34px 0 12px;
}

.speed-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.speed-copy h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.speed-copy p {
  max-width: 520px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 16px auto 0;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(18, 38, 48, 0.06);
  font-size: 0.92rem;
  font-weight: 850;
  transition: transform 120ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.install-button[hidden] {
  display: none;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: min(520px, 100%);
  max-width: 100%;
  margin: 16px auto 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(18, 38, 48, 0.06);
}

.mode-button {
  overflow: hidden;
  min-height: 38px;
  min-width: 64px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 120ms ease, background-color 160ms ease, color 160ms ease;
}

.mode-button.is-active {
  background: var(--ink);
  color: var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 10%, transparent);
}

.mode-button:not(.is-active):hover,
.unit-button:not(.is-active):hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.speedometer {
  position: relative;
  overflow: hidden;
  width: min(760px, 100%);
  max-width: 100%;
  min-height: 500px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    var(--surface);
  box-shadow: var(--shadow);
}

.speedometer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .speedometer {
  background:
    linear-gradient(145deg, rgba(14, 28, 34, 0.96), rgba(19, 39, 47, 0.7)),
    var(--surface);
}

.dial {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.dial-track,
.dial-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  mask: radial-gradient(circle, transparent 58%, #000 59%);
}

.dial-track {
  background: conic-gradient(from 225deg, var(--border) 0deg 270deg, transparent 270deg);
}

.dial-fill {
  background: conic-gradient(from 225deg, var(--accent) 0deg, var(--blue) var(--dial-deg, 0deg), transparent var(--dial-deg, 0deg));
  transition: background 240ms ease;
}

.needle {
  display: none;
}

.needle::after {
  content: none;
}

.speed-readout {
  position: absolute;
  inset: 108px 28px auto;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.speed-value {
  font-size: clamp(5.4rem, 12vw, 8.8rem);
  font-weight: 850;
  line-height: 0.86;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.speed-unit {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 750;
}

.unit-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: min(320px, 92vw);
  max-width: 100%;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 22px rgba(18, 38, 48, 0.08);
  pointer-events: auto;
}

.unit-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 120ms ease, background-color 160ms ease, color 160ms ease;
}

.unit-button.is-active {
  background: var(--ink);
  color: var(--surface);
}

.status-line {
  min-height: 44px;
  margin: -18px auto 22px;
  max-width: 490px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  text-align: center;
  line-height: 1.45;
}

.controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 120ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease;
}

.primary-button {
  background: var(--accent);
  color: #031612;
  box-shadow: 0 12px 26px rgba(0, 199, 123, 0.22);
}

.secondary-button {
  background: var(--ink);
  color: var(--surface);
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.primary-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 16px 34px rgba(0, 199, 123, 0.26);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: color-mix(in srgb, var(--blue) 30%, var(--border));
  box-shadow: var(--shadow-soft);
}

.button-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.button-icon svg {
  width: 18px;
  fill: currentColor;
}

.button-icon path {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.speedometer.is-alerting {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(224, 49, 49, 0.12), var(--shadow);
}

.modal-open {
  overflow: hidden;
}

.gps-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 18, 22, 0.48);
  backdrop-filter: blur(7px);
}

.gps-modal[hidden] {
  display: none;
}

.gps-modal-card {
  width: min(520px, 100%);
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(7, 18, 22, 0.28);
}

.gps-modal-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.15;
}

.gps-modal-copy {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.gps-modal-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-inline-start: 20px;
  color: var(--muted);
}

.install-steps li {
  line-height: 1.45;
}

.gps-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.gps-modal-actions .ghost-button,
.gps-modal-actions .secondary-button {
  min-width: 104px;
  padding: 0 18px;
}

.gps-continue-button {
  outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 3px;
}

.speedometer.is-alerting .speed-value,
.status-line[data-tone="bad"],
.alert-state[data-tone="bad"] {
  color: var(--danger);
}

.status-line[data-tone="good"],
.alert-state[data-tone="good"] {
  color: var(--accent-strong);
}

.status-line[data-tone="warn"],
.alert-state[data-tone="warn"] {
  color: var(--warn);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin-top: 18px;
}

.stat-card {
  min-width: 0;
  min-height: 106px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(24, 44, 56, 0.045);
}

.stat-label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.85rem;
}

.privacy-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-soft);
}

.privacy-strip svg {
  flex: 0 0 auto;
  width: 34px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.privacy-strip h2,
.content-section h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.privacy-strip p {
  margin: 6px 0 0;
  color: color-mix(in srgb, var(--surface) 74%, transparent);
  line-height: 1.55;
}

.tools-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  min-width: 0;
  margin-top: 18px;
}

.tool-panel,
.history-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 10px 26px rgba(24, 44, 56, 0.055);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.panel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.alert-controls {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.alert-controls label,
.alert-controls span,
.chart-scale {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.alert-controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 850;
  font-size: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.alert-state {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.chart-wrap {
  position: relative;
  min-width: 0;
  min-height: 236px;
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 34%, transparent), transparent);
}

.speed-chart {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 12px;
  overflow: visible;
  touch-action: none;
}

.chart-grid {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(0, 199, 123, 0.12);
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  filter: drop-shadow(0 4px 5px rgba(36, 107, 254, 0.16));
}

.chart-axis {
  fill: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.chart-cursor {
  stroke: var(--ink);
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
  opacity: 0.52;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 4;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  min-width: 112px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  padding: 8px 10px;
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip span {
  margin-top: 3px;
  color: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 0.78rem;
}

.chart-empty {
  position: absolute;
  inset: 52% 22px auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.4;
  text-align: center;
}

.history-section {
  margin-top: 18px;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.history-empty {
  margin: 0;
  color: var(--muted);
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  min-width: 0;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 8px;
  font-weight: 900;
}

.history-title time {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.history-share {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-weight: 850;
}

.app-shell.is-fullscreen {
  min-height: 100vh;
  width: min(1280px, calc(100% - 28px));
}

.content-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  min-width: 0;
  margin-top: 42px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.seo-deep-dive {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
  min-width: 0;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.content-section p,
.seo-deep-dive p,
.faq-list p {
  color: var(--muted);
  line-height: 1.7;
}

.faq-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.related-section {
  min-width: 0;
  margin-top: 26px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.related-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.related-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

details p {
  margin: 0;
  padding: 0 18px 18px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(140px, 0.8fr));
  gap: 24px;
  min-width: 0;
  margin-top: 42px;
  padding: 30px 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.site-footer nav {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color 160ms ease, transform 120ms ease;
}

.site-footer a:hover,
.blog-card a:hover,
.blog-sidebar a:hover {
  color: var(--blue);
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  max-width: 330px;
}

.article-main {
  max-width: 860px;
  margin: 52px auto 0;
}

.article-main h1 {
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.article-main h2 {
  margin: 38px 0 10px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
}

.article-main p,
.article-main li {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.article-main a {
  color: var(--blue);
  font-weight: 800;
}

[dir="rtl"] body {
  text-align: right;
}

[dir="rtl"] .brand,
[dir="rtl"] .topbar,
[dir="rtl"] .control-row,
[dir="rtl"] .mode-tabs,
[dir="rtl"] .stat-card,
[dir="rtl"] .history-title,
[dir="rtl"] .history-metrics,
[dir="rtl"] .site-footer,
[dir="rtl"] .content-section,
[dir="rtl"] .article-main {
  direction: rtl;
}

[dir="rtl"] .speed-readout,
[dir="rtl"] .unit-switcher,
[dir="rtl"] .gauge-wrap,
[dir="rtl"] .speed-chart {
  direction: ltr;
}

.article-panel {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 44, 56, 0.045);
}

.article-panel p {
  margin: 0;
}

.blog-main {
  max-width: 1180px;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}

.blog-content {
  min-width: 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.blog-card,
.blog-sidebar {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 44, 56, 0.055);
}

.blog-card {
  padding: 20px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--blue) 26%, var(--border));
  box-shadow: var(--shadow-lift);
}

.blog-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.blog-card p {
  margin: 0 0 16px;
}

.blog-card a,
.blog-sidebar a,
.blog-read {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color 160ms ease;
}

.blog-read {
  display: inline-flex;
  margin-top: 4px;
  color: var(--blue);
}

.blog-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.blog-sidebar a {
  padding: 9px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 44%, transparent);
}

.blog-sidebar h2 {
  margin: 10px 0 2px;
  font-size: 1rem;
}

.blog-sidebar h2:first-child {
  margin-top: 0;
}

.converter-main {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 40px 0 64px;
}

.converter-hero {
  max-width: 880px;
  margin-bottom: 24px;
}

.converter-hero h1 {
  margin: 8px 0 12px;
  color: var(--ink);
  font-size: 3rem;
  line-height: 1.05;
}

.converter-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.converter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.converter-tab {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.converter-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.converter-card,
.converter-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter-card {
  padding: 28px;
}

.converter-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.converter-card h2,
.converter-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.45rem;
}

.converter-card-head p {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.converter-copy,
.converter-swap,
.converter-chip {
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.converter-copy {
  min-width: 92px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
}

.converter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  gap: 18px;
  align-items: end;
}

.converter-field,
.converter-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
}

.converter-field span {
  grid-column: 1 / -1;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.converter-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2.6rem;
  font-weight: 900;
  outline: 0;
}

.converter-field strong,
.converter-result strong {
  color: var(--muted);
  font-size: 1.05rem;
}

.converter-result span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 2.6rem;
  font-weight: 900;
}

.converter-swap {
  display: grid;
  min-height: 104px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 1.8rem;
}

.converter-swap span {
  font-size: 0.78rem;
}

.converter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.converter-chip {
  min-width: 68px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--ink);
}

.converter-support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.converter-panel {
  padding: 24px;
}

.converter-panel table {
  width: 100%;
  border-collapse: collapse;
}

.converter-panel caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.converter-panel td {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.converter-panel td:last-child {
  color: var(--ink);
  font-weight: 900;
  text-align: end;
}

.converter-related {
  display: grid;
  gap: 10px;
}

.converter-related a {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.7fr) repeat(3, minmax(90px, 0.65fr));
  gap: 12px;
  margin-top: 18px;
}

.converter-field select {
  width: 100%;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  outline: 0;
}

.calculator-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.calculator-result {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
}

.calculator-result span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 900;
}

.calculator-result strong {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.calculator-gps-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(0, 201, 135, 0.32);
  border-radius: 8px;
  background: #08232d;
  color: #fff;
}

.calculator-gps-cta h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.25rem;
}

.calculator-gps-cta p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.calculator-gps-cta a {
  flex: 0 0 auto;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #06141a;
  font-weight: 900;
  text-decoration: none;
}

.calculator-presets button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: start;
}

@media (max-width: 880px) {
  .content-section,
  .seo-deep-dive,
  .tools-section,
  .converter-support-grid {
    grid-template-columns: 1fr;
  }

  .converter-grid {
    grid-template-columns: 1fr;
  }

  .calculator-grid,
  .calculator-results {
    grid-template-columns: 1fr 1fr;
  }

  .calculator-gps-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .converter-swap {
    min-height: 56px;
  }

  .blog-layout,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
  }

  .speed-copy h1 {
    max-width: 100%;
    font-size: clamp(1.7rem, 8vw, 2.5rem);
  }

  .speedometer {
    min-height: 470px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 12px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
  }

  .topbar .brand {
    flex: 1 1 auto;
  }

  .topbar .language-switcher {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  .topbar-actions {
    gap: 8px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .brand span:last-child {
    font-size: 1rem;
  }

  .speed-section {
    gap: 18px;
  }

  .speed-copy p {
    margin-top: 12px;
    font-size: 0.98rem;
  }

  .speedometer {
    min-height: 500px;
    padding: 18px 14px;
  }

  .dial {
    width: min(100%, 420px);
  }

  .speed-readout {
    inset: 106px 14px auto;
  }

  .status-line {
    margin-top: -28px;
    font-size: 0.92rem;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .gps-modal {
    align-items: end;
    padding: 12px;
  }

  .gps-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-selector {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .mode-selector::-webkit-scrollbar {
    display: none;
  }

  .mode-button {
    flex: 0 0 auto;
    min-width: 74px;
    padding: 0 10px;
    font-size: 0.82rem;
    scroll-snap-align: start;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 96px;
    padding: 14px;
  }

  .privacy-strip {
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }

  .tool-panel,
  .history-section {
    padding: 18px 14px;
  }

  .panel-heading {
    gap: 12px;
  }

  .panel-heading h2 {
    font-size: 1.12rem;
  }

  .chart-wrap {
    min-height: 226px;
  }

  .speed-chart {
    height: 210px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .converter-main {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .converter-hero h1 {
    font-size: 2.1rem;
  }

  .converter-tabs {
    grid-template-columns: 1fr;
  }

  .converter-card {
    padding: 18px 14px;
  }

  .converter-card-head {
    display: grid;
  }

  .converter-copy {
    width: 100%;
  }

  .converter-field input,
  .converter-result span {
    font-size: 2.1rem;
  }

  .calculator-grid,
  .calculator-results {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
