:root {
  --navy: #192e6e;
  --gold: #ffbd59;
  --danger: #b42318;
  --grey: #5c6370;
  --border: #d5dbe3;
  --bg: #f4f6f9;
  --white: #fff;
  --font: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
button, input, select, textarea { font: inherit; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.top__kicker { margin: 0; font-size: 12px; color: var(--grey); letter-spacing: .08em; }
.top h1 { margin: 0; font-size: 22px; }
.top__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.top__account { position: relative; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-left: auto; }
.account-menu__btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.account-menu__btn svg { display: block; }
.account-menu__panel { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mode-nav {
  display: flex;
  gap: 4px;
  margin: 12px 0 0;
  border-bottom: 1px solid var(--border);
}
.mode-nav__btn {
  margin: 0 0 -1px;
  padding: 10px 16px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--grey);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.mode-nav__btn.is-current {
  color: var(--navy);
  border-bottom-color: var(--navy);
  background: transparent;
}
.mode-nav__btn:disabled { opacity: .4; cursor: default; }
.list__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 8px 10px 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  background: var(--navy);
}
.list__group-sort {
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}
.list__group-sort.is-on {
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}
.content-band {
  margin: 20px -32px 12px;
  padding: 8px 32px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  background: var(--navy);
}
.content-band:first-child { margin-top: 8px; }
.block-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.block-card__bar { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.block-card__type { font-size: 12px; font-weight: 700; color: var(--grey); }
.block-card .field { margin-bottom: 0; }
.block-card .photos__list { margin-bottom: 0; }
.spec-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.spec-row__tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spec-row__tools .btn { white-space: nowrap; }
.spec-row input,
.spec-row textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.spec-row textarea { resize: vertical; }
.top:has(.mode-nav) {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-bottom: 0;
}
.top__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; }
#collection-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
#collection-wrap span { color: var(--grey); }
#collection {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login__card {
  width: min(420px, 100%);
  padding: 32px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(25, 46, 110, .08);
}
.login__kicker { margin: 0 0 8px; font-size: 12px; color: var(--grey); letter-spacing: .08em; }
.login__card h1 { margin: 0 0 24px; font-size: 22px; }
.login__sub { margin: 0 0 12px; font-size: 15px; }
.login__notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff4e5;
  color: #7a4b00;
  font-size: 14px;
}
.login__back { margin: 16px 0 0; text-align: center; font-size: 14px; }
.saved { margin: 0 0 24px; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
.saved__row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.saved__row select { width: 100%; }
.saved__hint { margin: 8px 0 0; }
.saved__row select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--grey);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.login__back + .login__back { margin-top: 8px; }
.modal {
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(25, 46, 110, .18);
}
.modal::backdrop { background: rgba(25, 46, 110, .35); }
.modal__actions { display: flex; justify-content: flex-end; }
.accounts { list-style: none; margin: 0 0 24px; padding: 0; }
.accounts__item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.accounts__name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.accounts__name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accounts__name small { color: var(--grey); font-size: 12px; }
a.btn { text-decoration: none; color: inherit; }

.photos {
  position: relative;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.photos legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.photos__corner {
  position: absolute;
  top: 0;
  right: 12px;
  transform: translateY(-50%);
  background: var(--white);
}
.editor__title { margin: 0 0 16px; font-size: 20px; }
.photos__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.photos__item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
}
.photos__item img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef3ff;
}
.photos__item input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.photos__add { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.photos__hint { margin: 8px 0 0; font-size: 13px; color: var(--grey); }
.thumb-preview img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef3ff;
  display: block;
}
.photos > .field:last-child { margin-bottom: 0; }
.photos__hint a { color: var(--navy); font-weight: 700; }

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: calc(100vh - 84px);
}
.layout--settings { grid-template-columns: 1fr; }
.layout--settings .list-pane { display: none; }

