:root {
  --green: #4b8f65;
  --accent: #2f4a6d;      /* ワンポイントの紺。上のライン・今いるメニュー・視聴の進み具合・見終わった印に使う */
  --accent-dark: #22374f; /* 紺の濃いめ。印の背景や文字に使う */
  --text: #222;
  --muted: #666;
  --line: #e2e2e2;
  --bg: #fafaf8;
}

* { box-sizing: border-box; }

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

.site-header {
  background: #fff;
  border-top: 4px solid var(--accent); /* 紺をワンポイントに */
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-weight: bold;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
}

.brand span {
  font-size: 0.8rem;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { font-size: 1.4rem; margin-top: 0; }

a { color: var(--green); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.header-user small { color: var(--muted); }
.header-user form { margin: 0; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

.card.narrow {
  max-width: 440px;
  margin: 24px auto;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.form input,
.form select {
  font: inherit;
  font-size: 16px; /* スマホで勝手に拡大されないように */
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.field-static {
  margin: 0;
  display: grid;
  gap: 2px;
}

.field-static span {
  font-size: 0.85rem;
  color: var(--muted);
}

.button {
  font: inherit;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
}

.button:hover { opacity: 0.9; }

.link-button {
  font: inherit;
  background: none;
  border: none;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.alert-error { background: #fdecec; color: #a12a2a; }
.alert-info { background: #eaf4ee; color: #2f6a47; }

h2 { font-size: 1.15rem; margin-top: 32px; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
td.wrap { white-space: normal; min-width: 200px; }
.danger { color: #b33; }

.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.site-nav a {
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}

/* 今いるページのメニューに、紺の下線 */
.site-nav a.active {
  color: var(--green);
  font-weight: bold;
  border-bottom-color: var(--accent);
}

.site-nav a:hover { color: var(--green); }

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

.page-head h1 { margin: 0; }

a.button { display: inline-block; text-decoration: none; }

.button-sub {
  background: #fff;
  color: var(--green);
  border: 1px solid var(--green);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: grid;
}

.stat span { color: var(--muted); font-size: 0.9rem; }
.stat strong { font-size: 1.4rem; }

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th { background: #f4f6f4; font-weight: normal; color: var(--muted); }
tr:last-child td { border-bottom: none; }

td form { margin: 0; }

.row-actions { display: flex; gap: 12px; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff4e0;
  color: #9a6200;
}

.info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}

.info dt { color: var(--muted); }
.info dd { margin: 0; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  display: grid;
  gap: 12px;
}

legend { padding: 0 6px; color: var(--muted); }

.form .check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form .check input { width: auto; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

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

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}

details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
}

summary { cursor: pointer; color: var(--green); }

@media (max-width: 600px) {
  .info { grid-template-columns: 1fr; gap: 2px; }
  .info dd { margin-bottom: 8px; }
}

.form textarea {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  resize: vertical;
}

.tag-new { background: #e6ecf3; color: #22374f; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.post-list li + li { border-top: 1px solid var(--line); }

.post-list a {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
}

.post-list a:hover .post-title { color: var(--green); }

.top-posts .page-head { margin-bottom: 8px; }
.top-posts h2 { margin: 0; }

.post h1 { margin-bottom: 4px; }
.post-body { margin: 16px 0; overflow-wrap: anywhere; }

.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.post-images img,
.image-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.image-pick { align-items: flex-start; }

.post-actions { margin-top: 16px; }

.company-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.comment {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.comment p { margin: 0 0 4px; }
form.inline { display: inline; margin-left: 8px; }

#comments .form { margin-top: 12px; }

/* ---- 動画 ---- */

.videos { margin-top: 32px; }
.recent { margin-top: 32px; }
.recent h2 { margin: 0 0 12px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
}

.tabs a {
  padding: 10px 16px;
  color: var(--muted);
  text-decoration: none;
  font-weight: bold;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tabs a.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.chips a {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.chips a.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.video-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.video-card:hover { border-color: var(--green); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e7f1ea, #f6efe4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-code {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--green);
  opacity: 0.7;
}

.badge-done {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* 進み具合：表紙の下に、独立した線として出す（表紙のデザインとまざらないように） */
.progress {
  height: 5px;
  background: #e4e4e4;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.video-meta {
  padding: 10px 14px 14px;
  display: grid;
  gap: 2px;
}

.video-meta strong { font-size: 0.98rem; line-height: 1.5; }

.code {
  color: var(--green);
  margin-right: 6px;
  font-weight: bold;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
}

.video-detail { margin-top: 16px; }
.video-detail h1 { margin: 4px 0; }
.done-text { color: var(--accent-dark); font-weight: bold; }

.copy-box {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
}

.upload-progress .bar {
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress .bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.3s;
}

/* ---- 2段階認証 ---- */
.steps { padding-left: 1.2em; display: grid; gap: 10px; }
.qr { width: 200px; max-width: 100%; margin: 10px 0; }
.qr svg { width: 100%; height: auto; display: block; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.05em; word-break: break-all; }
.sub-details { margin-top: 12px; background: none; border: none; padding: 0; }
.recovery-codes {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.05rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  background: #f4f6f4;
  border-radius: 8px;
  padding: 12px 16px 12px 32px;
}

.card.mail { margin-bottom: 12px; }
.card.mail pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  margin: 0;
}

.sub-link {
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
}
