:root {
  --em-900:#022C22;--em-800:#064E3B;--em-700:#065F46;--em-600:#047857;--em-500:#059669;--em-400:#10B981;--em-300:#6EE7B7;--em-200:#A7F3D0;--em-100:#D1FAE5;--em-50:#ECFDF5;
  --ink:#0A0A0A;--ink-80:rgba(10,10,10,0.96);--ink-60:rgba(10,10,10,0.85);--ink-50:rgba(10,10,10,0.70);--ink-30:rgba(10,10,10,0.48);--ink-12:rgba(10,10,10,0.15);--ink-08:rgba(10,10,10,0.10);--ink-04:rgba(10,10,10,0.05);
  --paper:#F3F1EC;--paper-2:#EBE8E2;--paper-card:#F8F6F2;--bad:#B91C1C;--warn:#92400E;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans', 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--em-700); font-weight: 700; }
button, input, textarea, select {
  font: inherit;
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(6,95,70,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,95,70,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -1;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--em-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 0 1px var(--em-900) inset, 0 2px 8px rgba(6,95,70,0.2);
  flex: 0 0 auto;
}
.brand-logo-icon::before {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--em-300);
}
.brand-logo-icon::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--em-400);
  opacity: 0.4;
}
.brand-text {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-wrap {
  width: 100%;
  max-width: 400px;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo .brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}
.login-logo .brand-text {
  font-size: 28px;
}
.card {
  background: var(--paper-card);
  border: 0.5px solid var(--ink-12);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(10,10,10,0.04);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
  text-align: center;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
.sidebar {
  background: var(--paper-card);
  border-right: 0.5px solid var(--ink-12);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}
.nav button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink-60);
  cursor: pointer;
  font-weight: 700;
}
.nav button.active,
.nav button:hover {
  color: var(--ink);
  background: var(--em-100);
}
.main {
  padding: 28px;
  width: 100%;
  max-width: 1180px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.muted { color: var(--ink-50); }
.page { display: none; }
.page.active { display: block; }
.section {
  background: rgba(248,246,242,0.72);
  border: 0.5px solid var(--ink-12);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.full { grid-column: 1 / -1; }
label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-50);
  margin-bottom: 5px;
}
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 0.5px solid var(--ink-12);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--em-500);
  box-shadow: 0 0 0 2px rgba(5,150,105,0.12);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 7px;
  border: 0.5px solid var(--ink-12);
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}
.btn-primary { background: var(--em-700); color: white; border-color: var(--em-700); }
.btn-danger { background: var(--bad); color: white; border-color: var(--bad); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notice {
  display: none;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 700;
}
.notice.show { display: block; }
.notice.error { background: #FEF2F2; color: var(--bad); border: 0.5px solid #FECACA; }
.notice.ok { background: var(--em-50); color: var(--em-800); border: 0.5px solid var(--em-200); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 0.5px solid var(--ink-12);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--ink-08);
  vertical-align: top;
}
th {
  font-size: 11px;
  color: var(--ink-50);
  background: var(--paper-2);
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--em-100);
  color: var(--em-800);
  font-size: 11px;
  font-weight: 700;
}
.tooltip-link {
  position: relative;
  display: inline-flex;
}
.tooltip-link:hover::after {
  content: attr(data-url);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: max-content;
  max-width: 360px;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  font-size: 11px;
  z-index: 5;
}
.report-box {
  background: white;
  border: 0.5px solid var(--ink-12);
  border-radius: 8px;
  padding: 18px;
}
.topbar h1 { margin: 0; font-size: 22px; font-family: 'Syne', 'Zen Kaku Gothic New', sans-serif; letter-spacing: -0.01em; }
.side-foot { margin-top: 24px; font-size: 11px; line-height: 1.7; border-top: 0.5px solid var(--ink-08); padding-top: 16px; }
.side-foot strong { color: var(--em-700); }
.lead { font-size: 13px; color: var(--ink-60); background: var(--em-50); border: 0.5px solid var(--em-200); border-radius: 8px; padding: 12px 14px; margin: 0 0 18px; }
.lead strong { color: var(--em-800); }

/* フォームのセクション */
.form-section {
  background: var(--paper-card);
  border: 0.5px solid var(--ink-12);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: 0 1px 8px rgba(10,10,10,0.03);
}
.form-section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 0.5px solid var(--ink-08); }
.form-section-no {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 13px;
  color: var(--em-700); background: var(--em-100);
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.form-section-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.form-section-hint { font-size: 11.5px; color: var(--ink-50); margin-top: 2px; }
.req { font-size: 9.5px; font-weight: 700; color: var(--bad); background: #FEF2F2; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }

input::placeholder, textarea::placeholder { color: var(--ink-30); }

/* SNS行 */
.sns-row { display: grid; grid-template-columns: 180px minmax(0,1fr) auto; gap: 10px; margin-bottom: 10px; align-items: center; }
.sns-row .sns-del { min-height: 38px; width: 38px; padding: 0; border-radius: 7px; color: var(--ink-50); }
.sns-row .sns-del:hover { color: var(--bad); border-color: #FECACA; background: #FEF2F2; }
.btn-ghost { background: transparent; border-style: dashed; color: var(--em-700); border-color: var(--em-300); }
.btn-ghost:hover { background: var(--em-50); }

/* アップロード */
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.upload {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px dashed var(--ink-12); border-radius: 9px; padding: 12px 14px;
  background: white; cursor: pointer; transition: border-color .15s, background .15s;
}
.upload:hover { border-color: var(--em-400); background: var(--em-50); }
.upload.has-file { border-style: solid; border-color: var(--em-500); background: var(--em-50); }
.upload-kind { font-size: 11.5px; font-weight: 700; color: var(--ink-60); }
.upload input[type=file] { display: none; }
.upload-cta { font-size: 11px; color: var(--em-700); font-weight: 700; }
.upload.has-file .upload-cta { color: var(--em-800); }

/* 送信バー */
.submit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--paper) 60%, rgba(243,241,236,0));
  padding: 16px 2px 6px; margin-top: 4px;
}
.btn-lg { min-height: 46px; padding: 12px 28px; font-size: 14px; border-radius: 9px; box-shadow: 0 4px 14px rgba(6,95,70,0.25); }

/* 添付ビュー（管理） */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.attach-chip { font-size: 11px; }

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px; }
  .grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .sns-row { grid-template-columns: 1fr; }
  .sns-row .sns-del { width: 100%; }
}
