:root {
  line-height: 1.5;
  color-scheme: light dark;
  margin: 0;
  padding: 0;
  min-width: 320px;
}

body {
  margin: 0;
  padding: 0;
}

body, input, textarea, select, button {
  font-size: 16px;
}

* {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
}

#root {
  padding: 1em;
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 1.5em;
}

details {
  summary {
    margin: 1em 0 0;
    cursor: pointer;

    h2 {
      font-size: 1.25em;
      margin: 0;
      padding: 0;
      display: inline-block;
    }
  }
}

dl {
  dt {
    font-weight: bold;
  }
  dd {
    margin: 0;
    padding: 0;
  }  
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;

  th {
    text-align: start;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 0.25em;
  }
}

.cache-entry {
  .cache-meta {
    margin: 0;
    padding: 0;
    opacity: 0.5;
    font-size: 0.8em;
  }

  .cache-percentage {
    --color: rgba(0, 0, 100, 0.05);
    background-image: linear-gradient(
      to left,
      var(--color),
      var(--color) calc(var(--percentage) * 1%),
      transparent calc(var(--percentage) * 1%),
      transparent 100%
    );
  }
}

#treemap {
  width: 100%;
  max-width: 1300px;
  min-height: 80vh;
  margin: 16px 0;
}
.webtreemap-node {
  cursor: pointer;
  position: absolute;
  border: solid 1px #666;
  box-sizing: border-box;
  overflow: hidden;
  background: #f5f5f5;
  transition: left .15s, top .15s, width .15s, height .15s;
  min-width: 1em;
}

.webtreemap-node:focus .webtreemap-node:hover,
.webtreemap-node:hover {
  background: #ddd;
}

.webtreemap-caption {
  font-size: 11px;
  text-align: center;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.webtreemap-node:focus {
  border-color: hsla(215, 100%, 48%, 0.247);
  background: #fff; /*  hsl(240, 100%, 96%); */
  font-weight: bold;
}

.webtreemap-node:focus .webtreemap-node {
  background: #fff;
  font-weight: normal;
}

.resize-controls {
  float: right;
  font-size: 0.8em;
  position: sticky;
  bottom: 0;
  padding: .5em;
  background: rgba(255, 255, 255, 0.75);
  display: inline-block;
  border: 2px solid #000;
  backdrop-filter: blur(5px);
}

#sunburst {
  margin: 16px 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #181a1b;
    color: #e0e0e0;
  }
  body {
    background: #181a1b;
    color: #e0e0e0;
  }
  .webtreemap-node {
    border-color: #444;
    background: #23272a;
  }
  .webtreemap-node:focus,
  .webtreemap-node:hover {
    background: #333;
  }
  .webtreemap-caption {
    color: #e0e0e0;
  }
  .resize-controls {
    background: rgba(24, 26, 27, 0.85);
    border-color: #888;
    color: #e0e0e0;
  }
  table {
    border-color: #444;
  }
  th, td {
    border-color: #444;
    background: #23272a;
    color: #e0e0e0;
  }
}