@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Manrope:wght@300;400;500;600&display=swap");
:root {
  --ink: #17221d;
  --soft: #68736b;
  --cream: #f5f2eb;
  --paper: #fffdf8;
  --line: #d9d6cc;
  --gold: #ac8b64;
  --forest: #1d2b24;
  --display: Manrope, "IBM Plex Sans Arabic", sans-serif;
  --body: "IBM Plex Sans Arabic", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
}
.tools-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 16px clamp(18px, 5vw, 76px);
  background: #17211d;
  color: #f5f2eb;
  border-bottom: 1px solid #ffffff18;
}
.tools-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.tools-brand .brand-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #ac8b64;
  border-radius: 50%;
  color: #d5af80;
  font-size: 20px;
}
.tools-brand b,
.tools-brand small {
  display: block;
}
.tools-brand b {
  font-weight: 500;
  font-size: 15px;
}
.tools-brand small {
  margin-top: 3px;
  color: #aeb7ae;
  font: 8px var(--display);
  letter-spacing: 0.11em;
  direction: ltr;
}
.tools-nav nav {
  display: flex;
  gap: 24px;
}
.tools-nav nav a,
.back-home {
  color: #d8d7cc;
  text-decoration: none;
  font-size: 11px;
}
.back-home {
  border: 1px solid #d5af8066;
  padding: 9px 14px;
  border-radius: 2px;
}
.tools-shell {
  max-width: 1280px;
  margin: auto;
  padding: 0 clamp(18px, 4vw, 56px) 80px;
}
.tools-hero {
  position: relative;
  padding: 75px 0 56px;
  border-bottom: 1px solid var(--line);
}
.tools-hero .eyebrow {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #8e7352;
}
.tools-hero h1 {
  font-size: clamp(48px, 8vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.06em;
  font-weight: 500;
  margin: 20px 0 18px;
}
.tools-hero h1 em {
  font-style: normal;
  color: #947653;
}
.tools-hero > p {
  max-width: 680px;
  color: var(--soft);
  line-height: 2;
  font-size: 14px;
}
.privacy-stamp {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  color: #738076;
  font-size: 10px;
}
.privacy-stamp span:first-child {
  border: 1px solid #b19a7b;
  padding: 5px 9px;
  color: #866d4e;
  font: 9px var(--display);
  letter-spacing: 0.1em;
}
.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.7fr);
  align-items: start;
  gap: 30px;
  margin-top: 35px;
}
.calculator-form {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(18px, 3vw, 34px);
}
.form-section {
  padding: 0 0 26px;
  margin: 0 0 25px;
  border-bottom: 1px solid #e5e2d9;
}
.section-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
}
.section-kicker b {
  color: #a17c50;
  font: 11px var(--display);
}
.fields {
  display: grid;
  gap: 15px;
}
.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fields label,
.waste-field label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #46544a;
  font-size: 11px;
}
.fields input,
.fields select,
.material-row input,
.material-row select,
.waste-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d5d2c7;
  border-radius: 3px;
  background: #fff;
  color: #25322b;
  font: 13px var(--body);
}
input::placeholder {
  color: #aaa99f;
  font-size: 11px;
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #aa895f;
  outline-offset: 2px;
}
.unit {
  color: #aa875b;
  font-size: 10px;
  margin-right: 3px;
}
.mode-switch {
  display: flex;
  gap: 7px;
  margin: -2px 0 18px;
}
.mode-button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid #d5d2c7;
  background: #f6f3ec;
  color: #58645c;
  font: 11px var(--body);
  cursor: pointer;
}
.mode-button.active {
  background: var(--forest);
  color: #f7f1e7;
  border-color: var(--forest);
}
.formula-note {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  background: #f1efe8;
  color: #727970;
  font-size: 10px;
  line-height: 1.8;
}
.waste-field {
  display: grid;
  grid-template-columns: minmax(140px, 0.38fr) 1fr;
  align-items: end;
  gap: 16px;
  margin-top: 17px;
  padding: 13px 15px;
  background: #f4f1e9;
  border-right: 2px solid #b49772;
}
.waste-field p {
  margin: 0;
  color: #747970;
  font-size: 10px;
  line-height: 1.8;
}
.waste-field p b {
  color: #96754f;
}
.section-help {
  margin: -6px 0 15px;
  color: #777d74;
  font-size: 10px;
  line-height: 1.8;
}
.material-rows {
  display: grid;
  gap: 9px;
}
.material-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 80px 110px 115px 34px;
  gap: 7px;
  align-items: center;
}
.material-row .unit-label {
  font-size: 9px;
  color: #83877e;
}
.remove-material {
  height: 35px;
  border: 1px solid #dedbd1;
  background: #f8f5ef;
  color: #766c5e;
  cursor: pointer;
}
.add-material {
  margin-top: 12px;
  border: 1px dashed #b9b1a2;
  background: transparent;
  padding: 10px 13px;
  color: #6c644f;
  font: 11px var(--body);
  cursor: pointer;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.calculate-button {
  min-height: 46px;
  padding: 11px 20px;
  border: 0;
  background: #1d2b24;
  color: #f9f4e9;
  font: 12px var(--body);
  cursor: pointer;
}
.calculate-button span {
  margin-right: 16px;
  color: #d5af80;
}
.reset-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #d4d0c6;
  background: transparent;
  color: #626d63;
  font: 11px var(--body);
  cursor: pointer;
}
.form-message {
  min-height: 25px;
  margin: 12px 0 0;
  color: #7c7569;
  font-size: 10px;
}
.form-message.error {
  color: #a2473b;
}
.result-panel {
  position: sticky;
  top: 18px;
  padding: 25px;
  background: #1c2822;
  color: #f4f0e5;
  box-shadow: 0 20px 40px #19241d1c;
}
.result-label {
  color: #d1b58f;
  font: 9px var(--display);
  letter-spacing: 0.13em;
  direction: ltr;
  text-align: right;
}
.result-panel h2 {
  margin: 13px 0 19px;
  font-size: 25px;
  font-weight: 500;
}
.result-empty {
  padding: 23px 15px;
  border: 1px solid #ffffff24;
  color: #bcc4b9;
  font-size: 11px;
  line-height: 1.9;
}
.result-panel.has-result .result-empty {
  display: none;
}
.report-preview {
  color: #f2eee4;
}
.report-preview[hidden],
.report-actions[hidden] {
  display: none;
}
.report-title {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 500;
}
.report-subtitle {
  margin: 0 0 18px;
  color: #c5bcae;
  font-size: 10px;
}
.report-image {
  display: block;
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  margin: 0 0 15px;
  border: 1px solid #ffffff23;
}
.report-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #ffffff2b;
  border-right: 1px solid #ffffff2b;
  margin: 16px 0;
}
.report-stat {
  min-height: 74px;
  padding: 12px 10px;
  border-bottom: 1px solid #ffffff2b;
  border-left: 1px solid #ffffff2b;
}
.report-stat span {
  display: block;
  color: #c2c6bd;
  font-size: 9px;
}
.report-stat b {
  display: block;
  margin-top: 8px;
  color: #ead3b2;
  font: 15px var(--display);
}
.report-list {
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #ffffff20;
  color: #d3d6cd;
  font-size: 10px;
}
.report-list li b {
  color: #eddbbf;
  font-weight: 500;
}
.report-note {
  padding: 12px;
  background: #ffffff0b;
  color: #c2c9bf;
  font-size: 9px;
  line-height: 1.8;
}
.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}
.report-actions button,
.report-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px;
  border: 1px solid #a89579;
  background: #26352d;
  color: #f3ede1;
  text-align: center;
  text-decoration: none;
  font: 10px var(--body);
  cursor: pointer;
}
.report-actions a {
  grid-column: 1/-1;
}
.result-disclaimer {
  margin: 18px 0 0;
  color: #aeb7ac;
  font-size: 9px;
  line-height: 1.8;
}
.tools-footer {
  max-width: 1280px;
  margin: auto;
  padding: 20px clamp(18px, 4vw, 56px) 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #768076;
  font-size: 10px;
}
.tools-footer a {
  color: #5f6d62;
  text-decoration: none;
}
.calculator-form [hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
  .result-panel {
    position: static;
  }
  .tools-nav nav {
    gap: 12px;
  }
}
@media (max-width: 600px) {
  .tools-nav {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .tools-nav nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 9px;
    border-top: 1px solid #ffffff20;
  }
  .tools-nav nav a {
    font-size: 9px;
  }
  .back-home {
    font-size: 9px;
    padding: 7px 9px;
  }
  .tools-shell {
    padding: 0 14px 55px;
  }
  .tools-hero {
    padding: 52px 0 35px;
  }
  .tools-hero h1 {
    font-size: clamp(48px, 14vw, 67px);
  }
  .two-cols {
    grid-template-columns: 1fr;
  }
  .waste-field {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .material-row {
    grid-template-columns: minmax(80px, 1fr) 70px 90px 90px 30px;
    gap: 4px;
  }
  .material-row input,
  .material-row select {
    padding: 7px;
    font-size: 10px;
  }
  .material-row .unit-label {
    display: none;
  }
  .form-actions {
    align-items: stretch;
  }
  .calculate-button {
    flex: 1;
  }
  .tools-footer {
    flex-wrap: wrap;
  }
  .tools-footer span {
    order: 3;
    width: 100%;
  }
}
@media print {
  body {
    background: #fff;
  }
  .tools-nav,
  .tools-hero,
  .calculator-form,
  .tools-footer,
  .result-label,
  .result-disclaimer,
  .report-actions {
    display: none !important;
  }
  .tools-shell {
    max-width: none;
    padding: 0;
  }
  .calculator-layout {
    display: block;
    margin: 0;
  }
  .result-panel {
    position: static;
    box-shadow: none;
    background: #fff;
    color: #1a231e;
    border: 0;
    padding: 15mm;
  }
  .result-panel h2 {
    color: #1a231e;
  }
  .result-empty {
    display: none !important;
  }
  .report-preview {
    display: block !important;
    color: #1a231e;
  }
  .report-title,
  .report-stat b,
  .report-list li b {
    color: #1a231e;
  }
  .report-subtitle,
  .report-stat span,
  .report-list li,
  .report-note,
  .cost-status {
    color: #4c554e;
  }
  .report-stats,
  .report-stat,
  .report-list li {
    border-color: #cfcfc7;
  }
  .report-note {
    background: #f2f0e8;
  }
  .report-image {
    max-height: 90mm;
  }
}
