:root {
  --page-bg: #ffffff;
  --paper: #fffffb;
  --head: #eeeeee;
  --line: #808080;
  --strong-line: #000000;
  --ink: #000000;
  --link: #0000ee;
  --visited: #551a8b;
  --hover: #ff0000;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  margin: 0;
  color: var(--ink);
  background: #07123a url("../images/star-bg.svg") repeat;
  font-family: "MS PGothic", "Osaka", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.45;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:visited {
  color: var(--visited);
}

a:hover,
a:focus-visible {
  color: var(--hover);
}

button,
input,
textarea {
  font: inherit;
}

.site-shell {
  width: 760px;
  max-width: calc(100% - 12px);
  margin: 0 auto;
  padding: 6px 8px 18px;
  background: var(--page-bg);
}

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

.page-label {
  margin: 0 0 10px;
  text-align: left;
  font-size: 12px;
}

.cover-link {
  display: inline-block;
  width: 320px;
  max-width: 86vw;
  border: 1px solid var(--line);
  background: #ffffff;
}

.cover-link img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header h1 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: bold;
}

.welcome,
.visit-counter,
.header-text-link {
  margin: 1px 0;
}

.header-text-link {
  font-size: 13px;
}

.intro-text-link {
  margin: 5px 0 2px;
  font-weight: bold;
  font-size: 14px;
}

.intro-text-link a {
  display: inline-block;
  padding: 3px 7px;
  border: 2px outset #cccccc;
  background: #ffffcc;
  color: #cc0000;
}

.intro-text-link span {
  font-size: 18px;
  vertical-align: -1px;
}

.visit-counter strong {
  display: inline-block;
  min-width: 10ch;
  padding: 0 3px;
  border: 1px inset #999999;
  background: #000000;
  color: #00ff00;
  font-family: "Courier New", monospace;
  line-height: 1.2;
}

.site-frame {
  display: grid;
  grid-template-columns: 320px 88px 320px;
  gap: 10px;
  align-items: start;
  justify-content: center;
  margin-top: 12px;
}

.left-frame,
.right-box,
.activity-frame {
  min-width: 0;
  border: 2px solid var(--strong-line);
  background: var(--paper);
}

.right-column {
  display: grid;
  gap: 10px;
}

h2,
h3,
p {
  margin-top: 0;
}

.left-frame h2,
.right-box h2,
.activity-frame h2 {
  margin: 0;
  padding: 3px 5px;
  border-bottom: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
  text-align: center;
}

.sub-heading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 3px 5px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
  font-size: 13px;
  font-weight: normal;
  text-align: center;
}

.profile-sub-heading {
  display: block;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.work-cells,
.activity-cells,
.two-cells {
  display: grid;
}

.work-cells,
.activity-cells {
  grid-template-columns: repeat(4, 1fr);
}

.two-cells {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 4px 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
}

.contact-cell {
  gap: 2px;
}

.contact-cell span {
  display: block;
  font-size: 12px;
}

.two-cells .cell:nth-child(2n) {
  border-right: 0;
}

.row-end {
  border-right: 0;
}

.cell.wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.blank {
  color: transparent;
  pointer-events: none;
}

.banner-link {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 54px;
  margin: 7px;
  border: 1px dashed var(--line);
  background: #ffffff;
  text-align: center;
}

.section-title-link {
  color: var(--link);
}

.section-title-link:visited {
  color: var(--link);
}

.middle-rail {
  display: grid;
  gap: 9px;
  padding-top: 47px;
  text-align: center;
}

.small-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  width: 100%;
  padding: 4px;
  border: 2px outset #cccccc;
  background: #eeeeee;
  color: #000000;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
}

.small-button:active {
  border-style: inset;
}

