.sekai-app {
  --paper: #fffdf8;
  --ink: #202126;
  --muted: #66666f;
  --line: #e8e1d6;
  --spring: #f2a93b;
  --yu: #385a7c;
  --fermino: #34313c;
  color: var(--ink);
  max-width: 980px;
  margin: 2rem auto;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

.sekai-app * { box-sizing: border-box; }
.sekai-app button, .sekai-app input, .sekai-app textarea { font: inherit; }
.sekai-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sekai-section-image {
  display: block;
  width: 100%;
  height: auto;
  margin: .75rem 0 1.25rem;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(32, 28, 23, .15);
}
.sekai-section-image.is-topic-box {
  margin-top: .65rem;
  border-radius: 16px;
}
.sekai-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 15%, rgba(242,169,59,.19) 0 10%, transparent 11%),
    radial-gradient(circle at 80% 36%, rgba(56,90,124,.12) 0 16%, transparent 17%),
    var(--paper);
}
.sekai-hero h2 { margin: .25rem 0 1rem; font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1.15; letter-spacing: -.04em; }
.sekai-hero p:last-child { max-width: 42rem; margin-bottom: 0; line-height: 1.9; }
.sekai-kicker { margin: 0; color: #a06e20; font-size: .76rem; font-weight: 800; letter-spacing: .16em; }
.sekai-topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; margin: 1.5rem 0; }
.sekai-topic {
  min-height: 98px;
  padding: 1rem .5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.sekai-topic:hover, .sekai-topic:focus-visible { transform: translateY(-3px); border-color: var(--spring); box-shadow: 0 10px 24px rgba(51,44,33,.1); outline: none; }
.sekai-topic span { display: block; margin-bottom: .4rem; font-size: 2rem; }
.sekai-topic strong { font-size: .9rem; }
.sekai-result { padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 18px 55px rgba(42,37,31,.08); }
.sekai-result-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.sekai-result-heading > span { font-size: 3rem; }
.sekai-result-heading small { color: var(--muted); }
.sekai-result-heading h3 { margin: .2rem 0 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.sekai-voices { display: grid; gap: .8rem; }
.sekai-voice { position: relative; margin: 0; padding: 1.25rem 1.35rem 1.25rem 1.65rem; border-radius: 0 16px 16px 0; background: #f8f8f7; }
.sekai-voice::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: currentColor; }
.sekai-voice.is-haru { color: #9b6008; background: #fff9e9; }
.sekai-voice.is-yu { color: #244e76; background: #f2f7fb; }
.sekai-voice.is-fermino { color: #40394d; background: #f5f3f7; }
.sekai-voice > p:last-child { margin: .55rem 0 0; color: var(--ink); font-size: 1.06rem; line-height: 1.8; }
.sekai-name { margin: 0; font-weight: 800; }
.sekai-name span { margin-left: .5rem; color: var(--muted); font-size: .73rem; font-weight: 500; }
.sekai-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
.sekai-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 700;
  cursor: pointer;
}
.sekai-button.is-primary { background: var(--ink); color: #fff; }
.sekai-button.is-x { background: #111; color: #fff; }
.sekai-button.is-quiet { background: #efefed; color: var(--ink); }
.sekai-button.is-gold { background: #e1b45e; color: #221b10; }
.sekai-topic-box { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.5rem, 5vw, 4rem); margin-top: 1.5rem; padding: clamp(1.5rem, 5vw, 3.5rem); border-radius: 24px; background: #f6f1e9; }
.sekai-topic-box h3 { margin: .35rem 0 1rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.sekai-topic-box form { display: grid; gap: .8rem; }
.sekai-topic-box label { font-size: .82rem; font-weight: 700; }
.sekai-topic-box label span { color: var(--muted); font-weight: 400; }
.sekai-topic-box input, .sekai-topic-box textarea { width: 100%; margin-top: .35rem; padding: .8rem .9rem; border: 1px solid #d7cfc3; border-radius: 10px; background: #fff; color: var(--ink); }
.sekai-topic-box input:focus, .sekai-topic-box textarea:focus { border-color: var(--spring); outline: 3px solid rgba(242,169,59,.16); }
.sekai-honeypot { position: absolute !important; left: -9999px !important; }
.sekai-form-status { min-height: 1.5em; margin: 0; font-size: .85rem; }
.sekai-hero.is-night { color: #f7f3e9; background: radial-gradient(circle at 85% 15%, rgba(225,180,94,.25), transparent 24%), linear-gradient(135deg, #26232d, #3c3545); border-color: #4d4657; }
.sekai-hero.is-night .sekai-kicker { color: #e1b45e; }
.fermino-quiz .quiz-stage, .fermino-quiz .quiz-result { margin-top: 1.2rem; padding: clamp(1.5rem, 5vw, 3rem); border-radius: 24px; background: #2e2a35; color: #f8f5ec; }
.quiz-progress { height: 5px; overflow: hidden; border-radius: 5px; background: #4d4755; }
.quiz-progress span { display: block; width: 20%; height: 100%; background: #e1b45e; transition: width .25s ease; }
.quiz-number { color: #e1b45e; font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
.quiz-stage h3, .quiz-result h3 { font-size: clamp(1.35rem, 4vw, 2rem); }
.quiz-options { display: grid; gap: .7rem; margin-top: 1.2rem; }
.quiz-options button { padding: 1rem; border: 1px solid #5c5662; border-radius: 12px; background: #393440; color: #fff; text-align: left; cursor: pointer; }
.quiz-options button:hover, .quiz-options button:focus-visible { border-color: #e1b45e; background: #45404c; outline: none; }
.quiz-rank { color: #e1b45e; font-size: 1.05rem; font-weight: 800; }
.quiz-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1.25rem 0; }
.quiz-metrics div { padding: 1rem; border-radius: 12px; background: #3b3642; text-align: center; }
.quiz-metrics small { display: block; margin-bottom: .25rem; color: #bdb7c3; }
.quiz-result blockquote { margin: 1.25rem 0; padding: 1rem 1.2rem; border-left: 4px solid #e1b45e; background: #37323d; color: #fff; font-style: normal; }
[hidden] { display: none !important; }
.sekai-mobile-play { display: none; }
.fermino-ledger-teaser {
  display: grid;
  gap: .25rem;
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #d5b66d;
  border-radius: 16px;
  background: linear-gradient(135deg, #2e2a35, #403847);
  color: #fff !important;
  text-decoration: none !important;
}
.fermino-ledger-teaser span { color: #e1b45e; font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
.fermino-ledger-teaser strong { font-size: 1.1rem; }
.fermino-ledger-teaser small { color: #d4ced7; }
.fermino-ledger {
  --ledger-ink: #26222b;
  --ledger-gold: #c69336;
  max-width: 980px;
  margin: 2rem auto;
  color: var(--ledger-ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}
.fermino-ledger * { box-sizing: border-box; }
.ledger-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  overflow: hidden;
  border-radius: 26px;
  background: #292630;
  color: #fff;
}
.ledger-hero > div { align-self: center; padding: clamp(1.6rem, 5vw, 3.5rem); }
.ledger-hero h2 { margin: .35rem 0 1rem; color: #fff; font-size: clamp(2.1rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -.045em; }
.ledger-hero p:last-child { margin-bottom: 0; color: #d8d2dc; line-height: 1.9; }
.ledger-hero img { width: 100%; height: 100%; min-height: 380px; object-fit: cover; object-position: 70% center; }
.ledger-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1rem 0; }
.ledger-summary div { padding: 1.25rem; border: 1px solid #e2ddd5; border-radius: 16px; background: #fff; }
.ledger-summary small { display: block; margin-bottom: .35rem; color: #77717a; }
.ledger-summary strong { font-size: clamp(1.35rem, 4vw, 2rem); }
.ledger-summary div:first-child strong { color: #317053; }
.ledger-summary div:nth-child(2) strong { color: #a54c45; }
.ledger-summary .is-balance { background: #f6ecd5; border-color: #dec283; }
.ledger-comment { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; padding: 1.2rem 1.35rem; border-left: 5px solid var(--ledger-gold); background: #f7f4ef; }
.ledger-comment span { padding: .25rem .6rem; border-radius: 999px; background: #302b35; color: #fff; font-size: .75rem; font-weight: 800; }
.ledger-comment p { margin: 0; line-height: 1.8; }
.ledger-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 .8rem; }
.ledger-controls button { padding: .65rem 1rem; border: 1px solid #d8d2ca; border-radius: 999px; background: #fff; color: var(--ledger-ink); cursor: pointer; }
.ledger-controls button.is-active { border-color: #302b35; background: #302b35; color: #fff; }
.ledger-list { display: grid; gap: .75rem; }
.ledger-entry { padding: 1.25rem; border: 1px solid #e2ddd5; border-left: 5px solid #999; border-radius: 0 16px 16px 0; background: #fff; }
.ledger-entry.is-income { border-left-color: #47866a; }
.ledger-entry.is-expense { border-left-color: #b35c51; }
.ledger-entry.is-pending { border-left-color: #b49b63; background: #fcfaf5; }
.ledger-entry-meta { display: flex; justify-content: space-between; color: #817b84; font-size: .75rem; }
.ledger-entry-main { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; margin: .5rem 0 .8rem; }
.ledger-entry h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.ledger-entry p { margin: 0; color: #625d65; line-height: 1.7; }
.ledger-amount { font-size: 1.25rem; white-space: nowrap; }
.is-income .ledger-amount { color: #317053; }
.is-expense .ledger-amount { color: #a54c45; }
.is-pending .ledger-amount { color: #8d7440; }
.ledger-entry > a { color: #665022; font-size: .84rem; font-weight: 700; }
.ledger-note { margin-top: 1rem; padding: 1.25rem; border-radius: 16px; background: #efede9; }
.ledger-note p { margin: .4rem 0 0; color: #625d65; line-height: 1.8; }

@media (max-width: 700px) {
  .sekai-mobile-play {
    position: fixed;
    z-index: 9998;
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 999px;
    background: linear-gradient(135deg, #2f2a37, #564563);
    box-shadow: 0 8px 24px rgba(28,23,33,.3);
    color: #fff !important;
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
    font-size: .92rem;
    line-height: 1;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  .sekai-mobile-play span { font-size: 1.15rem; }
  .sekai-mobile-play strong { color: #fff; }
  .sekai-mobile-play:active { transform: translateY(1px) scale(.98); }
  .sekai-section-image { border-radius: 14px; }
  .sekai-topic-grid { grid-template-columns: repeat(2, 1fr); }
  .sekai-topic:last-child { grid-column: 1 / -1; }
  .sekai-topic-box { grid-template-columns: 1fr; }
  .sekai-actions .sekai-button { width: 100%; }
  .quiz-metrics { grid-template-columns: 1fr; }
  .ledger-hero { grid-template-columns: 1fr; }
  .ledger-hero img { min-height: 240px; }
  .ledger-summary { grid-template-columns: 1fr; }
  .ledger-comment { grid-template-columns: 1fr; }
  .ledger-entry-main { grid-template-columns: 1fr; }
}