.list-pane {
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.search { display: block; padding: 12px; }
.search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0 0 24px;
  overflow: auto;
  flex: 1;
}
.list__item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.list__item time { font-size: 12px; color: var(--grey); }
.list__item.is-current { background: #eef3ff; box-shadow: inset 3px 0 0 var(--navy); }
.list__item.is-private { color: var(--grey); }
.list__item.is-pending,
.list__item.is-pending time { color: var(--danger); }
.list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.list__row .list__item { border-bottom: 0; }
.list__move {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.list__move button {
  flex: 1;
  min-width: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.list__move button + button { border-top: 1px solid var(--border); }
.list-pane--sorting .search { opacity: .28; pointer-events: none; }
.list--sorting > li:not(.is-sort-target) {
  opacity: .28;
  pointer-events: none;
  filter: grayscale(.35);
}
.list__row.is-sorting {
  grid-template-columns: 28px minmax(0, 1fr);
}
.list__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  color: var(--grey);
  cursor: grab;
  background: #f4f6f9;
  border-right: 1px solid var(--border);
}
.list__handle::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 5px 0 currentColor,
    0 10px 0 currentColor,
    6px 0 0 currentColor,
    6px 5px 0 currentColor,
    6px 10px 0 currentColor;
  transform: translate(-3px, -5px);
}
.list__row.is-sorting .list__item { cursor: grab; padding-left: 10px; }
.list__row.is-dragging { opacity: .4; }
.list__row.is-dragging .list__handle { cursor: grabbing; }
.list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.list__badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eceff4;
  color: var(--grey);
}

.editor, .empty, .news-none { padding: 28px 32px 48px; }
.empty, .news-none { color: var(--grey); }
.news-none { margin: 0; }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field--grow { flex: 1; min-width: 180px; }
.field span { font-size: 13px; font-weight: 700; }
.field small { font-weight: 400; color: var(--grey); }
.field small a { color: var(--navy); font-weight: 700; }
.field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.field__head-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}
.field textarea { resize: vertical; }
.field textarea.textarea-fit {
  overflow: hidden;
  resize: none;
  field-sizing: content;
  min-height: 5.6em;
}
.field textarea[readonly],
.field input[readonly] {
  background: #eef3ff;
  color: var(--navy);
  cursor: default;
}
.field textarea[readonly] { resize: none; }
.button-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: start;
}
.button-pane + .button-pane { margin-top: 16px; }
.button-pane__list { display: grid; gap: 8px; min-width: 0; }
.button-pane > .btn { white-space: nowrap; }
.action-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
}
.action-toggle input { width: 18px; height: 18px; accent-color: var(--navy); }

.more { margin: 0 0 16px; }
.more summary { cursor: pointer; font-size: 13px; color: var(--grey); }
.more .field { margin: 12px 0 0; }

.actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 20px;
}
.actions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.actions__main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions__row.body-block-actions {
  justify-content: flex-start;
  margin: 0 0 16px;
}