.button-count {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

.rail-text {
  margin: 3px 0 0;
  line-height: 1.35;
}

.profile-block p,
.activity-frame p {
  margin: 5px 8px;
  text-align: center;
}

.profile-photo-wrap {
  margin-top: 8px;
}

.profile-photo {
  display: inline-block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.history-block {
  min-height: 112px;
}

.scroll-area {
  max-height: 86px;
  overflow: auto;
  margin: 8px;
  padding: 3px 5px;
  border: 1px inset #bbbbbb;
  background: #ffffff;
}

.scroll-area p {
  margin: 0 0 4px;
  font-size: 13px;
}

.scroll-area span {
  font-family: "Courier New", monospace;
}

.activity-frame {
  grid-column: 1;
}

.site-history-frame {
  grid-column: 3;
}

.site-footer {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
}

.footer-banner {
  margin: 10px 0 0;
  text-align: center;
}

.footer-banner img {
  display: block;
  width: 234px;
  max-width: 100%;
  height: 60px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: #ffffff;
  object-fit: cover;
}

.kiriban-history-mini {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
}

.kiriban-history-mini h2,
.bbs-board h2 {
  margin: 0;
  padding: 3px 5px;
  border-bottom: 1px solid var(--line);
  background: var(--head);
  font-size: 14px;
  text-align: center;
}

.kiriban-history-mini .scroll-area {
  max-height: 72px;
  margin: 6px;
}

.kiriban-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 3px;
  border-bottom: 1px dotted #cccccc;
  font-size: 12px;
}

.kiriban-comment {
  color: #333333;
}

.one-line-bbs {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 6px;
  border: 1px inset #bbbbbb;
  background: #ffffff;
}

.one-line-bbs .kiriban-row {
  min-height: 28px;
  align-items: center;
  margin: 0;
  padding: 3px 4px;
  border: 1px solid var(--line);
  background: #fffffb;
}

.bbs-note {
  margin: 8px 0 0;
  font-size: 12px;
}

.dummy-bbs {
  margin-top: 8px;
  padding: 8px;
  border: 1px inset #bbbbbb;
  background: #eef8ff;
  text-align: center;
}

.dummy-bbs p {
  margin: 0;
}

.bbs-back {
  margin: 10px 0 0;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.55);
}

.modal-backdrop[hidden] {
  display: none;
}

.kiriban-modal {
  width: min(460px, 100%);
  border: 3px double var(--strong-line);
  background: var(--paper);
  box-shadow: 0 2px 0 #000000;
}

.kiriban-modal form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.kiriban-modal h2 {
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 16px;
  text-align: center;
}

.modal-lead,
.form-note,
.form-status {
  margin: 0;
}

.kiriban-modal label {
  display: grid;
  gap: 3px;
}

