:root {
  --bg: #f9f6eb;          /* 薄い黄色の地 */
  --surface: #ffffff;
  --text: #221c0f;        /* 白背景上:ほぼ黒 */
  --text-on-bg: #57431a;  /* 黄色背景上:濃い茶 */
  --muted: #8f7c46;
  --line: #ebdfb4;
  --accent: #f2c024;      /* listaイエロー */
  --accent-text: #3a2d05;
  --danger: #b4453a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-on-bg);
  line-height: 1.6;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  position: static;
  top: 0;
  z-index: 10000;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: #a97e08;
  text-decoration: none;
  letter-spacing: 0.04em;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

h1 { font-size: 24px; margin: 8px 0; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-head h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.description { color: var(--muted); margin-top: 0; }

.button {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.list-index {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

.thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 8px;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-empty { font-size: 24px; }

.list-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-name { font-weight: 600; }

.list-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.list-row .list-link { flex: 1; min-width: 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 99px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: 2px;
}

/* マイページのカード:タイトル横のバッジだけ別リンクにするため、行リンクは全面に重ねる */
.my-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.row-link {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

/* 行リンクより手前に出してバッジをクリック可能に */
.badge-link {
  position: relative;
  text-decoration: none;
}

.badge-muted {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* マイページの並び替え(昇順/降順の切替は右端に寄せる) */
.sort-bar .chip-dir {
  margin-left: auto;
}

/* 検索・カテゴリチップ */
.search-form {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.search-form input {
  font: inherit;
  font-size: 16px;
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.search-form .button {
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 14px;
}

.pager-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.pager-off {
  color: var(--line);
  padding: 8px 16px;
}

.pager-pos {
  color: var(--muted);
  font-size: 13px;
}

/* 公開ページ */
.public-thumb {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 8px;
}

.public-group {
  font-size: 14px;
  color: var(--muted);
  margin: 20px 0 6px;
  letter-spacing: 0.05em;
}

ul.public-items {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

ul.public-items li {
  padding: 12px 16px;
}

ul.public-items li + li {
  border-top: 1px solid var(--line);
}

.public-memo {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

.public-footer {
  margin-top: 28px;
  text-align: center;
}

.public-footer .button {
  font: inherit;
  cursor: pointer;
  padding: 12px 24px;
  font-size: 15px;
}

.empty { color: var(--muted); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 12px;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.hero {
  padding: 40px 0 24px;
}

.hero h1 {
  font-size: 28px;
  line-height: 1.4;
}

.hero p {
  color: var(--muted);
  margin-bottom: 24px;
}

main.narrow {
  max-width: 400px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.login-form input {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.login-form .button {
  text-align: center;
  font-size: 15px;
  padding: 10px 20px;
  cursor: pointer;
}

.divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.admin-form {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
