@charset "UTF-8";

:root {
  --editor-bg: #e9e7e2;
  --editor-panel: #f8f7f4;
  --editor-paper: #fff;
  --editor-text: #2f302e;
  --editor-sub: #72756f;
  --editor-line: #d9d7d1;
  --editor-accent: #54675d;
  --editor-accent-dark: #3f5148;
  --editor-warm: #8c684d;
  --header-height: 66px;
  --side-width: 430px;
}

* { box-sizing: border-box; }

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

body {
  color: var(--editor-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background: var(--editor-bg);
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.demo-app { min-height: 100vh; }

.demo-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  min-height: var(--header-height);
  padding: 9px 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  background: rgba(34, 39, 36, .98);
  color: #fff;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .16);
}

.demo-brand { display: flex; align-items: center; gap: 11px; }
.demo-brand__mark {
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Yu Mincho", serif;
  font-size: 17px;
}
.demo-brand p { margin: 0; }
.demo-brand__name { font: 18px "Yu Mincho", serif; letter-spacing: .16em; }
.demo-brand__sub { margin-top: 2px !important; color: #d7ddd8; font-size: 11px; letter-spacing: .14em; }

.demo-view-actions { display: flex; align-items: center; gap: 5px; }
.demo-view-actions__label { margin-right: 5px; color: #bdc4bf; font-size: 11px; }

.view-button, .icon-button {
  min-height: 34px;
  border: 1px solid #626a65;
  border-radius: 6px;
  background: transparent;
  color: #e7ebe8;
  cursor: pointer;
}
.view-button { min-width: 54px; padding: 4px 10px; font-size: 12px; }
.view-button.is-active { border-color: #fff; background: #fff; color: #303631; }
.icon-button { width: 35px; margin-left: 3px; font-size: 17px; }
.view-button:hover, .icon-button:hover { border-color: #fff; }

.demo-header__note { justify-self: end; color: #bdc4bf; font-size: 10px; letter-spacing: .02em; }

.demo-workspace {
  min-height: 100vh;
  padding-top: var(--header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-width);
}

.preview-pane {
  min-width: 0;
  padding: 37px 22px 22px;
  background: #d6d4cf;
  overflow: hidden;
}

.preview-label {
  height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #5e625e;
  font-size: 11px;
  letter-spacing: .08em;
}
.preview-label small { opacity: 0; transition: opacity .2s; letter-spacing: 0; }
.preview-label small.is-visible { opacity: 1; }

.preview-stage {
  width: 100%;
  height: calc(100vh - var(--header-height) - 89px);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 24px rgba(52, 47, 40, .18);
  transition: width .3s ease;
}
.preview-stage[data-view="mobile"] { width: min(390px, 100%); }
.preview-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.editor-pane {
  position: fixed;
  z-index: 10;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--side-width);
  display: flex;
  flex-direction: column;
  background: var(--editor-panel);
  border-left: 1px solid #c9c8c3;
  box-shadow: -5px 0 18px rgba(0,0,0,.05);
}

.editor-heading {
  min-height: 80px;
  padding: 14px 18px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--editor-line);
}
.editor-heading span { color: var(--editor-sub); font-size: 10px; letter-spacing: .12em; }
.editor-heading h1 { margin: 3px 0 0; font-size: 18px; font-weight: 600; }

.reset-button {
  padding: 7px 10px;
  border: 1px solid #c9bfb5;
  border-radius: 5px;
  background: #fff;
  color: #785c4b;
  cursor: pointer;
  font-size: 11px;
}
.reset-button:hover { background: #f8f1ed; }

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--editor-line);
  background: #f0efeb;
}
.editor-tab {
  min-height: 47px;
  border: 0;
  border-right: 1px solid var(--editor-line);
  background: transparent;
  color: #646762;
  cursor: pointer;
  font-size: 12px;
}
.editor-tab:last-child { border-right: 0; }
.editor-tab.is-active { position: relative; background: #fff; color: var(--editor-accent-dark); font-weight: 600; }
.editor-tab.is-active::after { content: ""; position: absolute; right: 16px; bottom: 0; left: 16px; height: 3px; background: var(--editor-accent); }

.editor-scroll { flex: 1; overflow-y: auto; background: #f6f5f2; }
.editor-panel { padding: 17px 16px 45px; }
.editor-panel[hidden] { display: none; }
.panel-lead { margin: 0 2px 14px; color: #676a65; font-size: 12px; line-height: 1.7; }
.panel-hint { margin: 14px 3px 0; color: #777a75; font-size: 11px; line-height: 1.7; }

.word-guide-entry {
  position: relative;
  margin: 0 0 14px;
  padding: 18px 17px 16px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #fff 0 64%, #edf3ef 64% 100%);
}
.word-guide-entry::after {
  content: "";
  position: absolute;
  right: -19px;
  bottom: -27px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(84, 103, 93, .18);
  border-radius: 50%;
}
.word-guide-entry__label {
  color: #78867d;
  font-size: 9px;
  letter-spacing: .14em;
}
.word-guide-entry h2 {
  margin: 4px 0 7px;
  font: 600 16px "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: .05em;
}
.word-guide-entry p {
  max-width: 290px;
  margin: 0 0 13px;
  color: #656b66;
  font-size: 11px;
  line-height: 1.75;
}
.word-guide-entry__button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 5px;
  background: var(--editor-accent);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}
.word-guide-entry__button:hover { background: var(--editor-accent-dark); }
.word-guide-entry small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: #8a8e89;
  font-size: 9px;
}

.edit-card { margin-bottom: 10px; border: 1px solid var(--editor-line); border-radius: 7px; background: #fff; overflow: hidden; }
.edit-card summary { position: relative; padding: 13px 39px 13px 14px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.edit-card summary::-webkit-details-marker { display: none; }
.edit-card summary::after { content: "+"; position: absolute; top: 50%; right: 15px; transform: translateY(-50%); color: #7e837e; font-size: 19px; font-weight: 300; }
.edit-card[open] summary::after { content: "−"; }
.edit-card[open] summary { border-bottom: 1px solid #ebe9e4; }
.edit-card__body { padding: 15px 14px 17px; }

.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; margin-bottom: 5px; color: #5f625d; font-size: 11px; font-weight: 600; }
.field input[type="text"], .field input[type="date"], .field textarea, .field select {
  width: 100%;
  border: 1px solid #cbc9c3;
  border-radius: 5px;
  background: #fff;
  color: #30312f;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; }
.field select { min-height: 39px; }
.field > small { display: block; margin-top: 5px; color: #7c7f7a; font-size: 9px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: #758a7e; box-shadow: 0 0 0 3px rgba(94, 119, 105, .12); }

.image-field, .post-image-select { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 7px; }
.image-field img, .post-image-select img { width: 64px; height: 51px; border-radius: 4px; object-fit: cover; background: #eee; }
.file-button, .subtle-button, .primary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
}
.file-button { border: 1px solid var(--editor-accent); background: #fff; color: var(--editor-accent-dark); }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.subtle-button { border: 1px solid #d2d0ca; background: #fff; color: #686b67; }
.primary-button { border: 1px solid var(--editor-accent); background: var(--editor-accent); color: #fff; }
.primary-button:hover { background: var(--editor-accent-dark); }

.book-field { padding: 12px 0; border-top: 1px dashed #ddd9d2; }
.book-field:first-child { padding-top: 0; border-top: 0; }
.book-field:last-child { padding-bottom: 0; }
.book-field h3 { margin: 0 0 10px; color: #747770; font-size: 11px; }
.card-link-settings { margin-top: 15px; padding: 12px 11px 1px; border-radius: 6px; background: #f5f6f3; }
.card-link-settings [hidden] { display: none; }

.layout-list { display: grid; gap: 9px; }
.layout-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--editor-line);
  border-radius: 7px;
  background: #fff;
}
.layout-item.is-hidden { opacity: .55; }
.layout-item__grip { color: #999b97; text-align: center; letter-spacing: -2px; }
.layout-item strong { display: block; font-size: 12px; }
.layout-item small { display: block; margin-top: 2px; color: #868985; font-size: 10px; }
.layout-item__actions { display: flex; gap: 4px; }
.layout-item__actions button { width: 29px; height: 29px; padding: 0; border: 1px solid #d5d3ce; border-radius: 4px; background: #fafafa; cursor: pointer; }
.layout-item__actions button:disabled { opacity: .25; cursor: default; }
.layout-item__actions .visibility-button { width: auto; padding: 0 7px; font-size: 10px; }

.theme-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { position: relative; min-height: 142px; padding: 9px; border: 1px solid var(--editor-line); border-radius: 7px; background: #fff; cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card.is-active { border-color: var(--editor-accent); box-shadow: 0 0 0 2px rgba(84,103,93,.12); }
.theme-card.is-coming { opacity: .62; cursor: default; }
.theme-card.is-coming::after { content: "準備中"; position: absolute; top: 16px; right: 14px; padding: 3px 6px; border-radius: 10px; background: rgba(255,255,255,.9); font-size: 9px; }
.theme-card__swatch { display: block; height: 68px; margin-bottom: 8px; border-radius: 4px; }
.theme-card__swatch--simple { background: linear-gradient(135deg, #f6f5f1 0 45%, #dddcd7 45% 70%, #aeb3aa 70%); }
.theme-card__swatch--natural { background: linear-gradient(135deg, #f3eee2 0 45%, #d5ddbd 45% 72%, #9ba97b 72%); }
.theme-card__swatch--literary { background: linear-gradient(135deg, #eee7dc 0 42%, #394b46 42% 75%, #1e2825 75%); }
.theme-card__swatch--modern { background: linear-gradient(135deg, #f3f7fa 0 42%, #c7d9e4 42% 75%, #53778d 75%); }
.theme-card strong { display: block; font: 14px "Yu Mincho", serif; }
.theme-card small { display: block; margin-top: 3px; color: #777a76; font-size: 9px; line-height: 1.5; }

.appearance-controls { margin-top: 18px; display: grid; gap: 11px; }
.appearance-group { margin: 0; padding: 14px; border: 1px solid var(--editor-line); border-radius: 7px; background: #fff; }
.appearance-group legend { padding: 0 5px; font-size: 12px; font-weight: 600; }
.appearance-group > p { margin: -2px 0 11px; color: #777a75; font-size: 10px; line-height: 1.6; }
.choice-row { position: relative; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 9px; border: 1px solid #e3e1dc; cursor: pointer; }
.choice-row + .choice-row { margin-top: 7px; }
.choice-row:has(input:checked) { border-color: #7c8f84; background: #f6f8f7; }
.choice-row input { accent-color: var(--editor-accent); }
.choice-row span { min-width: 0; flex: 1; }
.choice-row strong, .choice-row small { display: block; }
.choice-row strong { font-size: 11px; }
.choice-row small { margin-top: 2px; color: #7c7f7a; font-size: 9px; }
.detected-color { width: 25px; height: 25px; flex: 0 0 auto; border: 3px solid #fff; border-radius: 50%; background: #a9896a; box-shadow: 0 0 0 1px #c6c3bd; }
.mood-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mood-buttons label { cursor: pointer; }
.mood-buttons input { position: absolute; opacity: 0; }
.mood-buttons span { min-height: 38px; display: grid; place-items: center; padding: 5px; border: 1px solid #d7d5cf; border-radius: 5px; color: #666965; font-size: 10px; text-align: center; }
.mood-buttons input:checked + span { border-color: var(--editor-accent); background: var(--editor-accent); color: #fff; }
.appearance-position { margin: 0; padding: 14px; border: 1px solid var(--editor-line); border-radius: 7px; background: #fff; }
.appearance-position[hidden] { display: none; }
.appearance-position > small { display: block; margin: -1px 0 8px; color: #7c7f7a; font-size: 9px; line-height: 1.6; }
.appearance-position select { width: 100%; padding: 8px 10px; border: 1px solid #cbc9c3; border-radius: 5px; background: #fff; color: #30312f; font-size: 11px; }
.appearance-position--image { margin-top: 11px; padding: 11px; background: #f8f8f6; }

.post-form { padding: 14px; border: 1px solid var(--editor-line); border-radius: 7px; background: #fff; }
.post-image-select { grid-template-columns: 64px 1fr; }
.post-form__actions { display: flex; gap: 8px; margin-top: 18px; }
.post-form__actions .primary-button { flex: 1; }
.post-admin-list-wrap { margin-top: 22px; }
.post-admin-list-wrap h2 { margin: 0 0 10px; font-size: 14px; }
.post-admin-list { display: grid; gap: 7px; }
.post-admin-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 11px; border: 1px solid var(--editor-line); border-radius: 6px; background: #fff; }
.post-admin-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.post-admin-item time { color: #888b86; font-size: 9px; }
.post-admin-item__actions { display: flex; gap: 4px; }
.post-admin-item button { padding: 5px 7px; border: 1px solid #d6d4cf; border-radius: 4px; background: #fafafa; cursor: pointer; font-size: 9px; }
.post-admin-item .delete-post { color: #865b52; }

.mobile-pane-tabs { display: none; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 320px; padding: 11px 15px; border-radius: 6px; background: #303832; color: #fff; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s ease; font-size: 12px; box-shadow: 0 5px 20px rgba(0,0,0,.2); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
  :root { --side-width: 390px; }
  .demo-header { grid-template-columns: 1fr auto; }
  .demo-header__note { display: none; }
  .demo-view-actions { justify-self: end; }
}

@media (max-width: 760px) {
  :root { --header-height: 58px; --side-width: 100%; }
  .demo-header { min-height: var(--header-height); padding: 7px 11px; grid-template-columns: 1fr auto; gap: 8px; }
  .demo-brand__mark { width: 34px; height: 34px; }
  .demo-brand__name { font-size: 15px; }
  .demo-brand__sub { margin-top: 0 !important; font-size: 9px; }
  .demo-view-actions__label, .view-button { display: none; }
  .mobile-pane-tabs { position: fixed; z-index: 19; top: var(--header-height); right: 0; left: 0; height: 45px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-bottom: 1px solid var(--editor-line); }
  .mobile-pane-tab { border: 0; background: #f0efeb; color: #656863; font-size: 12px; }
  .mobile-pane-tab.is-active { background: #fff; color: var(--editor-accent-dark); font-weight: 600; box-shadow: inset 0 -3px var(--editor-accent); }
  .demo-workspace { display: block; padding-top: calc(var(--header-height) + 45px); }
  .preview-pane { display: none; height: calc(100vh - var(--header-height) - 45px); padding: 8px; }
  .preview-pane.is-active { display: block; }
  .preview-label { height: 25px; padding: 0 3px; }
  .preview-stage { height: calc(100vh - var(--header-height) - 86px); }
  .editor-pane { display: none; position: fixed; top: calc(var(--header-height) + 45px); width: 100%; }
  .editor-pane.is-active { display: flex; }
  .editor-heading { min-height: 67px; }
  .editor-tabs { flex: none; }
  .theme-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 390px) {
  .theme-list { grid-template-columns: 1fr; }
}