.kiriban-modal input[type="text"] {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.consent-line {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: 6px;
  border: 1px dashed var(--line);
  background: #ffffff;
  font-size: 12px;
}

.form-note {
  font-size: 12px;
}

.form-status {
  min-height: 1.4em;
  color: #990000;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.page-body {
  min-height: 100vh;
}

.simple-page {
  width: 640px;
}

.simple-page .panel,
.panel {
  margin-top: 18px;
  padding: 12px;
  border: 2px solid var(--strong-line);
  background: var(--paper);
}

.simple-page h1 {
  margin: 0 0 10px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 16px;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
}

.links-page h2 {
  margin: 14px 0 0;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
}

.link-free-note {
  padding: 6px;
  border: 1px dashed var(--line);
  background: #ffffff;
  text-align: center;
}

.orutalav-page .panel {
  background: #fffffb;
}

.orutalav-reader {
  margin-bottom: 18px;
  padding: 10px;
  border: 3px double var(--strong-line);
  background: #ffffff;
}

.orutalav-title {
  margin: 0 0 10px;
  padding: 8px 6px;
  border: 1px solid var(--strong-line);
  background: #eeeeee;
  font-size: 22px;
  letter-spacing: 0;
  text-align: center;
}

.orutalav-lead {
  padding: 6px;
  border: 1px dashed var(--line);
  background: #ffffff;
  text-align: center;
}

.chapter-controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
  padding: 6px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.chapter-button {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 2px outset #cccccc;
  background: #eeeeee;
  color: #000000;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 18px;
  line-height: 1;
}

.chapter-button:active {
  border-style: inset;
}

.chapter-button:disabled {
  color: #888888;
  cursor: default;
}

.chapter-status {
  margin: 0;
  text-align: center;
  font-family: "Courier New", monospace;
}

.orutalav-story {
  padding: 10px;
  border: 1px inset #bbbbbb;
  background: #ffffff;
  line-height: 1.85;
}

.orutalav-note {
  padding: 10px;
  line-height: 1.85;
}

.orutalav-note {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.orutalav-supplement-heading {
  margin: 16px 0 0;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
  text-align: center;
}

.orutalav-story section + section {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 0;
}

.orutalav-story h2 {
  margin: 0 0 8px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
}

.orutalav-manuscript {
  margin: 0 0 12px;
  padding: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.orutalav-manuscript img {
  display: block;
  width: 100%;
  height: auto;
}

.orutalav-story p,
.orutalav-note p {
  margin: 0 0 12px;
}

.orutalav-story p:last-child,
.orutalav-note p:last-child {
  margin-bottom: 0;
}

.orutalav-story .is-hidden {
  display: none;
}

.orutalav-page hr {
  height: 0;
  margin: 14px 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.link-category {
  margin-top: 10px;
}

.link-subcategory {
  margin: 8px 0 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #f7f7f7;
  font-size: 13px;
}

.link-list {
  display: grid;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.link-item {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.link-item h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.link-item p {
  margin: 0;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.detail-nav a {
  display: inline-block;
}

.works-page {
  width: 720px;
}

.works-page .panel + .panel {
  margin-top: 12px;
}

.works-controls {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(120px, auto) minmax(120px, auto);
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.compact-controls {
  grid-template-columns: minmax(360px, 1fr) minmax(120px, auto);
}

.works-controls label {
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.search-group {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(210px, auto);
  align-items: stretch;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.works-controls .search-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 3px 6px;
  border: 0;
  min-width: 0;
}

.works-controls .search-mode label {
  display: flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}

.search-keyword {
  grid-column: auto;
}

.search-keyword,
.works-controls .search-mode {
  align-self: stretch;
  background: #f7f7f7;
}

.search-keyword {
  padding: 0;
  border: 0;
}

.works-controls input,
.works-controls select {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.works-list,
.series-list {
  display: grid;
  gap: 8px;
}

.work-card {
  padding: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.work-card h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.work-card p {
  margin: 0 0 5px;
}

.work-meta {
  font-size: 12px;
  color: #333333;
}

.work-meta p,
.work-counts {
  margin: 0 0 4px;
}

.work-detail h1 {
  margin-bottom: 6px;
}

.work-detail-item + .work-detail-item {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.work-detail-item h2 {
  margin: 0 0 8px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
}

.work-body {
  margin-top: 14px;
  padding: 10px;
  border: 1px inset #bbbbbb;
  background: #ffffff;
  font-size: 15px;
  line-height: 1.8;
}

.work-page-controls {
  margin-top: 10px;
}

.work-page-panel.is-hidden {
  display: none;
}

.work-body h2,
.work-body h3 {
  margin: 18px 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.work-body h2 {
  font-size: 17px;
}

.work-body h3 {
  font-size: 15px;
}

.work-body p,
.work-body ul {
  margin: 0 0 12px;
}

.work-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.work-usage-link {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: right;
}

.language-warning {
  margin: 8px 0 14px;
  color: #cc0000;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.notice-block {
  margin-top: 14px;
}

.notice-block h2 {
  margin: 0 0 6px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
}

.notice-block p {
  margin: 0 0 10px;
}

.notice-block ul {
  margin: 0 0 10px;
  padding-left: 1.4em;
}

.exit-button {
  display: inline-grid;
  width: auto;
  min-width: 96px;
  color: #000000;
}

.contact-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.contact-form label {
  display: grid;
  gap: 3px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
}

.contact-form input,
.contact-form select {
  min-height: 30px;
}

.contact-form textarea {
  resize: vertical;
}

.privacy-box,
.contact-complete {
  padding: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.privacy-box h2,
.contact-complete h2 {
  margin: 0 0 6px;
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 15px;
}

.privacy-box p,
.contact-complete p {
  margin: 0 0 8px;
}

.privacy-box p:last-child,
.contact-complete p:last-child {
  margin-bottom: 0;
}

.contact-submit {
  width: auto;
  min-width: 120px;
}

.is-hidden {
  display: none;
}

.work-clap-button {
  width: auto;
  min-width: 92px;
  min-height: 32px;
  padding: 4px 12px;
}

.work-share-button {
  width: auto;
  min-width: 92px;
  min-height: 32px;
  padding: 4px 12px;
}

.work-action-status {
  min-width: 9em;
  font-size: 12px;
  text-align: right;
}

.series-share-actions {
  justify-content: flex-start;
  margin: 8px 0;
}

.empty-message {
  margin: 0;
  padding: 8px;
  border: 1px dashed var(--line);
  background: #ffffff;
}

.map-toolbar {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.map-tool-button {
  width: auto;
  min-width: 70px;
  min-height: 30px;
}

.writing-map-viewport {
  overflow: auto;
  margin: 8px 0 12px;
  height: min(70vw, 560px);
  max-height: 560px;
  border: 2px solid var(--strong-line);
  background: #eef7ff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.writing-map-viewport.is-dragging {
  cursor: grabbing;
}

.writing-map-board {
  position: relative;
  width: 620px;
  height: 620px;
  min-width: 620px;
  min-height: 620px;
  background:
    linear-gradient(90deg, rgba(128, 128, 128, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(128, 128, 128, 0.16) 1px, transparent 1px),
    #eef7ff;
  background-size: 10% 10%;
  overflow: hidden;
  transform-origin: 0 0;
}

.writing-map-board::before {
  content: "日本フォーカス / 緯度経度から簡易配置";
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 1;
  padding: 2px 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
}

.japan-map-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.japan-map-shape {
  position: absolute;
  display: none;
  z-index: 0;
  border: 1px solid #7a9666;
  background: #e4f3d7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.japan-main {
  left: 42%;
  top: 16%;
  width: 18%;
  height: 55%;
  border-radius: 58% 42% 44% 56%;
  transform: rotate(28deg);
}

.japan-hokkaido {
  left: 60%;
  top: 4%;
  width: 18%;
  height: 16%;
  border-radius: 48% 52% 45% 55%;
  transform: rotate(-12deg);
}

.japan-shikoku {
  left: 34%;
  top: 55%;
  width: 13%;
  height: 8%;
  border-radius: 50%;
  transform: rotate(-12deg);
}

.japan-kyushu {
  left: 25%;
  top: 60%;
  width: 13%;
  height: 16%;
  border-radius: 50% 45% 55% 44%;
  transform: rotate(18deg);
}

.japan-okinawa {
  left: 19%;
  top: 87%;
  width: 8%;
  height: 4%;
  border-radius: 50%;
}

.map-pin {
  position: absolute;
  z-index: 2;
  max-width: 190px;
  transform: translate(-14px, -28px);
  font-size: 12px;
}

.map-pin summary {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
}

.map-pin-number {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--strong-line);
  border-radius: 50%;
  background: #ffef6a;
  font-family: "Courier New", monospace;
}

.map-pin[open] {
  z-index: 3;
}

.map-pin ul {
  margin: 2px 0 0;
  padding: 5px 5px 5px 1.4em;
  border: 1px solid var(--line);
  background: #ffffff;
}

.map-area-list {
  display: grid;
  gap: 8px;
}

.map-area-block {
  padding: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.map-area-block h2,
.map-area-block h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.map-area-block h2 {
  padding: 3px 5px;
  border: 1px solid var(--line);
  background: var(--head);
  font-size: 17px;
  font-weight: bold;
}

.map-area-block ul {
  margin: 0 0 8px;
  padding-left: 1.4em;
}

.original-images {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.original-images figure {
  margin: 0;
  padding: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.original-images img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.original-images figcaption {
  margin-top: 4px;
  font-size: 12px;
  text-align: center;
}

.haiku-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 720px) {
  .site-frame {
    grid-template-columns: 1fr;
  }

  .middle-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }

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

  .activity-frame,
  .site-history-frame {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .work-cells,
  .activity-cells,
  .two-cells,
  .middle-rail {
    grid-template-columns: 1fr;
  }

  .work-cells .cell,
  .activity-cells .cell,
  .two-cells .cell {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .works-controls {
    grid-template-columns: 1fr;
  }

  .search-group {
    grid-template-columns: 1fr;
  }

  .works-controls .search-mode {
    display: grid;
    grid-template-columns: 1fr;
  }
}
