:root {
  --xp-blue: #b84fc4;
  --xp-blue-dark: #5d1b91;
  --xp-blue-light: #ff9fd2;
  --paper: #fff6ff;
  --ink: #2a2034;
  --muted: #7a6888;
  --border: #5d1b91;
  --accent: #f0ddff;
  --shadow: rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  font-family: "MS UI Gothic", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
  background: linear-gradient(135deg, #522f91 0%, #b458c2 48%, #ff9bbd 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.desktop {
  min-height: 100vh;
  padding: 24px 18px 56px;
  position: relative;
}

.desktop::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 64px 64px;
  mix-blend-mode: soft-light;
}

.desktop::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 100%, rgba(78, 20, 128, .32), transparent 42%);
  opacity: .32;
}

.is-hidden {
  display: none !important;
}

.cover-window {
  width: min(680px, calc(100vw - 128px));
  margin: 42px auto 0;
  position: relative;
  z-index: 2;
  border: 2px solid #5d1b91;
  border-radius: 8px 8px 3px 3px;
  background: #f0e8f8;
  box-shadow: 0 24px 54px rgba(37, 8, 66, .48);
  overflow: hidden;
}

.cover-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  color: #fff;
  background: linear-gradient(180deg, #ff9fd2 0%, #bd55c7 46%, #6531b5 100%);
  font-weight: 700;
  font-size: 13px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}

.cover-titlebar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cover-signal {
  color: #ffe4f4;
  font-size: 12px;
  font-weight: 400;
}

.cover-wizard {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 400px;
}

.cover-wizard-panel {
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  color: #fff;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 160, 220, .28), transparent 60%),
    linear-gradient(175deg, #7e2faa 0%, #4a1570 50%, #200a38 100%);
  position: relative;
  overflow: hidden;
}

.cover-wizard-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 32px);
  pointer-events: none;
}

.cover-kicker {
  margin: 0 0 6px;
  color: #e8b8ff;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: lowercase;
}

.cover-subcopy {
  margin: 0 0 20px;
  color: #c896e8;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .04em;
  opacity: 0.8;
}

.wordart-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(28px, 5vw, 40px);
  font-style: italic;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #ffd2f2 30%, #df7bd6 60%, #c9a0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(80, 0, 120, .4));
}

.wordart-title span {
  display: block;
  margin-top: 10px;
  font-size: clamp(13px, 2vw, 16px);
  font-style: normal;
  font-weight: 700;
}

.cover-author {
  margin: auto 0 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 14px;
  color: #ddb8f8;
}

.cover-wizard-body {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 20px;
  background: #f5eeff;
  border-left: 1px solid #d8b8ec;
}

.cover-wizard-heading {
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid #c9a0e8;
  font-size: 17px;
  font-weight: 700;
  color: #3a1558;
}

.cover-copy {
  margin: 16px 0 0;
  color: #3d2455;
  line-height: 1.85;
  font-size: 14px;
  flex: 1;
}

.cover-wizard-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #d0aee8;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cover-enter {
  min-height: 28px;
  padding: 5px 18px;
  border: 1px solid #a060cc;
  border-radius: 2px;
  color: #2d113f;
  background: linear-gradient(#fff8ff, #eadcf3);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), 0 2px 4px rgba(46, 5, 74, .2);
  font-size: 13px;
  font-weight: 700;
}

.cover-enter:hover,
.cover-enter:focus-visible {
  border-color: #8040b0;
  background: linear-gradient(#fff4ff, #dfbcf5);
  outline: none;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .9), 0 2px 6px rgba(46, 5, 74, .3);
}

.cover-kakuyomu {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #7040a0;
  text-decoration: underline;
  opacity: 0.85;
}

.cover-kakuyomu:hover {
  opacity: 1;
  color: #4a1a7a;
}

.desktop-icons {
  position: fixed;
  left: 18px;
  top: 22px;
  display: grid;
  gap: 18px;
  z-index: 1;
}

.desktop-icon {
  display: block;
  width: 88px;
  padding: 4px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
  background: transparent;
  border: none;
  font: inherit;
  cursor: pointer;
}

.desktop-icon:hover,
.desktop-icon:focus-visible {
  outline: 1px dotted #fff;
  background: rgba(18, 78, 154, .35);
}

.icon-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 5px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 4px;
  background: linear-gradient(#fffdf6, #d8ecff);
  box-shadow: inset 0 0 0 1px rgba(38, 87, 159, .25), 1px 2px 4px rgba(0, 0, 0, .26);
  color: #1f58b9;
  font-size: 24px;
  text-shadow: none;
}

