@import url('https://fonts.cdnfonts.com/css/ia-writer-duo-s');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #ffffff;
  color: #1a1a1a;
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
}

.wrapper {
  width: 960px;
  margin: 0 auto;
  padding: 60px 0 80px;
}

@media (max-width: 1020px) {
  .wrapper {
    width: 100%;
    padding: 40px 24px 60px;
  }
}

@media (max-width: 640px) {
  .wrapper {
    padding: 28px 16px 48px;
  }

  h1 {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .intro {
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 100%;
  }

  .search-bar {
    max-width: 100%;
    margin-bottom: 16px;
  }

  .tabs {
    margin-bottom: 20px;
  }

  .column-header {
    padding: 12px 16px;
  }

  .columns {
    flex-direction: column;
  }

  .column {
    padding: 20px 16px;
  }

  .column.left {
    padding-bottom: 0;
  }

  .section {
    margin-bottom: 22px;
  }

  .section ul li[data-tooltip]:hover::before {
    display: none;
  }

  .micro-empty {
    padding: 40px 16px;
  }

  .outro {
    font-size: 15px;
    margin-top: 40px;
  }
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

.intro {
  font-size: 16px;
  line-height: 1.65;
  color: #1a1a1a;
  margin-bottom: 32px;
  max-width: 560px;
}

/* --- Search --- */
.search-bar {
  position: relative;
  margin-bottom: 20px;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 15px;
  padding: 8px 36px 8px 12px;
  border: 1px solid #d0d0d0;
  background: #f8f8f8;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s;
}

.search-bar input:focus {
  border-color: #888;
  background: #fff;
}

.search-bar input::placeholder {
  color: #aaa;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #aaa;
  pointer-events: none;
  line-height: 1;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid #d0d0d0;
}

.tab {
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 20px 8px 0;
  margin-bottom: -1px;
  cursor: pointer;
  color: #888;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: #1a1a1a;
}

.tab.active {
  color: #1a1a1a;
  border-bottom-color: #1a1a1a;
  font-weight: 700;
}

/* --- Empty state --- */
.micro-empty {
  padding: 60px 32px;
}

.empty-state {
  font-size: 15px;
  color: #aaa;
}

/* --- Columns block --- */
.columns-block {
  background-color: #f8f8f8;
  padding: 0;
}

.column-header {
  display: flex;
  justify-content: space-between;
  padding: 14px 32px;
  background-color: #f8f8f8;
}

.column-header span {
  font-size: 16px;
  font-weight: 700;
}

.columns {
  display: flex;
  align-items: flex-start;
}

.column {
  flex: 1;
  padding: 28px 32px;
}

/* --- Sections --- */
.section {
  margin-bottom: 28px;
}

.section:last-child {
  margin-bottom: 0;
}

.section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-count {
  font-size: 13px;
  font-weight: 400;
  color: #aaa;
}

.section ul {
  list-style: none;
  padding: 0;
}

/* --- List items --- */
.section ul li {
  font-size: 15px;
  line-height: 1.65;
  color: #1a1a1a;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  padding: 2px 0;
  border-radius: 3px;
  transition: background 0.12s;
}

.section ul li:hover {
  background: #efefef;
  padding-left: 6px;
  margin-left: -6px;
  padding-right: 4px;
}

.section ul li a {
  color: #1a1a1a;
  text-decoration: none;
  flex: 1;
  transition: color 0.12s;
}

.section ul li:hover a {
  color: #000;
}

.section ul li a::after {
  content: ' →';
  opacity: 0;
  transition: opacity 0.12s;
  font-size: 14px;
  color: #888;
}

.section ul li:hover a::after {
  opacity: 1;
}

/* Tooltip */
.section ul li[data-tooltip] {
  cursor: default;
}

.section ul li[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  background: #1a1a1a;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 5px 9px;
  white-space: normal;
  max-width: 280px;
  z-index: 10;
  pointer-events: none;
}

/* --- Outro --- */
.outro {
  font-size: 16px;
  line-height: 1.65;
  color: #1a1a1a;
  margin-top: 60px;
}

/* ================================================
   СТОРІНКА КАЛЬКУЛЯТОРА
   ================================================ */

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: #aaa;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #1a1a1a;
}

.breadcrumb-sep {
  color: #d0d0d0;
}

.breadcrumb-current {
  color: #1a1a1a;
}

/* --- Formula block --- */
.formula-block {
  background: #f8f8f8;
  padding: 24px 32px;
  margin-bottom: 36px;
}

.formula {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.formula-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-size: 14px;
  color: #666;
}

.formula-legend span b {
  color: #1a1a1a;
}

/* --- Calc block --- */
.calc-block {
  margin-bottom: 48px;
}

.calc-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 15px;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  max-width: 320px;
}

