body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #2b2b2b;
  color: #e0e0e0;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 16px;
}

/* === Other Apps Bar === */
.other-apps-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1px 0 1px 0;
  gap: 2px;
}
.app-button {
  color: #15d151;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
  font-size: 0.9rem;
  border: 1px solid #999;
  padding: 3px;
  border-radius: 3px;
  gap: 2px;
}
.app-button:hover, .app-button:focus {
  color: #f8ffad;
}
.area-active {
  background: #2d4c7c;
  color: #fff !important;
  padding: 3px;
  border-radius: 4px;
}
.area-active:hover {
  background: #1f1e1d;
  color: #f8ffad !important;
}
header {
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 0;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
header a {
  color: #4da8ff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
  font-size: 0.9rem;
}
header a:hover {
  text-decoration: underline;
}
.ad-top {
  margin: 15px 0;
  min-height: 90px;
  background: #333;
  width: 100%;
  max-width: 728px;
  text-align: center;
}
.main-content {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
}
.calculator {
  background: #333;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  width: 90%;
  max-width: 400px;
  position: relative;
}
.display {
  width: 100%;
  height: 60px;
  font-size: 24px;
  text-align: right;
  padding: 10px;
  margin-bottom: 10px;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: monospace;
  user-select: text;
  caret-color: #fff;
}
.memory-indicator {
  position: absolute;
  left: 10px;
  top: 12px;
  font-size: 16px;
  color: #ffd700;
  font-weight: bold;
}
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.btn {
  padding: 12px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.2s;
  text-align: center;
}
.btn:focus {
  outline: 2px solid #4da8ff;
  z-index: 1;
}
.btn:hover {
  filter: brightness(85%);
}
.green { background-color: #2e7d32; color: #fff; }
.add-btn { background-color: #1b5e20; color: #fff; }
.blue { background-color: #1565c0; color: #fff; }
.orange { background-color: #d81b60; color: #fff; }
.history-btn { background-color: #6a1b9a; color: #fff; }
.operator { font-size: 22px; }
.history-container {
  display: none;
  margin-top: 10px;
  background: #1e1e1e;
  padding: 15px;
  border-radius: 8px;
  width: 100%;
  min-width: 220px;
  max-width: 400px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: #ccc;
  box-sizing: border-box;
}
.history-container h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #fff;
}
.history-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.history-container li {
  margin-bottom: 5px;
  word-break: break-all;
}
.content-area {
  background: #333;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  width: 90%;
  max-width: 400px;
  font-size: 0.9rem;
  color: #ccc;
}
.content-area h2 {
  font-size: 1.2rem;
  margin: 0 0 10px;
  color: #fff;
}
.content-area h3 {
  font-size: 1.1rem;
  margin: 15px 0 10px;
  color: #fff;
}
.content-area p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.content-area a {
  color: #4da8ff;
  text-decoration: underline;
}
footer {
  margin: 30px 0 10px;
  font-size: 0.85rem;
  color: #888;
}
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 15px;
  text-align: center;
  z-index: 1000;
  font-size: 0.9rem;
}
.cookie-consent a {
  color: #4da8ff;
  text-decoration: underline;
}
.cookie-consent button {
  background: #2e7d32;
  color: #fff;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  margin: 0 5px;
  cursor: pointer;
  font-weight: bold;
}
.cookie-consent button.reject {
  background: #d81b60;
}
@media (min-width: 769px) {
  .main-content {
    flex-direction: row;
    align-items: flex-start;
  }
  .calculator, .history-container, .content-area {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
  }
}
@media (max-width: 768px) {
  .calculator, .history-container, .content-area {
    width: 95%;
  }
}
@media (max-width: 480px) {
  .calculator { width: 95%; }
  .btn { padding: 10px; font-size: 16px; }
  .operator { font-size: 20px; }
  .display { font-size: 20px; }
  header a { margin: 0 8px; font-size: 0.85rem; }
}