/* よろぷれす 管理画面。公開サイトと同じ白・黒・グレー。 */
:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #4a4a4a;
  --ink-3: #6f6f6f;
  --line: #e4e4e4;
  --wash: #f6f6f6;
  --warn: #b3261e;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic Medium', 'Yu Gothic',
    Meiryo, sans-serif;
  --latin: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---- 枠 ---- */
.shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
}
.nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.25rem 0.75rem;
  border-right: 1px solid var(--line);
}
.brand {
  padding: 0 0.5rem 1.25rem;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
}
.nav a {
  display: block;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-2);
}
.nav a:hover {
  background: var(--wash);
  color: var(--ink);
}
.nav a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.nav .foot {
  margin-top: auto;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}
.nav .foot button {
  margin-top: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: underline;
  cursor: pointer;
}
.main {
  min-width: 0;
  padding: 1.5rem 2rem 4rem;
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    height: auto;
    padding: 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    width: 100%;
    padding: 0 0.25rem 0.5rem;
  }
  .brand small {
    display: none;
  }
  .nav .foot {
    width: 100%;
    margin-top: 0.5rem;
  }
  .main {
    padding: 1rem 1rem 4rem;
  }
}

/* ---- 見出しと操作 ---- */
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.head h1 {
  font-size: 18px;
  font-weight: 700;
}
.head .spacer {
  flex: 1;
}
.back {
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.btn:hover {
  background: var(--paper);
  color: var(--ink);
}
.btn.outline {
  background: var(--paper);
  color: var(--ink);
}
.btn.outline:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn.quiet {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 400;
}
.btn.quiet:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn.danger {
  border-color: var(--line);
  background: var(--paper);
  color: var(--warn);
  font-weight: 400;
}
.btn.danger:hover {
  border-color: var(--warn);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.small {
  min-height: 30px;
  padding: 0 0.6rem;
  font-size: 12px;
}

/* ---- 一覧 ---- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table th {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  white-space: nowrap;
}
.table tbody tr {
  cursor: pointer;
}
.table tbody tr:hover {
  background: var(--wash);
}
.table .title {
  font-weight: 600;
}
.table .sub {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--wash);
}
.badge {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  line-height: 1;
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.live {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.badge.soon {
  border-color: var(--ink);
  color: var(--ink);
}
.empty {
  padding: 4rem 0;
  text-align: center;
  color: var(--ink-2);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.filters input,
.filters select {
  height: 36px;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.filters input {
  flex: 1 1 200px;
  max-width: 320px;
}

/* ---- 入力 ---- */
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
}
.editor.single {
  grid-template-columns: minmax(0, 640px);
}
@media (max-width: 1000px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }
}
.panel {
  display: grid;
  gap: 1.1rem;
}
.side-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field label,
.field .label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.field .hint {
  margin-top: 0.3rem;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}
.field input[type='text'],
.field input[type='url'],
.field input[type='number'],
.field input[type='date'],
.field input[type='datetime-local'],
.field input[type='password'],
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.field textarea {
  line-height: 1.7;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ink);
  outline: none;
}
.field .big {
  font-size: 18px;
  font-weight: 700;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 13px;
  cursor: pointer;
}
.check input {
  margin-top: 3px;
}
.choices {
  display: grid;
  gap: 0.3rem;
  max-height: 180px;
  padding: 0.5rem 0.6rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.choices.none {
  color: var(--ink-3);
  font-size: 12px;
}
.image-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.image-field img {
  width: 120px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--wash);
}
.repeat {
  display: grid;
  gap: 0.5rem;
}
.repeat-row {
  display: grid;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---- 本文 ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}
/* .field textarea の既定（38px）に負けないよう、同じ強さで書く */
.field textarea.body-input {
  min-height: 460px;
  font-size: 15px;
}
.preview-frame {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.status-line {
  font-size: 12px;
  color: var(--ink-3);
}

/* ---- ログイン ---- */
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.login form {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}
.login .brand {
  padding: 0 0 0.5rem;
  font-size: 24px;
}
.error {
  font-size: 12px;
  color: var(--warn);
}

#toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  z-index: 100;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transform: translateX(-50%);
}
#toast.bad {
  background: var(--warn);
}

/* お問い合わせ・確認用リンク */
.nav a[aria-current='page'] .count {
  background: #fff;
  color: #0b0b0b;
}
.nav a .count {
  display: inline-block;
  min-width: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 9px;
  background: #0b0b0b;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.nav a .count[hidden] {
  display: none;
}
.field .value {
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.field .message {
  white-space: pre-wrap;
}
.share input {
  font-size: 12px;
}
.share-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 変更履歴・削除済み・使い方 */
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.history-list .when {
  min-width: 0;
}
.history-list small {
  display: block;
  overflow: hidden;
  font-size: 11px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-list li + li {
  border-top: 1px solid var(--line);
}
.table.plain tbody tr {
  cursor: default;
}
.nav .foot .guide-link {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