.input-wrap input {
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 16px;
  padding: 9px 12px;
  border: 1px solid #d0d0d0;
  border-right: none;
  background: #fff;
  color: #1a1a1a;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.input-wrap input:focus {
  border-color: #888;
}

.input-unit {
  font-size: 14px;
  color: #888;
  background: #f8f8f8;
  border: 1px solid #d0d0d0;
  padding: 9px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-hint {
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
}

.nx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 500px;
}

.nx-row .input-wrap {
  flex: 1;
  max-width: none;
}

.nx-minus {
  font-size: 20px;
  color: #888;
  flex-shrink: 0;
}

/* --- Result --- */
.calc-result {
  background: #f8f8f8;
  padding: 24px 32px;
  margin-bottom: 20px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.result-label {
  font-size: 14px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-value {
  font-size: 34px;
  font-weight: 700;
  color: #ccc;
  transition: color 0.2s;
  line-height: 1.2;
}

.calc-result.has-result .result-value {
  color: #1a1a1a;
}

.result-unit {
  font-size: 15px;
  color: #888;
}

.result-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 14px;
  color: #888;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

.result-breakdown small {
  color: #aaa;
}

.result-breakdown .sep {
  color: #ccc;
}

/* --- Buttons --- */
.calc-actions {
  display: flex;
  gap: 12px;
}

.btn-calc {
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 10px 28px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-calc:hover {
  background: #333;
}

.btn-reset {
  font-family: 'iA Writer Duo S', 'Courier New', monospace;
  font-size: 15px;
  background: none;
  color: #888;
  border: 1px solid #d0d0d0;
  padding: 10px 20px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-reset:hover {
  color: #1a1a1a;
  border-color: #888;
}

/* --- Info block --- */
.info-block {
  border-top: 1px solid #e8e8e8;
  padding-top: 36px;
}

.info-block h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  margin-top: 28px;
}

.info-block h2:first-child {
  margin-top: 0;
}

.info-block p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  max-width: 600px;
}

.info-table {
  display: flex;
  flex-direction: column;
  max-width: 680px;
}

.info-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
}

.info-row:first-child {
  border-top: 1px solid #f0f0f0;
}

.info-col-key {
  font-size: 15px;
  font-weight: 700;
  width: 40px;
  flex-shrink: 0;
  padding-top: 1px;
}

.info-col-val {
  font-size: 15px;
  color: #555;
  line-height: 1.65;
}

/* --- Mobile (calculator) --- */
@media (max-width: 640px) {
  .formula-block {
    padding: 18px 16px;
  }

  .formula {
    font-size: 18px;
  }

  .formula-legend {
    gap: 4px 16px;
  }

  .input-wrap {
    max-width: 100%;
  }

  .nx-row {
    max-width: 100%;
  }

  .calc-result {
    padding: 18px 16px;
  }

  .result-value {
    font-size: 26px;
  }

  .calc-actions {
    flex-direction: column;
  }

  .btn-calc,
  .btn-reset {
    width: 100%;
    text-align: center;
  }
}

/* --- Chart block --- */
.chart-block {
  margin-top: 36px;
  margin-bottom: 48px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.chart-wrap {
  background: #f8f8f8;
  padding: 24px;
  position: relative;
  height: 360px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 640px) {
  .chart-wrap {
    height: 260px;
    padding: 16px;
  }
}

/* --- Site header --- */
.site-header {
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
}

.site-header-inner {
  width: 960px;
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-logo:hover {
  color: #444;
}

.site-slogan {
  font-size: 13px;
  color: #aaa;
}

/* --- Site footer --- */
.site-footer {
  border-top: 1px solid #e8e8e8;
  margin-top: 80px;
}

.site-footer-inner {
  width: 960px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #aaa;
}

/* --- Mobile header/footer --- */
@media (max-width: 1020px) {
  .site-header-inner,
  .site-footer-inner {
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 640px) {
  .site-header-inner {
    padding-left: 16px;
    padding-right: 16px;
    flex-direction: column;
    gap: 4px;
  }

  .site-footer-inner {
    padding-left: 16px;
    padding-right: 16px;
    flex-direction: column;
    gap: 4px;
  }

  .site-slogan {
    font-size: 12px;
  }
}
