body {
  font-family: Arial, sans-serif;
  margin: 0 auto;
  padding: 0;
  background: #f4f4f4;
  font-size: 16px;
  color: #222;
  min-height: 100vh;
  transition: background .3s, color .3s;
}
body.dark-mode {
  background: #222;
  color: #f4f4f4;
}
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0,0,0,.05);
  padding: 10px;
  margin-bottom: 16px;
}
.dark-mode .nav-bar { background: #333; border-bottom: 1px solid #444; }
.nav-button {
  padding: 8px 15px;
  background: #007bff;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
  font-size: .95em;
  transition: background .2s;
}
.nav-button:hover{background:#0056b3}

.other-apps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
  margin: 18px 0 18px 0;
}
.app-button {
  font-size: 1.08em;
  background: #f6f9fd;
  color: #114488;
  border: 2px solid #007bff;
  border-radius: 8px;
  padding: 8px 18px 8px 18px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s, border 0.15s;
  margin-bottom: 2px;
  margin-top: 2px;
}
.app-button:hover, .app-button:focus {
  background: #0070e0;
  color: #fff;
  border-color: #0057a8;
  text-decoration: none;
}
.app-button.area-active, .app-button[aria-current="page"] {
  background: #007bff;
  color: #fff;
  border-color: #004b96;
  cursor: default;
  pointer-events: none;
}

.calculator {
  background: #fff;
  padding: 18px 10px 18px 10px;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(0,0,0,.08);
  max-width: 640px;
  margin: 0 auto 30px auto;
  position: relative;
}
.dark-mode .calculator { background: #333; color: #f4f4f4; }
#main-title {
  font-size: 1.6rem;
  font-weight: bold;
  color: #00087d;
  background: #e9ecef;
  padding: 8px;
  border-radius: 5px;
  margin: 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align:center;
}
.dark-mode #main-title {
  background: #262a36;
  color: #90e0ff;
}
.input-group {
  margin-bottom: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px 8px;
  border: 1px solid #dde1e4;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.dark-mode .input-group { background: #23272f; border-color: #393d44; }
.shape-select-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
label[for="shapeSelect"] {
  font-weight: 600;
  font-size: 1em;
  min-width: 110px;
}
#shapeSelect {
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #bbb;
  padding: 7px 15px 7px 10px;
  min-width: 145px;
  background: #fff;
}
.dark-mode #shapeSelect { background: #191c22; color: #fff; border: 1px solid #444; }
#inputFields { margin-bottom: 10px;}
.input-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.input-row label {
     min-width: 102px;
    text-align: right;
    margin-right: 10px;
    font-weight: 600;
    font-size: .99em;
}
.input-pair {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}
input[type=number], select {
  margin: 2px 0;
  padding: 8px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #bbb;
  width: 90px;
  box-sizing: border-box;
  background: #fff;
}
.dark-mode input[type=number],
.dark-mode select {
  background: #181b20;
  color: #fff;
  border: 1px solid #444;
}
.formula {
  font-style: italic;
  color: #666;
  font-size: 1.03em;
  margin: 5px 0 13px 0;
}
.dark-mode .formula { color: #ccc; }
.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 8px 0;
  flex-wrap: wrap;
}
button {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 8px 15px;
  font-size: .97rem;
  margin: 4px 2px;
  min-width: 100px;
  transition: background .2s;
}
button:active { background: #0056b3; }
button.reset-btn { background: #6c757d; }
button.reset-btn:hover { background: #5a6268; }
#calcAreaBtn {
  background: #003366 !important;
  color: #fff !important;
  border-color: #001d3d !important;
}
#calcAreaBtn:hover, #calcAreaBtn:focus {
  background: #001d3d !important;
}
#result-section {
  background: #e9ecef;
  border-radius: 8px;
  padding: 12px 10px;
  margin: 11px 0 12px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.02);
}
.dark-mode #result-section { background: #191c22; }
#result-heading {
  font-size: 1.13em;
  font-weight: bold;
  letter-spacing: .2px;
  margin-bottom: 7px;
  margin-top: 0;
  color: #007bff;
}
.dark-mode #result-heading { color: #90e0ff; }
.results-table { width:100%; border-radius:6px; margin-top:10px;}
.result-row { display:flex; align-items:center; padding:9px 0 9px 10px; font-size:1.06em; }
.result-row:nth-child(odd) { background: #fff; color:#232323;}
.result-row:nth-child(even) { background: #f6f6f6; color:#232323;}
.dark-mode .result-row:nth-child(odd) { background: #2f2f2f; color:#e3e3e3;}
.dark-mode .result-row:nth-child(even) { background: #232323; color:#e3e3e3;}
.result-unit-label { min-width:110px; font-weight:600; letter-spacing:.6px;}
.result-value { font-family: "Menlo", "Consolas", monospace; font-weight:600; margin-left:8px; }
#result-error { color: #d32f2f; font-weight: 600; margin:8px 0; min-height:22px; }
.canvas-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 18px 0 8px 0;
}
#areaCanvas {
  border: 1.5px solid #90caf9;
  width: 100%;
  max-width: 330px;
  height: 260px;
  aspect-ratio: 1.2/1;
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 2px 16px rgba(0,120,255,.06);
}
.dark-mode #areaCanvas { background: #222; border: 1.5px solid #007bff;}
#history-area {
  position: relative;
  padding-top: 48px !important;
  margin-top: 12px;
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  background: #f9f9f9;
  border-radius: 5px;
  font-size: .99em;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.dark-mode #history-area { background: #23272f; }
.history-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 2px;
  margin-bottom: 6px;
}
#history-area h4 {
  margin: 0;
  font-size: 1em;
  background: inherit;
  padding: 0;
  display: inline-block;
}
#clearHistoryBtn {
  margin: 0 !important;
  min-width: 120px !important;
  position: static;
}
#historyList-area {
  margin-top: 0 !important;
  padding-top: 6px;
  list-style: none;
}
.seo-description {
  margin-top: 28px;
  background: #fffbe5;
  border-radius: 8px;
  padding: 28px 16px 20px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  font-size: 1.09em;
  color: #35495e;
  line-height: 1.7;
}
.seo-description p {
    text-align: justify;
}
.dark-mode .seo-description {
  background: #23260a;
  color: #fffcc5;
}
.seo-description h2 {
  font-size: 1.25em;
  margin: 0 0 10px 0;
  color: #007bff;
  letter-spacing: .5px;
}
.seo-description h3 {
  font-size: 1.12em;
  margin: 18px 0 8px 0;
  color: #4f4f4f;
}
.dark-mode .seo-description h2, .dark-mode .seo-description h3 {
  color: #90e0ff;
}
.seo-description ul, .seo-description ol { margin-left: 18px; }
.seo-description code { background: #e0e0e0; padding: 2px 6px; border-radius: 4px; font-size: .99em;}
.dark-mode .seo-description code { background: #222; color: #ffe;}
.ad-container { margin: 18px auto;text-align:center;width:100%;}
.ad-slot { min-height: 50px;}
.ad-placeholder { min-height: 50px; background: #f0f0f0;}
.footer {
  background: #fff;
  padding: 10px;
  border-top: 1px solid #ddd;
  margin-top: 20px;
  text-align: center;
  font-size: .98em;
  color: #666;
}
.dark-mode .footer { background: #222; border-top: 1px solid #444; color: #ccc;}
.toggle-mode {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 8px 15px;
  background: #01144a;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 100;
}
.cookie-consent {
  position: fixed;
  bottom:0; left:0; right:0;
  background:#292928;
  color:#fff;
  padding:15px;
  text-align:center;
  box-shadow:0 -2px 5px rgba(0,0,0,.2);
  z-index:1000;
  display:none;
}
.cookie-consent a { color:#f8ffad; text-decoration:underline;}
.cookie-consent-btn {
  background:#007bff; color:#fff; border:none; border-radius:5px; padding:8px 15px; cursor:pointer; font-size:.96rem;
}
.cookie-consent-btn:hover { background:#0056b3;}
@media (max-width:700px) {
  .other-apps-bar {
    gap: 9px;
  }
  #clearHistoryBtn {
    min-width: 100px !important;
    font-size: 0.97em;
  }
}
@media (max-width:680px) {
  .toggle-mode {
  position: left;
  top: 1px;
  right: 1px;
  padding: 4px 8px;
  background: #01144a;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 100;
}
}

@media (max-width:480px) {
  .calculator { max-width: 100vw; padding: 2px; }
  .input-row label, label[for="shapeSelect"] { min-width: unset; text-align: left; margin-bottom: 3px;}
  .input-row, .shape-select-row { flex-direction: column; align-items: flex-start;}
  .input-pair { flex-direction: column; align-items: stretch; gap: 2px;}
  input[type=number], select { width: 100%; font-size: 13px; padding: 6px; }
  button { width: 100%; padding: 10px; font-size: .95rem;}
  #areaCanvas { max-width: 170px; }
  .user-rating-box {
  margin: 26px auto 16px auto;
  text-align: center;
  font-size: 1.13em;
}
/* ...your styles... */
/* === Share Bar === */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 16px 0 20px 0;
  font-size: 1em;
}
.share-label {
  font-weight: 600;
  margin-right: 6px;
  color: #355;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  border-radius: 50%;
  width: 38px; height: 38px;
  color: #333;
  transition: background 0.16s, color 0.16s;
  text-decoration: none;
  font-size: 1.1em;
  border: none;
}
.social-btn:hover, .social-btn:focus {
  background: #d1eaff;
  color: #007bff;
}
.social-btn.facebook { color: #1877f3; }
.social-btn.twitter  { color: #1da1f2; }
.social-btn.whatsapp { color: #25d366; }
.social-btn.linkedin { color: #0077b5; }
.social-btn.email    { color: #7a4cfd; }

/* === User Rating Box === */
.user-rating-box {
  margin: 26px auto 16px auto;
  text-align: center;
  font-size: 1.13em;
}
.star-rating {
  display: inline-block;
  direction: ltr;
}
.star {
  cursor: pointer;
  color: #ddd;
  font-size: 2em;
  transition: color 0.2s;
  display: inline-block;
}
.star.selected,
.star.hovered,
.star.active {
  color: #ffd700;
  text-shadow: 0 0 2px #ffbb00;
}
.rating-info {
  margin-top: 5px;
  color: #333;
  font-size: 0.95em;
}
.thank-you {
  color: #2e7d32;
  margin-top: 7px;
  font-weight: bold;
}}

