@import url("https://fonts.googleapis.com/css2?family=Libre+Bodoni:wght@400;500;600;700&family=Public+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #fff8f9;
  --surface: #ffffff;
  --ink: #121212;
  --muted: #5f6673;
  --line: #eceef3;
  --soft: #f7f8fb;
  --accent: #ff6b84;
  --accent-soft: #fff0f3;
  --success: #397a73;
  --success-soft: #d8f0ec;
  --warning: #9a6d16;
  --warning-soft: #fff2b8;
  --danger: #a33d45;
  --danger-soft: #f7d7dc;
  --primary: var(--ink);
  --primary-dk: #000000;
  --text: var(--ink);
  --border: var(--line);
  --radius: 8px;
  --shadow: none;
  --shadow-sm: none;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration-thickness: .08em;
  text-underline-offset: .22em;
}

a:hover {
  color: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

.tool-site-nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 84px;
  margin: 30px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 26px;
  box-shadow: 0 10px 24px rgba(41, 35, 51, .04);
}

.tool-site-nav .brand {
  color: var(--ink);
  font-family: "Libre Bodoni", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tool-site-nav nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.tool-site-nav nav a,
.quick-search {
  color: inherit;
  text-decoration: none;
}

.quick-search {
  color: var(--ink);
  font-size: .98rem;
}

.quick-search::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
}

.quick-search::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 2px;
  margin-left: -5px;
  background: var(--accent);
  transform: rotate(45deg);
  vertical-align: -5px;
}

.grid-dots {
  width: 28px;
  height: 28px;
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-auto-rows: 8px;
  gap: 6px;
  background:
    radial-gradient(circle, var(--ink) 0 4px, transparent 5px) left top / 14px 14px repeat;
}

