* {
  margin: 0;
}

:root {
  --base-color: #4C5CAE;
  --accent-color: #FE6426;
  --base-muted-color: #DADEEF;
  --accent-muted-color: #FEC1A8;

  --border-color: #B5C0C0;
  --border-radius: 0.3rem;
}

.section-container {
  padding-left: 1.4em;
}

.box-frame {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.h-block {
  h2 { display: inline-block; margin-right: 0.6rem; }
  h3 { display: inline-block; margin-right: 0.6rem; }
}

.highlight {
  color: var(--accent-color);
}

html {
  height: 100%;
  line-height: 1.5;
}

body {
  font-family: "Segoe UI", "Meiryo", "Hiragino Sans", sans-serif;
  font-size: 18px;
  color: #000E16;
  #center {
    max-width: 920px;
    min-width: 480px;
    margin: 0 auto;
    padding: 1rem 2rem;
  }
}

h1 {
  position: relative;
  padding: 0.6rem 1rem;
  border-bottom: 4px solid var(--base-muted-color);
  margin-bottom: 1.4rem;
}

h1:before {
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 130px;
  height: 4px;
  content: '';
  background: var(--base-color);
}

h2 {
  padding-left: 0.6rem;
  border-left: 8px solid var(--base-color);
  margin: 1rem 0 0.2rem 0;
}

h3 {
  margin: 0.6rem 0 0.2rem 0;
}

button {
  font-family: Tahoma;
  font-size: 1rem;
}

.tab-container {
  .tab-labels {
    display: flex;
    .tab {
      display: block;
      margin-bottom: -1px;
      padding: 0.5em;
      background-color: var(--base-muted-color);
      border: 1px solid #0000;
      border: 1px solid var(--border-color);
      border-top-left-radius: var(--border-radius);
      border-top-right-radius: var(--border-radius);
    }
    .tab[aria-selected="true"]{
      border-color: var(--border-color);
      border-bottom: 1px solid #FFF;
      background-color: #FFF;
    }
  }
  .tab-content {
    min-width: 560px;
    padding: 4px 10px 20px;
    border: 1px solid var(--border-color);
    border-top-right-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    [aria-hidden="true"] {
      display: none;
      visibility: hidden;
    }
  }
}

.two-column-wrapper {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 1rem;
  align-items: flex-start;
  .left-column {
    flex-grow: 1;
  }
  .right-column {
    flex-grow: 0;
  }
}

.program {
  height: 25.5rem;
  resize: none;
  white-space: pre;
  overflow-x: auto;
  overflow-y: scroll;
  box-sizing: border-box;
  padding: 0.5rem;
  padding-left: 1rem;
  font-family: Consolas, monospace;
  font-size: inherit;
  line-height: 1.2;
}

.button-overlay-wrapper {
  position: relative;
  .buttons {
    position: absolute;
    bottom: 0.6rem;
    right: 1.4rem;
    display: flex;
    gap: 0.4rem;
  }
}

.source-code {
  width: 100%;
}

.compile-result {
  position: relative;
  .code-with-addr {
    position: absolute;
    display: flex;
    column-gap: 1rem;
    .addr {
      color: #AAA;
    }
    .code {
      .error {
      background-color: var(--accent-muted-color);
      }
      .line {
        position: relative;
        .cursor {
          position: absolute;
          top: 0;
          left: -0.4rem;
          background: var(--base-color);
          height: 0.8rem;
          width: 0.4rem;
          clip-path: polygon(0 0, 100% 50%, 0 100%);
        }
      }
    }
  }
}

.mark {
  width: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  .triangle {
    background: var(--base-color);
    height: 1.4rem;
    width: 1.2rem;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .triangle-thin {
    background: var(--base-color);
    height: 1.4rem;
    width: 0.8rem;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .bar {
    background-color: var(--base-color);
    height: 1.4rem;
    width: 0.4rem;
  }
  .circle-arrow {
    width: 0.8rem;
    height: 0.8rem;
    border: 0.35rem solid var(--base-color);
    border-right-color: transparent;
    border-radius: 50%;
    position: relative;
    transform: rotate(-30deg);
    .arrowhead {
      position: absolute;
      top: 0.2rem;
      right: -0.4rem;
      width: 0.8rem;
      height: 0.8rem;
      background: var(--base-color);
      clip-path: polygon(0 0, 100% 50%, 0 100%);
      transform: rotate(-45deg);
    }
  }
  .crimp {
    margin-left: -0.2rem;
  }
  .gap {
    margin-left: 0.4rem;
  }
}

.registers {
  display: flex;
  justify-content: space-around;
  .register {
    font-family: Consolas, monospace;
    padding: 0.2ch 0.2em;
    .register-label, .register-value {
      display: inline-block;
      width: 2.5ch;
      text-align: right;
    }
  }
  .register:nth-child(n+2)::before {
    border-left: 1px solid var(--border-color);
    content: '';
  }
}

table.memory {
  border-collapse: collapse;
  text-align: right;
  font-family: Consolas, monospace;
  th {
    background-color: var(--base-muted-color);
    border: 1px solid #FFFFFF;
    padding: 0.1ch 0.2em;
    width: 2ch;
  }
  td {
    border: 1px solid var(--base-muted-color);
    padding: 0.1ch 0.2em;
    width: 2ch;
  }
}

.chario {
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
  font-family: Consolas, monospace;
  font-size: inherit;
  line-height: 1.2;
}

#samples-panel button {
  all: unset;
  color: blue;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

footer {
  margin-top: 2rem;
  padding: 1rem 0.5rem;
  border-top: 4px solid var(--base-muted-color);
}
