:root {
  --bg: #f7fbf4;
  --panel: #ffffff;
  --ink: #2d312f;
  --muted: #657168;
  --line: #dbe7d7;
  --field: #fbfdf9;
  --accent: #f05a1a;
  --accent-dark: #c9450f;
  --green: #198343;
  --green-dark: #0d6534;
  --lake: #168fb2;
  --leaf: #8bb84a;
  --sun: #ffc94a;
  --warn: #d96b14;
  --danger: #b42318;
  --success: #19753b;
  --shadow: 0 18px 44px rgba(32, 58, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(22, 143, 178, 0.11), transparent 220px),
    linear-gradient(90deg, rgba(25, 131, 67, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(240, 90, 26, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.7;
}

a {
  color: var(--green-dark);
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 14px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 2.2rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.public-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--sun), var(--green), var(--lake)) 1;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-strip strong {
  color: var(--accent);
  font-size: 1.04rem;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9);
}

.entry-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.entry-panel.compact {
  display: block;
  max-width: 760px;
  margin: 48px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.entry-copy {
  background: #111111;
  color: #ffffff;
  border-radius: 8px;
  padding: 30px 34px;
  box-shadow: var(--shadow);
}

.entry-copy h1 {
  color: var(--accent);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: clamp(2rem, 4.8vw, 4.1rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.22);
}

.entry-copy h1 [data-event-name] {
  display: inline;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.entry-copy .kicker {
  color: #ffd674;
}

.entry-copy p:not(.kicker) {
  max-width: 720px;
  margin-bottom: 0;
  font-weight: 800;
}

.entry-form,
.filter-bar,
.detail-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid rgba(240, 90, 26, 0.72);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

label,
.field {
  display: grid;
  gap: 7px;
}

label span,
.field-label,
legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

label:has(:required) > span:first-child::after {
  content: " *";
  color: var(--accent);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd2c8;
  border-radius: 6px;
  background: var(--field);
  padding: 10px 12px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(240, 90, 26, 0.18);
}

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

.file-field small {
  color: var(--muted);
}

.notice-block,
.submit-guard {
  margin-top: 22px;
  border-left: 4px solid var(--green);
  background: #f3faee;
  padding: 18px 18px 18px 20px;
}

.notice-block ul,
.submit-guard ul {
  margin: 0;
  padding-left: 1.2em;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
}

.check-row input,
.check-grid input {
  width: 20px;
  min-width: 20px;
  min-height: 20px;
  margin-top: 3px;
}

.turnstile-wrap {
  margin-top: 22px;
}

.upload-status {
  min-height: 28px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.upload-status[data-tone="error"] {
  color: var(--danger);
}

.upload-status[data-tone="success"] {
  color: var(--success);
}

.upload-progress {
  width: 100%;
  height: 12px;
  accent-color: var(--green);
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(180deg, #ff7130, var(--accent));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(240, 90, 26, 0.28);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  border-color: rgba(25, 131, 67, 0.24);
  background: #ffffff;
  color: var(--green-dark);
}

.danger-button {
  background: var(--danger);
  color: #ffffff;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.entry-form > .primary-button {
  width: 100%;
  margin-top: 18px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  border-bottom: 3px solid rgba(240, 90, 26, 0.26);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.admin-brand {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.92rem;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-heading h1 {
  font-size: 1.9rem;
}

.admin-actions,
.button-row,
.cleanup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-bar,
.detail-panel,
.login-panel {
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(21, 28, 22, 0.08);
}

.login-panel {
  max-width: 420px;
  margin: 60px auto 0;
}

.login-panel form,
.note-form,
.revision-form {
  display: grid;
  gap: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  font-size: 0.93rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #edf7ec;
  color: var(--green-dark);
  font-size: 0.82rem;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pending { background: #fff3d1; color: #835000; }
.status-revision_requested { background: #fff0e8; color: #9c4210; }
.status-approved { background: #e5f7e9; color: var(--green-dark); }
.status-incomplete { background: #f1f1f1; color: #555555; }
.status-closed { background: #f9e6e5; color: #9e2319; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.definition-list {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.definition-list dt {
  color: var(--muted);
  font-weight: 900;
}

.definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.photo-preview {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f7;
  margin: 12px 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.copy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.print-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.print-card {
  break-inside: avoid;
  page-break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.print-card .entry-no {
  margin: 0 0 10px;
  font-weight: 900;
}

.print-card dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.print-card dt {
  color: var(--muted);
  font-weight: 900;
}

.print-card dd {
  margin: 0;
}

@media (max-width: 860px) {
  .entry-panel,
  .detail-grid,
  .print-list {
    grid-template-columns: 1fr;
  }

  .entry-copy {
    position: static;
  }

  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .definition-list,
  .print-card dl {
    grid-template-columns: 1fr;
  }

  .copy-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .public-shell,
  .admin-shell {
    width: min(100% - 20px, 1180px);
  }

  .entry-form,
  .entry-copy,
  .entry-panel.compact,
  .detail-panel,
  .filter-bar,
  .login-panel {
    padding: 18px;
  }

  h1 {
    font-size: 1.72rem;
  }

  .entry-copy h1 {
    font-size: 2.1rem;
  }

  .brand-strip,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-topbar {
    padding: 14px 16px;
  }
}
