:root {
  --bg: #fffafc;
  --panel: rgba(255,255,255,.95);
  --ink: #51424d;
  --muted: #8b7a84;
  --heading: #74596b;
  --line: #ead8e1;
  --line-strong: #dec6d2;
  --pink: #d8a0b8;
  --pink-deep: #b97894;
  --lavender: #c5b4e4;
  --cream: #fff8ed;
  --green: #eaf8ed;
  --blue: #eef5ff;
  --danger: #fff1f4;
  --shadow: 0 18px 42px rgba(122, 83, 107, .12);
  --shadow-soft: 0 8px 22px rgba(122, 83, 107, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,236,246,.9), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(242,237,255,.9), transparent 30%),
    linear-gradient(180deg, #fffdfc, #fff8fb 58%, #faf7ff);
  color: var(--ink);
  font-family: Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.75;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(135deg, #4e4359, #77649b);
  color: #fff;
  box-shadow: var(--shadow);
}

.brand-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 16px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  color: #f8dbe7;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.app-header h1 {
  margin: 10px 0 4px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.18;
}

.app-header p { margin: 0; color: rgba(255,255,255,.82); font-weight: 700; }

.header-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-nav a {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.header-nav a.active {
  background: #fff;
  color: var(--heading);
}

.panel {
  margin: 0 0 18px;
  padding: 24px;
  border: 1px solid rgba(234,216,225,.92);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,251,253,.96));
  box-shadow: var(--shadow-soft);
}

.hero-panel { padding: 28px; }
.section-kicker {
  color: var(--pink-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h2 {
  margin: 4px 0 8px;
  color: var(--heading);
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.35;
}

h3 { margin: 0 0 8px; color: var(--heading); }
p { color: var(--muted); font-weight: 700; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

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

.dashboard-card {
  display: block;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: var(--pink);
  box-shadow: var(--shadow);
}

.dashboard-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: #fff;
  font-weight: 900;
}

.dashboard-card strong {
  display: block;
  margin: 14px 0 4px;
  color: var(--heading);
  font-size: 18px;
}

.dashboard-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.utility-details,
.guide-details {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
}

.utility-details + .utility-details,
.guide-details + .sc-form { margin-top: 16px; }

.utility-details summary,
.guide-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 14px 18px;
  list-style: none;
  color: var(--heading);
  font-weight: 900;
}

.utility-details summary::-webkit-details-marker,
.guide-details summary::-webkit-details-marker { display: none; }

.utility-details small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.utility-details b,
.guide-details b {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: #f2e6ee;
  color: var(--pink-deep);
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}

.utility-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.form-panel { max-width: 1120px; margin-inline: auto; }

.sc-form { margin-top: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--heading);
  font-weight: 900;
}

label span b {
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: #fff;
  font-size: 11px;
}

.wide { grid-column: 1 / -1; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fffbfd);
  color: var(--ink);
  outline: none;
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(216,160,184,.16);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.main-btn,
.sub-btn,
.chip-btn {
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--heading);
  font-weight: 900;
  text-decoration: none;
}

.main-btn {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  color: #fff;
  box-shadow: 0 10px 24px rgba(122,83,107,.16);
}

.chip-btn.danger {
  background: #fff3f5;
  color: #a0445a;
}

.message {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff8fb;
  color: var(--heading);
  font-weight: 900;
}

.message.success { border-color: #bfe5c7; background: var(--green); color: #35754b; }
.message.error { border-color: #efc1cc; background: var(--danger); color: #a0445a; }

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-auth {
  display: grid;
  min-width: min(360px, 100%);
  gap: 8px;
}

.admin-auth label span { margin-bottom: 4px; }

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.check-line input {
  width: auto;
  min-height: 0;
}

.summary-row,
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.summary-chip,
.tab-btn {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--heading);
  font-weight: 900;
}

.summary-chip strong,
.tab-btn strong { font-size: 18px; }

.tab-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, #7d5f8d, #9d7bae);
  color: #fff;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-card-media {
  height: 180px;
  background: linear-gradient(135deg, #fff5fa, #f2edff);
}

.admin-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8fb;
  color: #8a5f78;
  font-size: 11px;
  font-weight: 900;
}

.badge.primary { border-color: transparent; background: linear-gradient(135deg, var(--pink), var(--lavender)); color: #fff; }
.badge.green { background: var(--green); color: #3f7b4f; }
.badge.blue { background: var(--blue); color: #42678f; }

.admin-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.35;
}

.admin-meta {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.admin-meta div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-meta span { color: var(--muted); font-weight: 900; }
.admin-meta strong { min-width: 0; overflow-wrap: anywhere; }

.admin-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 14px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 48, 58, .52);
}
.dialog {
  position: relative;
  width: min(960px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(33,24,34,.25);
}
.dialog-close {
  float: right;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--heading);
  font-weight: 900;
}

.modal-open { overflow: hidden; }

.empty-box {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 900;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 18px;
  clear: both;
}

.detail-main-image {
  overflow: hidden;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, #fff5fa, #f2edff);
}

.detail-main-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-thumbs img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.detail-rows {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.detail-rows div {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffbfd;
}

.detail-rows span {
  color: var(--muted);
  font-weight: 900;
}

.detail-rows strong {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .app-header { grid-template-columns: 1fr; }
  .header-nav { justify-content: flex-start; }
  .dashboard-grid, .utility-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 14px, 1480px); padding-top: 8px; }
  .app-header { padding: 20px 16px; border-radius: 0 0 22px 22px; }
  .header-nav a { flex: 1 1 44%; text-align: center; font-size: 12px; }
  .panel { padding: 16px; border-radius: 20px; }
  .dashboard-grid, .utility-grid, .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .admin-head { display: block; }
  .admin-auth { margin-top: 12px; }
  .admin-card-grid { grid-template-columns: 1fr; }
  .admin-card { min-height: 0; }
  .detail-layout { grid-template-columns: 1fr; }
}