.icon-art img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.icon-label {
  display: block;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.window {
  width: min(1060px, calc(100vw - 128px));
  min-height: min(720px, calc(100vh - 96px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
  border: 2px solid var(--border);
  border-radius: 8px 8px 3px 3px;
  background: #efe4f4;
  box-shadow: 0 20px 44px var(--shadow);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 5px 7px 5px 10px;
  color: #fff;
  background: linear-gradient(180deg, #ff9fd2 0%, #b84fc4 44%, #5d1b91 100%);
  user-select: none;
}

.titlebar-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}

.titlebar-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(#fff8ff, #ead3ff);
  color: var(--xp-blue-dark);
  text-shadow: none;
  font-size: 14px;
}

.titlebar-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.window-control {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 3px;
  color: #fff;
  background: linear-gradient(#f5d7ff, #b84fc4 48%, #6d2aa5);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
  line-height: 1;
  font-weight: 700;
}

.window-control.close {
  background: linear-gradient(#ffd3ee, #d946a7 48%, #8a1b78);
  cursor: pointer;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 31px;
  padding: 3px 7px;
  border-bottom: 1px solid #d3b8df;
  background: #efe4f4;
}

.menu-link {
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid transparent;
  color: #2f2142;
  background: transparent;
  text-decoration: none;
}

.menu-link:hover,
.menu-link:focus-visible,
.menu-link.active {
  border-color: #b78bcc;
  background: #fff3ff;
  outline: 0;
}

.window-body {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: calc(min(720px, calc(100vh - 96px)) - 68px);
  border-top: 1px solid #fff8ff;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #c9aee0;
  background: linear-gradient(180deg, #fbf0ff 0%, #eadcf3 100%);
  min-height: 0;
}

.content {
  grid-column: 2;
  grid-row: 1 / -1;
}

.poem-list {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid #c9aee0;
  background: linear-gradient(180deg, #fbf0ff 0%, #eadcf3 100%);
}

.bookplate {
  padding: 20px 18px 16px;
  border-bottom: 1px solid #d5badf;
  overflow: hidden;
}

.site-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: 0;
}

.subtitle {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  color: #42495a;
}

.author {
  margin-top: 15px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 15px;
}

.poem-list,
.edit-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px;
  list-style: none;
  overflow: auto;
}

.poem-list button,
.edit-list button {
  width: 100%;
  min-height: 42px;
  margin-bottom: 6px;
  padding: 7px 9px;
  border: 1px solid #d2b9df;
  border-radius: 2px;
  background: #fff5ff;
  color: #33243f;
  text-align: left;
}

.poem-list button:hover,
.poem-list button.active,
.edit-list button:hover,
.edit-list button.active {
  border-color: #316ac5;
  background: var(--accent);
}

.poem-number {
  display: block;
  color: #4b5b82;
  font-size: 12px;
}

.content {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 54px;
  overflow: hidden;
  background: #f5e9fb;
}

.visual-poem {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d6bade;
  background:
    linear-gradient(rgba(255, 246, 255, .82), rgba(255, 246, 255, .82)),
    var(--poem-image, none),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(166, 94, 185, .1) 32px);
  background-size: cover, cover, auto;
  background-position: center;
  box-shadow: inset 0 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, .08);
}

.poem-inner {
  min-height: 520px;
  padding: clamp(24px, 5vw, 60px);
  background: color-mix(in srgb, var(--poem-wash, #fff2fb) 28%, transparent);
}

.poem-title {
  margin: 0 0 24px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  color: #2d2038;
}

.poem-meta {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 12px;
}

.poem-song-link {
  margin-left: 8px;
  color: var(--muted);
  text-decoration: underline;
  opacity: 0.8;
}

.poem-song-link:hover {
  opacity: 1;
}

.poem-body {
  margin: 0;
  font-family: "MS Gothic", "MS UI Gothic", "Yu Gothic", Consolas, monospace;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.82;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #2b2234;
}

.poem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -12px 0 18px;
}

.poem-tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #c9aee0;
  border-radius: 2px;
  background: rgba(200, 160, 230, 0.12);
  color: #8a5aaa;
  font-family: "MS Gothic", "MS UI Gothic", Consolas, monospace;
  font-size: 10px;
  letter-spacing: .04em;
  line-height: 1.6;
}

.poem-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 1px;
  opacity: 1;
  animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.loading,
.empty-state {
  margin: 0;
  color: #4d5060;
  line-height: 1.8;
}

.poem-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  border-top: 1px solid rgba(180, 138, 205, .42);
  background: #f5e9fb;
  z-index: 1;
}

#prevBtn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

#nextBtn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.poem-nav-button {
  min-width: 86px;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #b78bcc;
  border-radius: 2px;
  background: linear-gradient(#fff8ff, #eadcf3);
  color: #2f2142;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .85);
}

.poem-nav-button:hover,
.poem-nav-button:focus-visible {
  border-color: #a64bc3;
  background: linear-gradient(#fff4ff, #dfbcf5);
  outline: 0;
}

.poem-nav-button:disabled {
  color: #9b8aa8;
  border-color: #d6c4df;
  background: #f2e9f7;
  cursor: default;
}

.taskbar {
  position: fixed;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 4px 8px;
  color: #fff;
  background: linear-gradient(180deg, #ff9ed5 0%, #b84fc4 43%, #56219b 100%);
  box-shadow: 0 -1px 0 rgba(255, 236, 250, .55) inset, 0 -5px 18px rgba(85, 20, 127, .28);
}

.start-menu {
  position: fixed;
  bottom: 40px;
  left: 0;
  width: 260px;
  z-index: 20;
  border: 1px solid #5d1b91;
  border-radius: 8px 8px 0 0;
  background: #f0e8f8;
  box-shadow: 2px -4px 18px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.start-menu-header {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ff9fd2 0%, #b84fc4 44%, #5d1b91 100%);
}

.start-menu-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
}

.start-menu-author {
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  margin-top: 2px;
}

.start-menu-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.start-menu-item {
  display: block;
  padding: 9px 16px;
  text-decoration: none;
  color: #2a2034;
  font-size: 13px;
  font-weight: 700;
}

.start-menu-item:hover {
  background: linear-gradient(90deg, #b84fc4 0%, #7b2faf 100%);
  color: #fff;
}

.start-menu-divider {
  height: 1px;
  margin: 4px 8px;
  background: #d0b0e8;
}

.start-button {
  display: inline-flex;
  align-items: center;
  height: 31px;
  padding: 0 14px 0 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 15px 8px 8px 15px;
  color: #f8f6fb;
  background: linear-gradient(#5b5963, #37343d 48%, #1d1b22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 1px 1px 4px rgba(20, 10, 28, .32);
  font-weight: 700;
  text-decoration: none;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .65);
}

.task {
  display: flex;
  align-items: center;
  min-width: 0;
  width: min(350px, 48vw);
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 248, 255, .54);
  border-radius: 3px;
  background: linear-gradient(#efdfff, #d8bdf4 52%, #b990df);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .46);
  color: #2f2142;
  text-shadow: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task:empty {
  display: none;
}

.clock {
  margin-left: auto;
  padding: 0 10px;
  font-size: 13px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}

.admin-window {
  width: min(1120px, calc(100vw - 38px));
}

.admin-locked {
  min-height: 520px;
  padding: 34px;
  background: #f5e9fb;
}

.admin-locked h1 {
  margin: 0 0 12px;
  font-size: 26px;
}

.gate-window {
  width: min(480px, calc(100vw - 38px));
}

.gate-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 320px;
  padding: 40px;
  background: #f5e9fb;
  text-align: center;
}

.gate-icon {
  font-size: 40px;
}

.gate-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #33243f;
  font-family: "MS Gothic", "MS UI Gothic", Consolas, monospace;
  letter-spacing: .08em;
}

.gate-desc {
  margin: 0;
  font-size: 13px;
  color: #5a3a6e;
}

.gate-btn {
  margin-top: 8px;
  padding: 8px 24px;
}

.admin-editor {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  min-height: calc(min(720px, calc(100vh - 96px)) - 68px);
  border-top: 1px solid #fff8ff;
  background: #f5e9fb;
}

.admin-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #c9aee0;
  background: linear-gradient(180deg, #fbf0ff 0%, #eadcf3 100%);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #d5badf;
  background: #efe4f4;
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(30, 10, 50, .45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-dialog {
  width: min(380px, calc(100vw - 32px));
  border: 2px solid #5d1b91;
  border-radius: 8px 8px 3px 3px;
  background: #f0e8f8;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.xp-dialog-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px 5px 12px;
  background: linear-gradient(180deg, #ff9fd2 0%, #b84fc4 44%, #5d1b91 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  user-select: none;
}

.xp-dialog-close {
  cursor: pointer;
  padding: 0 4px;
  font-size: 15px;
  line-height: 1;
  opacity: .85;
}

.xp-dialog-close:hover { opacity: 1; }

.xp-dialog-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 10px;
}

.xp-dialog-icon {
  font-size: 32px;
  margin: 0;
  flex: 0 0 auto;
}

.xp-dialog-text p {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.xp-dialog-sub {
  color: #6a5880;
  font-weight: 400 !important;
  font-size: 12px !important;
}

.xp-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #d5badf;
}

.xp-button {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #b78bcc;
  border-radius: 2px;
  background: linear-gradient(#fff8ff, #eadcf3);
  color: #2f2142;
  box-shadow: inset 1px 1px 0 #fff;
}

.xp-button.primary {
  border-color: #a64bc3;
  background: linear-gradient(#fff4ff, #dfbcf5);
}

.xp-button.danger {
  border-color: #b9472a;
  color: #611700;
}

.edit-form {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(420px, 1fr) auto;
  min-height: 0;
  padding: 14px;
  gap: 10px;
  overflow: auto;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.field-row-meta {
  grid-template-columns: repeat(4, 1fr);
}

.field,
.field-row label {
  display: grid;
  gap: 5px;
}

.field {
  grid-template-rows: auto 1fr;
}

.field span,
.field-row span {
  color: #33243f;
  font-weight: 700;
}

.field input,
.field-row input,
.field textarea {
  width: 100%;
  border: 1px solid #bda0d3;
  border-radius: 0;
  background: #fff7ff;
  color: #2a2034;
}

.field input,
.field-row input {
  min-height: 32px;
  padding: 6px 8px;
}

.field textarea {
  min-height: 0;
  height: 100%;
  padding: 9px;
  resize: vertical;
  line-height: 1.65;
  font-family: "MS Gothic", "MS UI Gothic", "Yu Gothic", Consolas, monospace;
  font-size: 16px;
  white-space: pre-wrap;
}

.analytics-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: #f5e9fb;
  overflow-y: auto;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #33243f;
}

.analytics-summary {
  font-size: 13px;
  color: #5a3a6e;
  padding: 8px 12px;
  background: #ede0f8;
  border: 1px solid #c9aee0;
  border-radius: 2px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table th,
.analytics-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #ddd0ee;
  text-align: left;
}

.analytics-table th {
  background: #e8d5f5;
  font-weight: 700;
  color: #33243f;
}

.analytics-table tr:hover td {
  background: #f0e4fc;
}

.analytics-count {
  font-weight: 700;
  color: #7c3aad;
  text-align: right !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.publish-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status {
  min-height: 20px;
  color: #315a2d;
  font-size: 13px;
}

.button-row {
  display: flex;
  gap: 8px;
}

@media (max-width: 860px) {
  .desktop {
    padding: 0 0 50px;
  }

  .desktop-icons {
    display: none;
  }

  .window {
    width: 100%;
    min-height: calc(100dvh - 60px);
    overflow: clip;
  }

  .cover-window {
    width: 100%;
    margin-top: 0;
  }

  .cover-wizard {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 80px);
  }

  .cover-wizard-panel {
    min-height: 160px;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 20px 20px;
  }

  .cover-kicker {
    font-size: 11px;
  }

  .cover-author {
    margin: 0;
    white-space: nowrap;
  }

  .cover-wizard-body {
    border-left: none;
    border-top: 1px solid #d8b8ec;
    flex: 1;
  }

  .window-body,
  .admin-editor {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: calc(100dvh - 128px);
  }

  .sidebar,
  .admin-list-panel {
    grid-column: 1;
    grid-row: 1;
    max-height: none;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid #c9aee0;
  }

  .content {
    grid-column: 1;
    grid-row: 2;
  }

  .poem-list {
    grid-column: 1;
    grid-row: 3;
    border-right: 0;
    border-top: 1px solid #c9aee0;
    max-height: 140px;
    padding-bottom: 60px;
  }

  .bookplate {
    padding: 10px 14px;
  }

  .site-title {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .subtitle {
    margin-top: 4px;
    font-size: 13px;
  }

  .author {
    margin-top: 8px;
    font-size: 13px;
  }

  .poem-list,
  .edit-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    max-height: 120px;
  }

  .poem-list li,
  .edit-list li {
    flex: 0 0 auto;
    width: 100%;
  }

  .poem-list button,
  .edit-list button {
    width: 100%;
    min-height: 32px;
    padding: 4px 8px;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .poem-number {
    font-size: 11px;
  }

  .visual-poem {
    min-height: unset;
  }

  .poem-inner {
    min-height: unset;
    padding: 16px 14px 16px;
  }

  .content {
    padding: 8px 8px 54px;
  }

  /* モバイルのみ: viewport基準で固定。コンテナ幅の問題を完全回避 */
  .poem-nav {
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    z-index: 4;
  }
}

@media (max-width: 560px) {
  .menubar {
    overflow-x: auto;
  }

  .menu-link {
    flex: 0 0 auto;
  }

  .window-controls {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .titlebar-text,
  .task {
    font-size: 13px;
  }

  .clock {
    display: none;
  }

  .poem-title {
    font-size: 20px;
  }

  .poem-body {
    font-size: 15px;
    line-height: 1.9;
  }

  .poem-inner {
    padding: 16px 14px 24px;
  }

  .sidebar,
  .admin-list-panel {
    max-height: 155px;
  }

  .poem-nav-button {
    min-width: 72px;
    font-size: 13px;
  }
}
