/* enishi 共通スタイル。フレームワーク無し・1ファイル。 */

:root {
  --ink: #1c222b;
  --sub: #5b6572;
  --line: #d9dee5;
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: #1f4e79;
  --accent-soft: #e8f0f8;
  --accent-strong: #163a5c;
  --danger: #b3372e;
  --danger-soft: #fbeceb;
  --ok: #21714a;
  --ok-soft: #e8f5ee;
  --warn-soft: #fdf3e0;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

h1 { font-size: 1.5rem; line-height: 1.4; }
h2 { font-size: 1.1rem; margin-top: 1.6em; }
h1, h2, h3 { font-weight: 700; }

.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- ヘッダー・フッター ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 0.75rem;
  margin-left: 6px;
  color: var(--sub);
  font-weight: 600;
}
.nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--ink); font-size: 0.95rem; position: relative; }
.nav-links a:hover { color: var(--accent); }
.nav-badge {
  display: inline-block;
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 4px;
  vertical-align: super;
}
/* hidden 属性より author CSS の display が勝つため、明示的に消す。 */
.nav-badge[hidden] { display: none; }

.site-footer {
  margin-top: 48px;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 0.85rem;
  text-align: center;
  background: var(--card);
}
.legal-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.legal-links a { color: var(--sub); }

/* ---- レイアウト ---- */
.public-main, .app-main {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 0 16px;
}
.public-main.narrow { max-width: 520px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.banner {
  max-width: 960px;
  margin: 16px auto 0;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--warn-soft);
  border: 1px solid #e5c98c;
  font-size: 0.92rem;
}

/* ---- LP ---- */
.hero { text-align: center; padding: 40px 8px 24px; }
.hero h1 { font-size: 1.9rem; }
.hero .lead { color: var(--sub); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.features .card { margin-bottom: 0; }
.features h2 { margin-top: 0; }
.features ul { padding-left: 1.2em; margin: 0; }
.features li { margin-bottom: 0.5em; }
.how { margin-top: 32px; }
.how ol { padding-left: 1.4em; }

/* ---- フォーム ---- */
label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="tel"], input[type="date"], input[type="month"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.checkbox, .radio { font-weight: 400; display: flex; gap: 8px; align-items: baseline; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 14px 0 0; }
legend { font-size: 0.88rem; font-weight: 600; padding: 0 6px; }
fieldset label { font-weight: 400; margin: 6px 0; }

.button {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--card);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  margin-top: 12px;
  margin-right: 8px;
}
.button:hover { background: var(--accent-soft); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-strong); }
.button-danger { border-color: var(--danger); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); }
.button-plain { border-color: transparent; color: var(--sub); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button-small { padding: 4px 12px; font-size: 0.85rem; margin-top: 6px; }

.note { color: var(--sub); font-size: 0.85rem; }
.error {
  background: var(--danger-soft);
  border: 1px solid #e3b1ac;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
}
.success {
  background: var(--ok-soft);
  border: 1px solid #a8d4bc;
  color: var(--ok);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.turnstile-box { margin-top: 16px; min-height: 66px; }

/* ---- タブ ---- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 8px; }
.tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* ---- プロフィール表示 ---- */
.profile-kind {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 10px;
  margin: 0 0 4px;
  font-weight: 600;
}
.headline { color: var(--sub); margin-top: -8px; }
.badge-open {
  display: inline-block;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 1px 10px;
  font-weight: 600;
}
dl.meta { display: grid; grid-template-columns: 7em 1fr; gap: 2px 12px; font-size: 0.95rem; }
dl.meta dt { color: var(--sub); font-weight: 600; }
dl.meta dd { margin: 0; }
.skill-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tags li {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.88rem;
}
.cta { background: var(--bg); border-radius: var(--radius); padding: 4px 16px 14px; margin-top: 20px; }

/* ---- 一覧 ---- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-top: 1px solid var(--line); padding: 12px 2px; }
.list li:first-child { border-top: none; }
.list .item-title { font-weight: 700; text-decoration: none; color: var(--ink); }
.list .item-title:hover { color: var(--accent); }
.list .item-sub { color: var(--sub); font-size: 0.88rem; }
.item-actions { margin-top: 4px; }

.status-chip {
  display: inline-block;
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 1px 10px;
  font-weight: 600;
  background: var(--bg);
  color: var(--sub);
}
.status-chip.granted { background: var(--ok-soft); color: var(--ok); }
.status-chip.pending { background: var(--warn-soft); color: #8a6116; }
.status-chip.denied, .status-chip.revoked, .status-chip.declined { background: var(--danger-soft); color: var(--danger); }

/* ---- メッセージ ---- */
.thread { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); }
.msg.theirs { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.msg .msg-time { display: block; font-size: 0.72rem; color: var(--sub); margin-top: 2px; }
.compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.compose textarea { min-height: 60px; flex: 1; }
.compose .button { margin-top: 0; }

/* ---- 履歴書 ---- */
.resume-entry { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 10px; }
.resume-entry .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.entry-remove { float: right; }
.resume-section-title { display: flex; justify-content: space-between; align-items: center; }

.access-log { font-size: 0.9rem; }

/* ---- テーブル（管理画面） ---- */
table.admin { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin th, table.admin td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
table.admin th { color: var(--sub); font-weight: 600; }

.loading { color: var(--sub); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.5rem; }
  dl.meta { grid-template-columns: 1fr; gap: 0; }
  dl.meta dt { margin-top: 6px; }
  .resume-entry .grid2 { grid-template-columns: 1fr; }
  .site-nav { justify-content: center; }
}