/* Index header */
.site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0 42px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.site-header h1 {
  margin: 0 0 14px;
  font-family: "Libre Bodoni", Georgia, serif;
  font-size: clamp(3.2rem, 8vw, 7rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0;
}

.site-header h1::before {
  content: "Aidar Karimov";
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-header h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 5px;
  margin-top: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.site-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

/* Tool header */
.tool-header {
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  margin: 34px auto 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tool-header .back-link {
  order: 2;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.tool-header .back-link:hover {
  border-color: #c9c1b4;
  color: var(--accent);
}

.tool-header h1 {
  margin: 0;
  font-family: "Libre Bodoni", Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.page-content,
.tool-container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.tool-container {
  max-width: 900px;
}

.category {
  margin-bottom: 54px;
}

.category-title {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.category-desc {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tool-card-link {
  position: relative;
  display: block;
  min-height: 180px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.tool-card-link:hover {
  transform: translateY(-2px);
  border-color: #ffd0d9;
  color: var(--ink);
}

.tool-card-link::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 4 / 1.35;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background:
    radial-gradient(circle at 78% 25%, rgba(255, 107, 132, .28) 0 13px, transparent 14px),
    linear-gradient(160deg, rgba(255, 240, 243, .95), rgba(247, 248, 251, .95));
}

.tool-card-link::after {
  content: "";
  position: absolute;
  top: 42px;
  left: 42px;
  width: 90px;
  height: 44px;
  border: 5px solid var(--ink);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 55% 45% 0 0;
  transform: rotate(-7deg);
  opacity: .9;
}

.tool-card-link .card-icon {
  display: none;
}

.tool-card-link .card-name {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.tool-card-link .card-desc {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.tool-card,
.seo-content,
.related-tools {
  background: linear-gradient(180deg, #ffffff, #fbfcff) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}

.tool-card {
  padding: clamp(22px, 4vw, 34px);
  margin-bottom: 24px;
}

.tool-description {
  max-width: 720px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1rem;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 800;
}

.form-hint {
  margin-top: 5px;
  color: var(--muted);
  font-size: .82rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  font-size: .96rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(18, 18, 18, .08);
  background: #fff;
}

.form-input:disabled {
  opacity: .72;
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-input[type="number"] {
  -moz-appearance: textfield;
}

.form-input[type="number"]::-webkit-inner-spin-button {
  display: none;
}

.input-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.input-row .form-group {
  flex: 1;
  min-width: 160px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: #c9c1b4;
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-sm {
  min-height: 38px;
  padding: 8px 12px;
  font-size: .82rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.result-box {
  margin-top: 20px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.result-box.success {
  background: var(--success-soft);
  border-left-color: var(--success);
}

.result-box.warning {
  background: var(--warning-soft);
  border-left-color: var(--warning);
}

.result-box.danger {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}

.result-value {
  color: var(--ink);
  font-family: "Libre Bodoni", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.result-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.result-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}

.result-item .result-value {
  font-size: 1.6rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  background: var(--soft);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.table tbody tr:hover {
  background: #fffdf9;
}

.table .mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.table .copy-btn {
  padding: 3px 8px;
  font-size: .75rem;
}

.alert {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .9rem;
}

.alert-info {
  background: var(--soft);
  color: var(--ink);
}

.alert-success {
  background: var(--success-soft);
  color: #235b55;
}

.alert-warning {
  background: var(--warning-soft);
  color: #74500f;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .76rem;
  font-weight: 800;
}

.badge-primary,
.badge-success,
.badge-warning {
  background: var(--soft);
  color: var(--ink);
}

.tabs,
.tab-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  border-bottom: 1px solid var(--line) !important;
  margin-bottom: 24px !important;
  padding-bottom: 0 !important;
}

.tab-btn,
.tab-nav button {
  min-height: 44px !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  padding: 10px 14px !important;
  font-size: .9rem !important;
  font-weight: 800 !important;
}

.tab-btn.active,
.tab-nav button[style*="var(--primary)"] {
  color: var(--ink) !important;
  border-bottom-color: var(--ink) !important;
}

.tab-panel,
.tab-content {
  display: none;
}

.tab-panel.active,
.tab-content.active {
  display: block;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}

.seo-content {
  margin-top: 34px !important;
  padding: clamp(22px, 4vw, 32px) !important;
  color: var(--ink) !important;
}

.seo-content h2,
.related-tools h3 {
  margin: 0 0 12px !important;
  color: var(--ink) !important;
  font-family: "Libre Bodoni", Georgia, serif !important;
  font-size: clamp(1.45rem, 3vw, 2.1rem) !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}

.seo-content p {
  color: var(--muted) !important;
  font-size: 1rem !important;
}

.related-tools {
  margin-top: 18px !important;
  padding: 22px !important;
}

.related-tools > div {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 12px !important;
}

.related-tools a {
  min-height: 54px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-weight: 800 !important;
  text-align: center !important;
  text-decoration: none !important;
}

.related-tools a:hover {
  border-color: #c9c1b4 !important;
  color: var(--accent) !important;
}

#copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 9999;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
  opacity: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  font-size: .88rem;
  transition: opacity .25s ease, transform .25s ease;
}

#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.stat-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  font-size: .82rem;
  font-weight: 700;
}

@media (max-width: 620px) {
  .tool-site-nav {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 24px;
    padding: 18px;
  }
  .tool-site-nav .quick-search {
    display: none;
  }
  .tool-site-nav nav {
    width: 100%;
    justify-content: space-between;
  }
  .tool-site-nav .brand {
    font-size: 1.55rem;
  }
  .tool-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
  }

  .tool-header .back-link {
    order: 0;
  }

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

@media (max-width: 600px) {
  .site-header {
    padding-top: 52px;
  }

  .site-header h1 {
    font-size: 3rem;
  }

  .tool-card {
    padding: 20px;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row > * {
    width: 100%;
  }
}

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

/* Atlas v2 alignment */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #072344;
  --muted: #5c6b7a;
  --line: #eceef1;
  --soft: #eff0f3;
  --accent: #00aaa1;
  --accent-soft: #cceeec;
  --success: #007c85;
  --success-soft: #cceeec;
  --warning: #daa512;
  --warning-soft: #f8edd0;
  --danger: #b45353;
  --danger-soft: #fde2e2;
  --primary: #072344;
  --primary-dk: #03162b;
  --text: #072344;
  --border: #eceef1;
  --radius: 0;
  --shadow: none;
  --shadow-sm: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a:hover {
  color: var(--accent);
}

.tool-site-nav {
  display: none;
}

.ak-tool-nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: Poppins, system-ui, sans-serif;
}

.ak-tool-nav nav {
  display: flex;
  gap: 20px;
}

.ak-tool-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.ak-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.site-header {
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--line);
}

.site-header h1,
.tool-header h1 {
  color: var(--ink);
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

.site-header h1::before,
.site-header h1::after {
  display: none;
}

.site-header p,
.category-desc,
.tool-description {
  color: var(--muted);
  font-weight: 300;
}

.stat-chip {
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--success);
  font-weight: 500;
}

.category-title {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.tools-grid {
  gap: 24px;
}

.tool-card-link {
  min-height: 0;
  border-color: var(--line);
  border-radius: 0;
  background: #fff;
  padding: 24px;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.tool-card-link:hover {
  border-color: var(--line);
  box-shadow: 0 14px 30px rgba(7, 35, 68, .08);
  transform: translateY(-2px);
}

.tool-card-link::before,
.tool-card-link::after,
.tool-card-link .card-icon {
  display: none;
}

.tool-card-link .card-name {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
}

.tool-card-link .card-desc {
  color: var(--ink);
  font-weight: 300;
}

.tool-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 32px;
  border-bottom: 1px solid var(--line);
}

.tool-header .back-link {
  border: 2px solid var(--accent);
  border-radius: 0;
  color: var(--accent);
  font-weight: 600;
}

.tool-header .back-link:hover {
  border-color: var(--success);
  color: var(--success);
}

.tool-container {
  width: min(900px, calc(100% - 32px));
  padding: 40px 0 72px;
}

.tool-card,
.seo-content,
.related-tools {
  border-color: var(--line) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.tool-card {
  padding: clamp(24px, 4vw, 36px);
}

.form-label {
  color: var(--ink);
  font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
  min-height: 48px;
  border-color: var(--line);
  border-radius: 0;
  background: #eff0f3;
  color: var(--ink);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 170, 161, .22);
}

.btn {
  border-radius: 0;
  font-weight: 600;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--success);
  background: var(--success);
}

.btn-secondary {
  border-color: var(--ink);
  background: #fff;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.result-box {
  border-color: var(--line);
  border-left: 16px solid var(--success);
  border-radius: 3px;
  background: var(--accent-soft);
}

.result-value {
  color: var(--ink);
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 600;
}

.result-item,
.table-wrap,
.alert,
.tab-btn,
.related-tools a {
  border-radius: 0 !important;
}

.table th {
  background: var(--soft);
  color: var(--ink);
}

.tabs,
.tab-nav {
  border-color: var(--line) !important;
}

.tab-btn.active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* Atlas typography fix for tool article blocks */
.seo-content,
.related-tools {
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.seo-content h2,
.related-tools h3 {
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: var(--ink) !important;
  font-size: clamp(1.25rem, 2.1vw, 1.65rem) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
}

.seo-content p {
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: var(--ink) !important;
  font-size: 1rem !important;
  font-weight: 300 !important;
  line-height: 1.7 !important;
}

.related-tools a {
  font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: var(--ink) !important;
  font-size: .95rem !important;
  font-weight: 600 !important;
}

.related-tools a:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

@media (max-width: 640px) {
  .ak-tool-nav {
    align-items: flex-start;
  }

  .ak-tool-nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
