.reader-settings {
  margin-top: 28px;
  background: #f8f9fa;
  color: #0c121a;
  font-family: Pretendard,sans-serif;
  overflow: hidden;
}

.reader-settings summary {
  position: relative;
  padding: 18px 42px 18px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
}

.reader-settings summary::-webkit-details-marker {
  display: none;
}

.reader-settings summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.reader-settings[open] summary::after {
  content: '−';
}

.reader-settings-controls {
  padding: 0 18px 18px;
  display: grid;
  gap: 20px;
}

.reader-settings .reader-setting {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reader-settings .reader-setting>label, .reader-settings legend, .reader-settings .reader-setting-heading label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  color: #303943;
}

.reader-settings legend {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  visibility: visible;
}

.reader-settings .reader-setting-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.reader-settings output {
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

.reader-settings select {
  display: block;
  appearance: none;
  width: 100%;
  height: 42px;
  min-width: 0;
  border: 1px solid #cbd0d5;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23303943' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #0c121a;
  padding: 0 32px 0 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: normal;
}

.reader-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-settings .reader-size-control button {
  flex: 0 0 40px;
  height: 40px;
  border: 1px solid #cbd0d5;
  border-radius: 6px;
  background: #fff;
  color: #0c121a;
  font-size: 14px;
  cursor: pointer;
}

.reader-settings .reader-size-control button:disabled {
  opacity: .4;
  cursor: default;
}

.reader-settings input[type=range] {
  appearance: auto;
  min-width: 0;
  width: 100%;
  height: 32px;
  accent-color: #0c121a;
  cursor: pointer;
}

.reader-theme-options {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 6px;
}

.reader-theme-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.reader-theme-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reader-theme-options label>span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  border: 1px solid #cbd0d5;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  line-height: 16px;
}

.reader-theme-options input:checked+span {
  border-color: #0c121a;
  box-shadow: inset 0 0 0 1px #0c121a;
  font-weight: 700;
}

.reader-settings .reader-swatch {
  display: block;
  width: 22px;
  height: 22px;
  border: 1px solid #b6bbc0;
  border-radius: 50%;
}

.reader-swatch-default {
  background: linear-gradient(135deg,#fff 50%,#e4e7eb 50%);
}

.reader-swatch-light {
  background: #fff;
}

.reader-swatch-sepia {
  background: #f4ecd9;
}

.reader-swatch-dark {
  background: #1e2329;
}

.reader-settings .reader-reset {
  height: 40px;
  border: 1px solid #cbd0d5;
  border-radius: 6px;
  background: transparent;
  color: #303943;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.reader-settings .reader-reset:hover {
  background: #e9ecef;
}

.reader-settings .reader-font-status {
  margin: -8px 0 0;
  font-size: 11px;
  line-height: 18px;
  color: #686e76;
}

.reader-settings .reader-font-status:empty {
  display: none;
}

.reader-settings :is(summary,select,button,input[type=range]):focus-visible, .reader-theme-options input:focus-visible+span {
  outline: 2px solid #146bd1;
  outline-offset: 3px;
}

.reader-surface {
  min-width: 0;
  overflow-wrap: break-word;
}

.reader-surface[data-reader-theme=light] {
  --reader-paper: #fff;
  --reader-ink: #20252b;
  --reader-link: #075cab;
}

.reader-surface[data-reader-theme=sepia] {
  --reader-paper: #f4ecd9;
  --reader-ink: #433728;
  --reader-link: #754c1d;
}

.reader-surface[data-reader-theme=dark] {
  --reader-paper: #1e2329;
  --reader-ink: #e8e9eb;
  --reader-link: #a6ceff;
}

.reader-surface[data-reader-theme]:not([data-reader-theme=default]) {
  background: var(--reader-paper);
  color: var(--reader-ink);
  padding: 24px;
  border-radius: 8px;
}

.reader-surface[data-reader-theme]:not([data-reader-theme=default]) :is(div,p,span,section,article,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,thead,tbody,tr,td,th,caption,figure,figcaption,font,strong,b,em,i,small,sup,sub,pre,code) {
  background-color: transparent!important;
  color: var(--reader-ink)!important;
}

.reader-surface[data-reader-theme]:not([data-reader-theme=default]) a {
  color: var(--reader-link)!important;
  text-decoration: underline;
}

.reader-main-row {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  width: 100%;
  min-width: 0;
}

.reader-comments {
  width: calc(100% - 308px - var(--gap));
  margin-left: auto;
}

@media screen and (min-width:769px) {
  .board-wrap:has(.side-area) .side-area:has(.reader-settings) {
    box-sizing: border-box;
    max-height: calc(100vh - 124px);
    max-height: calc(100dvh - 124px);
    overflow-y: auto;
    padding-right: 12px;
  }
}

@media (max-width:768px) {
  .reader-main-row {
    flex-direction: column;
  }

  .reader-comments {
    width: 100%;
  }

  .reader-settings {
    margin-top: 20px;
  }

  .reader-settings-controls {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px;
  }

  .reader-settings .reader-font-status, .reader-settings .reader-reset {
    grid-column: 1/-1;
  }

  .reader-surface[data-reader-theme]:not([data-reader-theme=default]) {
    padding: 16px;
  }
}

@media (max-width:440px) {
  .reader-settings-controls {
    grid-template-columns: 1fr;
  }
}

@media print {
  .reader-settings {
    display: none!important;
  }
}
