*,
:before,
::before,
:after,
::after {
  box-sizing: border-box;
}

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
}

a,
button,
div,
h1,
h2,
h3,
input,
li,
ol,
option,
p,
select,
span,
strong,
sub,
sup,
ul {
  color: #1a1714;
}

a,
body,
br,
button,
div,
h1,
h2,
h3,
html,
img,
input,
li,
ol,
option,
p,
select,
span,
strong,
sub,
sup,
ul {
  -webkit-appearance: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 100%;
  vertical-align: baseline;
}

body {
  background: #f4f0e6;
  color: #1a1714;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 0;
  line-height: 1;
  -webkit-text-size-adjust: 100%;
}

a {
  background: transparent;
  font-size: 0;
  text-decoration: none;
}

strong {
  font-weight: 700;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  display: block;
  font-size: 0;
  max-width: 100%;
}

svg {
  border: 0;
  stroke-width: 0;
}

ol,
ul {
  list-style: none;
}

input[type=text] {
  background-color: transparent;
}

input[type=file],
input[type=checkbox] {
  display: none;
}

button {
  background-color: transparent;
  cursor: pointer;
  font-family: inherit;
}

::-webkit-scrollbar {
  display: none;
}

::-webkit-calendar-picker-indicator {
  display: none;
}

::-webkit-resizer {
  display: none;
}

.KobunLines {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  width: max-content;
  min-height: 100%;
}

.KobunLine {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 10px;
}

.KobunWord {
  display: flex;
  align-items: stretch;
  padding: 3px 1px;
  border: none;
  border-radius: 2px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.3s, background 0.18s;
}
.KobunWord[data-dim] {
  opacity: 0.28;
}
.KobunWord[data-selected] {
  background: rgba(140, 47, 57, 0.08);
}
.KobunWord[data-symbol] {
  align-items: flex-start;
  cursor: default;
}
.KobunWord-Breakdown {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 1px;
  width: calc(var(--scale) * 1.35);
  padding-right: 3px;
  margin-right: 3px;
}
.KobunWord-Breakdown-Part {
  writing-mode: vertical-rl;
  font-size: calc(var(--scale) * 0.4);
  line-height: 1.15;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #4a443c;
}
.KobunWord-Breakdown-Part:first-child {
  font-weight: 700;
}
.KobunWord-Rule {
  width: 1px;
  flex-shrink: 0;
  margin: 2px 0;
  background: rgba(60, 52, 42, 0.22);
}
.KobunWord-Body {
  writing-mode: vertical-rl;
  text-orientation: upright;
  padding-left: 4px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  font-size: var(--scale);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: #1a1714;
}
.KobunWord-Body ruby {
  ruby-position: over;
}
.KobunWord-Body rt {
  font-size: calc(var(--scale) * 0.37);
  font-weight: 400;
  letter-spacing: 0;
  color: #4a443c;
}
.KobunWord[data-symbol] .KobunWord-Body {
  font-size: calc(var(--scale) * 0.95);
  color: #4a443c;
}
.KobunWord[data-selected] .KobunWord-Breakdown-Part {
  color: #8c2f39;
}
.KobunWord[data-selected] .KobunWord-Rule {
  background: #8c2f39;
}
.KobunWord[data-selected] .KobunWord-Body {
  color: #8c2f39;
}

.Kobun {
  min-height: 100vh;
  padding: 40px 24px 60px;
  background: repeating-linear-gradient(0deg, rgba(60, 52, 42, 0.02) 0 1px, transparent 1px 6px), #f4f0e6;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  color: #1a1714;
}
.Kobun-Title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.Kobun-Lead {
  margin: 12px 0 0;
  max-width: 640px;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.9;
  color: #4a443c;
}
.Kobun-Source {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 0;
}
.Kobun-Source-Title {
  font-size: 16px;
  letter-spacing: 0.1em;
}
.Kobun-Source-Section {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 12px;
  color: #4a443c;
}

.Kobun-Reading {
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 18px 0 0;
}

.KobunReader {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: repeating-linear-gradient(0deg, rgba(60, 52, 42, 0.02) 0 1px, transparent 1px 6px), #f4f0e6;
  color: #1a1714;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}
.KobunReader-Stage {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  padding: 84px 40px 44px;
  cursor: grab;
}
.KobunReader-Stage .Kobun-Reading {
  flex-shrink: 0;
  display: block;
  overflow: visible;
  margin: auto;
}
.KobunReader-Detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 200px;
  padding: 14px 16px 16px;
}
.KobunReader-Detail-Surface {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #8c2f39;
}
.KobunReader-Detail-Breakdown {
  padding: 3px 9px;
  border: 1px solid rgba(60, 52, 42, 0.22);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1714;
}
.KobunReader-Detail-Note {
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: #4a443c;
}
.KobunReader-Detail-Hint {
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: #4a443c;
}

.KobunLogo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 28px;
}
.KobunLogo a {
  color: #1a1714;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.PanelControl {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 32px;
}
.PanelControl-Item {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 21px;
  color: #4a443c;
  cursor: pointer;
  user-select: none;
}
.PanelControl-Item[data-open] {
  color: #1a1714;
}

.PanelColumn {
  position: absolute;
  left: 0;
  top: 56px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.SinglePanel {
  position: static;
  width: max-content;
  background: #fbf8f0;
  border: 1px solid rgba(60, 52, 42, 0.22);
  border-radius: 12px 8px 8px 8px;
  overflow: hidden;
}
.SinglePanel[data-panel]:not([data-open]) {
  display: none;
}
.SinglePanel[data-float] {
  position: fixed;
}
.SinglePanel-Header {
  height: 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}
.SinglePanel-Header:active {
  cursor: grabbing;
}
.SinglePanel-CloseIcon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1714;
  cursor: pointer;
}
.SinglePanel-CloseIcon svg {
  width: 9px;
  visibility: hidden;
}
.SinglePanel-CloseIcon:hover svg {
  visibility: visible;
}
.SinglePanel-Title {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background: #f4f0e6;
  font-size: 11px;
  line-height: 1.5;
  color: #1a1714;
  border-bottom-right-radius: 12px;
}
.SinglePanel-Main {
  padding: 0;
}

.KobunReader[data-fixed] .SinglePanel {
  position: fixed;
  top: 56px;
  right: 0;
  left: auto;
}
.KobunReader[data-fixed] .SinglePanel-Header {
  cursor: default;
}

.SelectList {
  display: flex;
  flex-direction: column;
  padding: 8px 4px;
}
.SelectList-Item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1714;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
}
.SelectList-Item:hover {
  background-color: rgba(60, 52, 42, 0.1);
}
.SelectList-Item[data-active] {
  background-color: rgba(60, 52, 42, 0.22);
}

.NumberInput {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px 14px;
}
.NumberInput-Arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: #4a443c;
  cursor: pointer;
}
.NumberInput-Arrow:hover {
  color: #1a1714;
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Field {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.NumberInput-Input {
  width: calc(3ch + 14px);
  height: 26px;
  padding: 0 4px;
  border: 1px solid rgba(60, 52, 42, 0.22);
  border-radius: 2px;
  background: transparent;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 14px;
  color: #1a1714;
  text-align: center;
}
.NumberInput-Input:focus {
  outline: none;
}
.NumberInput-Unit {
  font-size: 12px;
  color: #4a443c;
  user-select: none;
}