* {
  box-sizing: border-box;
}

:root {
  --border-radius: 4px;
  --primary-color: #007bff; /* blue */
  --secondary-color: #545b62; /* gray */
  --light-gray: #d8d8d8;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  counter-reset: section;
  margin: 0;
  padding: 0 1rem;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: lightgray;
  padding: .5rem 1rem;
}

main {
  margin-top: 8rem;
}

.row {
  margin: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;

}

.column {
  display: flex;
  flex-direction: column;
}

main .row {
  width: 100%;
  max-width: 360px;
  padding: 1rem;
}

h1 {
  font-size: 1.3rem;
  margin: .5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0;
  padding: 1rem 0;
  width: 150px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h2::before {
  counter-increment: section; 
  content: "Hole " counter(section);
}

h2 .par {
  font-size: 0.9rem;
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

.details-content {
  display: flex;
  justify-content: space-between;
  padding-bottom: 1rem;
}

details summary {
  list-style: none; /* Standard property for Firefox and other browsers */
}

details summary::marker {
  display: none; /* Standard pseudo-element, works in latest Chrome, Edge, Firefox */
}

/* For older WebKit browsers like Safari */
details summary::-webkit-details-marker {
  display: none;
}

/* Enable interpolation for size properties */
@supports (interpolate-size: allow-keywords) {
  :root {
    /* Set on the root to apply globally */
    interpolate-size: allow-keywords;
  }

  details {
    /* Animate the height property from its closed state to its open state */
    height: 3.5rem; /* Approximate height of the summary */
    transition: height 0.5s ease-out;
    overflow: hidden; /* Ensures content stays within bounds during transition */
  }

  details[open] {
    height: auto; /* Animate to natural height */
    overflow: clip; /* Or auto, depending on desired effect */
  }
}

summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subtotal {
  width: 72px;
  margin-right: 44px;
  text-align: center;
}

details[open] .subtotal {
  visibility: hidden;
}

.counter {
  width: 160px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#holes-list > li:not(:last-child) {
  border-bottom: 1px solid var(--light-gray);
}

.details-content p, header p {
  margin: 0;
}

.distance {
  padding-bottom: .5rem;
  display: none;
}

.distance.show {
  display: block;
}

button {
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
  border: none;
  border-radius: var(--border-radius);
  padding: .5rem 1rem;
}

.ctrl-btn {
  border-radius: 50%;
  border: none;
  font-size: 1.3rem;
  touch-action: manipulation;
  padding: 0;
}

.primary-btn {
  background-color: var(--primary-color);
  color: white;
}

.secondary-btn {
  background-color: var(--secondary-color);
  color: white;
}

menu {
  margin: 0;
  padding: 0;
}

footer {
  padding: .5rem 1rem 2rem;
}

.footer-btn {
  width: 100%;
}

dialog {
  width: 90vw;
  border: none;
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem 2.5rem;
}

dialog:-internal-dialog-in-top-layer::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog h1 {
  font-size: 1.2rem;
}

dialog .action-btn {
  margin-top: 1rem;
}

.text-center {
  text-align: center;
}

select {
  max-width: 300px;
  padding: 8px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 5px;
  background-color: white;
  cursor: pointer;
  transition: 0.3s;
}

@media (min-width: 600px) {
  .row {
    margin: 0;
  }
}