.live-url {
  max-width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  word-break: break-all;
  text-underline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
#btn-delete { margin-left: auto; }
.btn--ghost { background: transparent; }
.btn--quiet {
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--grey);
  font-size: 14px;
}
.btn--gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn.photos__corner { background: var(--white); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.is-busy { cursor: wait; }

.status { min-height: 1.5em; margin: 0 0 16px; text-align: right; }
.status--ok { color: #0f7b3a; }
.status--err { color: var(--danger); }

#btn-list { display: none; color: var(--navy); }
#app.is-editing #collection-wrap,
#app.is-editing #btn-new { display: none !important; }
#app.is-editing:not(.is-guide) .mode-nav { display: none !important; }
#app.is-editing:not(.is-guide) #btn-list { display: inline-flex; }

.line-preview { display: none; }
.line-editor {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100dvh;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.line-editor__bar { display: flex; }
.line-editor__field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 6px;
}
.line-editor__field span { font-size: 13px; font-weight: 700; }
.line-editor__field textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  resize: none;
}
.line-editor__hint { margin: 0; color: var(--grey); font-size: 13px; }
.line-preview {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  white-space: pre-wrap;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-preview.is-empty { color: var(--grey); }
.line-preview.is-locked { background: #eef3ff; }

.guide { max-width: 760px; line-height: 1.8; }
.guide h2 { margin: 0 0 16px; font-size: 22px; }
.guide h3 { margin: 32px 0 12px; padding-bottom: 6px; font-size: 18px; border-bottom: 2px solid var(--navy); }
.guide h4 { margin: 24px 0 8px; font-size: 15px; }
.guide hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }
.guide ul, .guide ol { padding-left: 1.4em; }
.guide table { width: 100%; margin: 8px 0 16px; border-collapse: collapse; font-size: 14px; }
.guide th, .guide td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.guide th { background: #f3f5f8; }
.guide code { padding: 1px 4px; border-radius: 4px; background: #f3f5f8; font-size: .92em; }
.guide pre { margin: 0 0 16px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: #f7f8fa; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.guide pre code { padding: 0; background: none; }
.guide__copy { display: block; margin: 0 0 6px auto; }
.guide-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 12px 0 20px; }
.guide-shot { display: grid; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; line-height: 1.5; color: inherit; text-align: left; cursor: zoom-in; }
.guide-shot img { width: 100%; aspect-ratio: 1200 / 1435; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 6px; background: var(--white); transition: box-shadow .15s, transform .15s; }
.guide-shot:hover img, .guide-shot:focus-visible img { box-shadow: 0 4px 14px rgba(0, 0, 0, .15); transform: translateY(-2px); }
.guide-figure { display: block; width: 100%; margin: 8px 0 4px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.guide-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
.shot-viewer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px 64px; background: rgba(10, 20, 40, .82); cursor: zoom-out; }
.shot-viewer__figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-height: 100%; }
.shot-viewer__figure img { max-width: min(100%, 1000px); max-height: calc(100vh - 100px); object-fit: contain; border-radius: 6px; background: #fff; }
.shot-viewer__figure figcaption { color: #fff; font-size: 14px; }
.shot-viewer__nav, .shot-viewer__close { position: absolute; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 30px; line-height: 1; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.shot-viewer__nav:hover, .shot-viewer__close:hover { background: rgba(255, 255, 255, .3); }
.shot-viewer__nav--prev { left: 12px; top: 50%; transform: translateY(-50%); }
.shot-viewer__nav--next { right: 12px; top: 50%; transform: translateY(-50%); }
.shot-viewer__close { top: 12px; right: 12px; font-size: 26px; }
@media (max-width: 800px) {
  .shot-viewer { padding: 56px 8px; }
  .guide-shots { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .top { padding: 12px 16px 0; }
  .top h1 { font-size: 18px; }
  .top__actions { width: 100%; }
  .account-menu__btn { display: inline-flex; }
  .account-menu__panel { display: none; }
  .top__account.is-open .account-menu__panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    min-width: 12rem;
    padding: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(25, 46, 110, .12);
  }
  .top__account.is-open .account-menu__item {
    justify-content: flex-start;
    width: 100%;
    color: var(--navy);
    font-size: 16px;
  }
  .layout {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 7rem);
  }
  .list-pane { max-height: none; border-right: 0; }
  #app.is-editing .list-pane { display: none; }
  #app:not(.is-editing) .editor,
  #app:not(.is-editing) .empty { display: none !important; }
  .editor, .empty, .news-none { padding: 16px 16px 40px; }
  .line-preview { display: -webkit-box; }
  textarea.line-source { display: none; }
  .photos__item { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr; }
  .button-pane { grid-template-columns: 1fr; }
  .content-band {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .status { text-align: left; }
}

.site-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
}
.site-select select {
  min-width: 16rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
}
.guide { max-width: 46rem; }
.guide h2 { margin: 1.4em 0 .4em; font-size: 1.15rem; }
.guide h3 { margin: 1.2em 0 .4em; font-size: 1rem; }
.guide img { max-width: 100%; height: auto; border: 1px solid var(--border); }
.guide pre {
  overflow: auto;
  padding: 12px 14px;
  background: #eef2f7;
  border-radius: 8px;
  font-size: 13px;
}
.guide code { font-family: ui-monospace, monospace; font-size: .92em; }
.note {
  margin: 0 0 12px;
  color: var(--grey);
  font-size: 13px;
}
