:root {
  --ink: #20272b;
  --muted: #667178;
  --line: #d9dee2;
  --line-strong: #b7c0c7;
  --paper: #ffffff;
  --soft: #f4f6f7;
  --bg: #eef1f3;
  --cream: #f4f6f7;
  --brown: #2f6b9d;
  --brown-dark: #2f6b9d;
  --entry-lock-border: #d9dee2;
  --entry-lock-border-rgb: 217, 222, 226;
  --entry-lock-text: #667178;
  --step-active-text: #2f6b9d;
  --step-active-text-rgb: 47, 107, 157;
  --teal: #0f766e;
  --teal-soft: #e9f6f4;
  --blue: #2f6b9d;
  --blue-soft: #edf2f5;
  --red: #b84b44;
  --warn: #f4f6f7;
  --placeholder: #AEB7BD;
  --shadow: 0 18px 44px rgba(33, 39, 43, .12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "BIZ UDPGothic", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

a {
  color: inherit;
}

.site-frame {
  width: min(1220px, calc(100vw - 48px));
  margin: 28px auto;
  background: var(--paper);
  border: 1px solid #e2e6e9;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brown);
  font-weight: 700;
}

.brand h1,
.mobile-card h2,
.preview-panel h2 {
  margin: 0;
  line-height: 1.3;
}

.brand h1 {
  font-size: 21px;
}

.brand p,
.mobile-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tag {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #354047;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-teal {
  border-color: #badad6;
  background: var(--teal-soft);
  color: #0d625c;
}

.content {
  padding: 22px;
  background: #f7f8f8;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 12px;
  margin-bottom: 16px;
}

.field-panel {
  min-width: 0;
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-panel span,
.field-panel legend {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-panel b,
.completion-panel b {
  color: var(--red);
  font-weight: 700;
}

.field-panel input[type="text"],
.field-panel input[type="email"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cdd4d9;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice-row label {
  display: flex;
  align-items: center;
  min-height: 38px;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #cdd4d9;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.choice-row label:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #0e5f58;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.count {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #223039;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: #89949b;
}

.btn-primary {
  border-color: var(--brown-dark);
  background: var(--brown);
  color: #fff;
}

.btn-teal {
  border-color: #0d665f;
  background: var(--teal);
  color: #fff;
}

.btn-blue {
  border-color: #2d638e;
  background: var(--blue);
  color: #fff;
}

.btn-help {
  border-color: #9bb5c6;
  background: #f2f7fa;
  color: #2d5e7d;
}

.btn-delete {
  border-color: #9d3934;
  background: var(--red);
  color: #fff;
}

.btn-delete:hover {
  border-color: #842e2a;
  background: #a73e38;
}



.file-input,
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.desktop-sheet {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sheet-caption {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sheet-caption span {
  color: var(--muted);
  font-size: 12px;
}

.sheet-scroll {
  overflow: auto;
  max-height: 580px;
}

.sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  font-size: 14px;
}

.sheet-table th,
.sheet-table td {
  height: 42px;
  padding: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  vertical-align: middle;
}

.sheet-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 9px;
  background: var(--blue-soft);
  color: #374149;
  font-size: 12px;
  text-align: left;
  font-weight: 700;
}

.sheet-table th:first-child,
.sheet-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 52px;
  text-align: center;
  background: #f8fafb;
  color: var(--muted);
  font-weight: 700;
}

.sheet-table th:first-child {
  z-index: 4;
  background: #e5ebef;
}

.sheet-table input {
  width: 100%;
  min-height: 41px;
  padding: 8px 9px;
  border: 2px solid transparent;
  background: #fff;
  color: var(--ink);
}

.sheet-table input:focus,
.field-panel input:focus,
.mobile-fields input:focus {
  outline: none;
  border-color: var(--teal);
  background: #f4fbfa;
}

.field-panel input.input-has-error {
  border-color: var(--red);
  background: #fff8f7;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.field-error[hidden] {
  display: none;
}

.desktop-sheet th:nth-child(2),
.desktop-sheet td:nth-child(2) {
  width: 168px;
}

.desktop-sheet th:nth-child(3),
.desktop-sheet td:nth-child(3) {
  width: 98px;
}

.desktop-sheet th:nth-child(4),
.desktop-sheet td:nth-child(4) {
  width: 116px;
}

.desktop-sheet th:nth-child(5),
.desktop-sheet td:nth-child(5) {
  width: 286px;
}

.desktop-sheet th:nth-child(6),
.desktop-sheet td:nth-child(6),
.desktop-sheet th:nth-child(7),
.desktop-sheet td:nth-child(7) {
  width: 216px;
}

.desktop-sheet th:nth-child(8),
.desktop-sheet td:nth-child(8),
.desktop-sheet th:nth-child(9),
.desktop-sheet td:nth-child(9) {
  width: 126px;
}

.mobile-editor {
  display: none;
}

.mobile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mobile-current-entry {
  display: none;
}

.mobile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.mobile-card h2 {
  font-size: 18px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stepper button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.mobile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 12px;
}

.m-field {
  min-width: 0;
}

.m-field.wide {
  grid-column: 1 / -1;
}

.m-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #4b555b;
  font-size: 12px;
  font-weight: 700;
}

.m-field b {
  color: var(--red);
}

.mobile-fields input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #cdd4d9;
  border-radius: 6px;
  background: #fff;
}

.mobile-save {
  width: calc(100% - 24px);
  margin: 22px 12px 14px;
}

.preview-panel {
  margin-top: 12px;
}

.preview-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.preview-list {
  display: grid;
  gap: 8px;
}

.preview-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.preview-row.active {
  border-color: var(--teal);
  background: #f2fbfa;
}

.preview-no {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.preview-main {
  min-width: 0;
}

.preview-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-address {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.completion-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.completion-panel fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.completion-panel legend {
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.completion-panel label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.completion-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.completion-notice {
  padding: 10px 12px;
  border: 1px solid var(--entry-lock-border);
  border-radius: 6px;
  background: var(--warn);
  color: var(--entry-lock-text) !important;
  font-weight: 700;
}

.completion-notice[hidden] {
  display: none;
}


.thanks {
  max-width: 760px;
}

.thanks h1 {
  margin-top: 0;
}

.receipt {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.thanks-actions form {
  margin: 0;
}

.thanks-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-body {
  background: var(--bg);
}

.admin-wrap {
  width: min(1120px, calc(100vw - 56px));
  margin: 28px auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #283034;
  color: #fff;
  border-radius: 8px 8px 0 0;
}

.admin-header h1 {
  margin: 0;
  font-size: 20px;
}

.admin-header p {
  margin: 4px 0 0;
  color: #c9d1d6;
  font-size: 13px;
}

.admin-badge {
  padding: 7px 10px;
  border: 1px solid #5a646b;
  border-radius: 999px;
  color: #d6dde1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-main {
  padding: 18px;
  background: #f6f7f8;
  border: 1px solid #d6dcdf;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.admin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-message {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #b9d7d3;
  border-radius: 8px;
  background: #eef8f6;
  color: #0d625c;
  font-weight: 700;
}

.admin-settings-panel {
  margin-top: 14px;
  margin-bottom: 12px;
}

.admin-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.admin-settings-summary::-webkit-details-marker {
  display: none;
}

.admin-settings-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-settings-toggle::before {
  content: "開く";
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #3b464d;
  font-size: 12px;
  font-weight: 700;
}

.admin-settings-panel[open] .admin-settings-toggle::before {
  content: "閉じる";
}

.admin-settings-panel[open] .admin-settings-summary {
  border-bottom: 1px solid var(--line);
}

.admin-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.admin-setting-check,
.admin-setting-field {
  display: grid;
  gap: 6px;
  color: #3b464d;
  font-size: 13px;
  font-weight: 700;
}

.admin-setting-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
}

.admin-setting-check input {
  width: 18px;
  height: 18px;
}

.admin-setting-group {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-setting-group > strong {
  color: #3b464d;
  font-size: 13px;
}

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

.admin-setting-field input,
.admin-setting-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 16px;
}

.admin-setting-field textarea {
  min-height: 96px;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
}

.admin-setting-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.admin-color-field input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.admin-setting-field-wide {
  grid-column: 1 / -1;
}

.admin-setting-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-settings-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-delete-form .btn-delete {
  min-width: 58px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.admin-table-scroll {
  overflow: auto;
}

.admin-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.admin-table th {
  background: var(--blue-soft);
  color: #3b464d;
  font-size: 12px;
  font-weight: 700;
}

.admin-table th:nth-child(1) { width: 145px; }
.admin-table th:nth-child(2) { width: 190px; }
.admin-table th:nth-child(4) { width: 90px; }
.admin-table th:nth-child(5) { width: 115px; }
.admin-table th:nth-child(6) { width: 190px; }
.admin-table th:nth-child(7) { width: 105px; }

.admin-submission-table {
  min-width: 980px;
}

.admin-submission-table th:nth-child(2) { width: 180px; }
.admin-submission-table th:nth-child(3) { width: auto; }
.admin-submission-table th:nth-child(4) { width: 92px; }
.admin-submission-table th:nth-child(5) { width: 108px; }
.admin-submission-table th:nth-child(6) { width: 238px; }

.admin-download-table {
  min-width: 900px;
}

.admin-download-table th:nth-child(2) { width: 180px; }
.admin-download-table th:nth-child(3) { width: 72px; }
.admin-download-table th:nth-child(4) { width: 110px; }
.admin-download-table th:nth-child(5) { width: 100px; }
.admin-download-table th:nth-child(6) { width: 100px; }
.admin-download-table th:nth-child(7) { width: 96px; }

.admin-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-table td > strong {
  overflow-wrap: anywhere;
}

.admin-hidden-value {
  display: grid;
  gap: 6px;
  max-width: 100%;
}

.admin-hidden-value summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #354047;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.admin-hidden-value summary::-webkit-details-marker {
  display: none;
}

.admin-hidden-value[open] summary {
  margin-bottom: 2px;
}

.admin-hidden-value strong,
.admin-hidden-value code {
  display: block;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #3b464d;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-all;
}

.admin-hidden-value code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 7px;
  white-space: nowrap;
}

.admin-actions-cell {
  white-space: nowrap;
}

.admin-actions form {
  flex: 0 0 auto;
  margin: 0;
}

.admin-actions .btn,
.admin-actions .done-text {
  flex: 0 0 auto;
}

.admin-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.admin-page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--brown-dark);
  border-radius: 6px;
  background: var(--brown);
  color: #fff;
  font-weight: 700;
}


.pill {
  display: inline-flex !important;
  align-items: center;
  min-height: 26px;
  margin: 0 !important;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px !important;
  font-weight: 700;
  white-space: nowrap;
}

.pill.new {
  background: var(--teal-soft);
  color: #0d625c;
}

.pill.wait {
  background: var(--warn);
  color: var(--entry-lock-text);
}

.pill.done {
  background: #edf1f4;
  color: #515d64;
}

.done-text {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.empty-admin {
  padding: 30px 14px;
  color: var(--muted);
}

.note-bar {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  background: var(--cream);
  color: #aaaaaa;
  font-size: 13px;
  font-weight: 700;
}

@media (min-width: 761px) {
  .topbar .brand p,
  .topbar .status-row,
  .desktop-sheet .sheet-caption span,
  .content > .step-guide {
    display: none;
  }
}

@media (max-width: 760px) {

  .admin-settings-form {
    grid-template-columns: 1fr;
  }

  .admin-setting-check-row {
    grid-template-columns: 1fr;
  }

  .admin-settings-actions {
    justify-content: stretch;
  }

  .admin-settings-actions .btn {
    flex: 1;
  }
  body {
    background: #f4f6f7;
  }

  .site-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .brand-mark,
  .status-row {
    display: none;
  }

  .brand h1 {
    font-size: 18px;
  }

  .content {
    padding: 12px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border-radius: 0;
    margin: -12px -12px 12px;
  }

  .toolbar-left,
  .toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .toolbar-right {
    grid-template-columns: 1fr 1.3fr;
  }

  .toolbar .count {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 12px;
  }

  .desktop-sheet {
    display: none;
  }

  .mobile-editor {
    display: block;
  }

  .choice-row,
  .completion-panel fieldset {
    grid-template-columns: 1fr;
  }

  .completion-panel label {
    width: 100%;
  }

  .admin-wrap {
    width: 100%;
    margin: 0;
  }

  .admin-header {
    border-radius: 0;
  }

  .admin-main {
    border-radius: 0;
    box-shadow: none;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .mobile-fields {
    gap: 9px;
  }

  .m-field label {
    font-size: 11px;
  }

  .toolbar .btn {
    padding-left: 7px;
    padding-right: 7px;
  }
}

/* 2026-07 update: split name fields, joint names, confirmation dialog */
.entry-lock-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--entry-lock-border);
  border-radius: 8px;
  background: var(--cream);
  color: var(--entry-lock-text);
  font-size: 13px;
  font-weight: 700;
}

.entry-locked .desktop-sheet,
.entry-locked .mobile-editor,
.entry-locked .completion-panel {
  opacity: .58;
}

.entry-control:disabled,
.mobile-fields input:disabled,
.sheet-table input:disabled {
  cursor: not-allowed;
  background: #eef1f3;
  color: #89949b;
}

.sheet-table {
  min-width: 1380px;
}

.desktop-sheet th:nth-child(2),
.desktop-sheet td:nth-child(2) { width: 210px; }
.desktop-sheet th:nth-child(3),
.desktop-sheet td:nth-child(3) { width: 130px; }
.desktop-sheet th:nth-child(4),
.desktop-sheet td:nth-child(4) { width: 130px; }
.desktop-sheet th:nth-child(5),
.desktop-sheet td:nth-child(5),
.desktop-sheet th:nth-child(6),
.desktop-sheet td:nth-child(6) { width: 110px; }
.desktop-sheet th:nth-child(7),
.desktop-sheet td:nth-child(7),
.desktop-sheet th:nth-child(8),
.desktop-sheet td:nth-child(8) { width: 120px; }
.desktop-sheet th:nth-child(9),
.desktop-sheet td:nth-child(9) { width: 120px; }
.desktop-sheet th:nth-child(10),
.desktop-sheet td:nth-child(10) { width: 300px; }
.desktop-sheet th:nth-child(11),
.desktop-sheet td:nth-child(11) { width: 240px; }

.joint-note,
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.joint-note {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid var(--entry-lock-border);
  border-radius: 6px;
  background: var(--cream);
  color: var(--entry-lock-text);
  font-weight: 700;
}

.section-note-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.section-note-actions.wide {
  grid-column: 1 / -1;
}

.section-note-actions .joint-note {
  flex: 1 1 auto;
  grid-column: auto;
}

.section-cancel-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  border-color: #d5aaa5;
  background: #fff8f7;
  color: var(--red);
  font-size: 12px;
}


.joint-open-btn.wide {
  grid-column: 1 / -1;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 39, 43, .44);
}

.confirm-backdrop[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(560px, 100%);
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-dialog h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
}

.confirm-summary > div,
.confirm-summary > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  font-weight: 700;
}

.confirm-summary span {
  color: var(--muted);
  font-size: 13px;
}

.confirm-summary input {
  width: 90px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #cdd4d9;
  border-radius: 6px;
  text-align: right;
}

.leadtime {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: #0d625c;
  font-weight: 700;
}

.usage-help-dialog {
  width: min(640px, 100%);
}

.usage-help-list {
  display: grid;
  gap: 10px;
}

.usage-help-list section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.usage-help-list h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.usage-help-list p,
.usage-help-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.usage-help-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #31566c;
  font-weight: 700;
}

.delete-confirm-text {
  margin: 0;
  padding: 12px;
  border: 1px solid #e2bbb7;
  border-radius: 6px;
  background: #fff8f7;
  color: #73332f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.sample-row-text {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--entry-lock-border);
  border-radius: 6px;
  background: var(--warn);
  color: var(--entry-lock-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}




.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  font-weight: 700;
}

.confirm-check input {
  margin-top: 5px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .entry-lock-message {
    margin: 0 0 12px;
  }

  .confirm-dialog {
    padding: 16px;
  }

  .confirm-summary > div,
  .confirm-summary > label {
    align-items: flex-start;
    flex-direction: column;
  }

  .confirm-summary input {
    width: 100%;
    text-align: left;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }
}


/* 2026-07-09 update: form order, import feedback, joint/role rule */
.import-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: pre-line;
}

.import-message[data-type="info"] {
  border-color: #c6d5df;
  background: var(--blue-soft);
  color: #35556c;
}

.import-message[data-type="success"] {
  border-color: #badad6;
  background: var(--teal-soft);
  color: #0d625c;
}

.import-message[data-type="error"] {
  border-color: #e2bbb7;
  background: #fff2f1;
  color: var(--red);
}

.sheet-table {
  min-width: 1540px;
}

.desktop-sheet th:nth-child(2),
.desktop-sheet td:nth-child(2),
.desktop-sheet th:nth-child(3),
.desktop-sheet td:nth-child(3) { width: 112px; }
.desktop-sheet th:nth-child(4),
.desktop-sheet td:nth-child(4) { width: 124px; }
.desktop-sheet th:nth-child(5),
.desktop-sheet td:nth-child(5) { width: 300px; }
.desktop-sheet th:nth-child(6),
.desktop-sheet td:nth-child(6) { width: 240px; }
.desktop-sheet th:nth-child(7),
.desktop-sheet td:nth-child(7),
.desktop-sheet th:nth-child(8),
.desktop-sheet td:nth-child(8) { width: 130px; }
.desktop-sheet th:nth-child(9),
.desktop-sheet td:nth-child(9) { width: 220px; }
.desktop-sheet th:nth-child(10),
.desktop-sheet td:nth-child(10) { width: 150px; }
.desktop-sheet th:nth-child(11),
.desktop-sheet td:nth-child(11) { width: 150px; }

.section-open-btn.wide,
.joint-open-btn.wide {
  grid-column: 1 / -1;
}

.section-open-btn {
  min-height: 44px;
  border-style: dashed;
  background: #fbfcfc;
  color: #2f3b42;
}

.m-field.is-disabled label,
.role-disabled-input {
  color: #7d888f;
}

.role-disabled-input:disabled {
  border-color: #d7dcdf;
  background: #eef1f3;
}

.role-choice-text {
  margin: 0 0 10px;
  color: #3a454b;
  font-weight: 700;
}

.role-choice-actions {
  align-items: stretch;
}

@media (max-width: 760px) {
  .import-message {
    margin: 0 0 12px;
  }

  .role-choice-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* 2026-07-13 update: delete rows, input modes, mobile confirmation submit */
.field-panel input.large-name-input {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
}

.ime-japanese,
input[lang="ja"] {
  ime-mode: active;
}

input[inputmode="numeric"] {
  ime-mode: disabled;
}

.sheet-table {
  min-width: 1580px;
}

.sheet-table th:first-child,
.sheet-table td:first-child {
  width: 92px;
  min-width: 92px;
}

.row-index-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 0 6px;
}

.row-no {
  min-width: 22px;
}

.delete-row-btn {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #e2bbb7;
  border-radius: 6px;
  background: #fff8f7;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.delete-row-btn:hover {
  border-color: var(--red);
  background: #fff2f1;
}

.delete-row-btn:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #eef1f3;
  color: #89949b;
}

.mobile-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-delete-btn {
  min-height: 32px;
  padding: 6px 9px;
}

.completion-submit {
  display: none;
}

@media (max-width: 760px) {
  .mobile-card-head {
    align-items: flex-start;
  }

  .mobile-head-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
  }

  .completion-panel {
    border-color: #badad6;
    background: #fbfefd;
  }

  .completion-submit {
    display: flex;
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
  }
}

/* 2026-07-14 update: save-download confirmation and admin log */
.download-note,
.message-body p,
.message-body ul {
  margin: 8px 0 0;
  color: #4f5a61;
  font-size: 13px;
  font-weight: 600;
}

.message-body ul {
  padding-left: 1.3em;
}

.download-log-panel {
  margin-top: 14px;
}

.download-blocked,
.download-blocked:disabled {
  border-color: var(--line);
  background: #eef1f3;
  color: #89949b;
}

/* 2026-07-17 update: friendlier order confirmation */
.order-summary {
  gap: 8px;
}

.confirm-summary .order-line,
.confirm-summary .order-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  font-weight: 700;
}

.confirm-summary .order-total-line {
  border-color: #badad6;
  background: var(--teal-soft);
}

.confirm-summary .order-total-line strong {
  color: #0d625c;
  font-size: 22px;
}

.confirm-summary .order-spare input {
  width: 76px;
  margin-right: 4px;
}

.confirm-check-card {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.confirm-check-card.has-error {
  border-color: #e2bbb7;
  background: #fff8f7;
}

.confirm-error {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .confirm-summary .order-line,
  .confirm-summary .order-total-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 2026-07-28 update: spare count before completion check */
.spare-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.spare-panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-weight: 700;
}

.spare-panel-label strong,
.spare-panel-label small {
  display: block;
}

.spare-panel-label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.spare-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.spare-input-wrap input {
  width: 88px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #cdd4d9;
  border-radius: 6px;
  text-align: right;
}

.spare-input-wrap input:focus {
  outline: none;
  border-color: var(--teal);
  background: #f4fbfa;
}

@media (max-width: 760px) {
  .spare-panel {
    margin-top: 12px;
  }

  .spare-panel-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .spare-input-wrap,
  .spare-input-wrap input {
    width: 100%;
  }
}

/* 2026-07-28 update: step guide */
.step-guide {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.step-list li span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e7ecef;
  color: #536068;
  flex-shrink: 0;
}

.step-list li.done {
  border-color: #badad6;
  background: var(--teal-soft);
  color: #0d625c;
}

.step-list li.done span {
  background: var(--teal);
  color: #fff;
  font-size: 0;
}

.step-list li.done span::after {
  content: "✓";
  font-size: 13px;
}

.step-list li.active {
  border-color: var(--brown);
  background: var(--cream);
  color: var(--step-active-text);
  box-shadow: 0 0 0 2px rgba(var(--step-active-text-rgb), .12);
}

.step-hint {
  margin: 9px 0 0;
  color: #3f4a51;
  font-size: 13px;
  font-weight: 700;
}

.step-mobile-status {
  display: none;
}

.step-focus {
  position: relative;
  border-color: var(--brown) !important;
  background-image: linear-gradient(0deg, rgba(var(--entry-lock-border-rgb), .045), rgba(var(--entry-lock-border-rgb), .045));
  box-shadow: 0 0 0 3px rgba(var(--entry-lock-border-rgb), .18), 0 10px 26px rgba(var(--entry-lock-border-rgb), .10);
  animation: stepFocusGlow 2.8s ease-in-out infinite;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

button.step-focus {
  background-image: linear-gradient(0deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .10));
}

.step-focus input:not(:disabled),
.step-focus select:not(:disabled),
.step-focus textarea:not(:disabled) {
  border-color: rgba(var(--entry-lock-border-rgb), .72);
  background-color: #fff;
}

@keyframes stepFocusGlow {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(var(--entry-lock-border-rgb), .16), 0 8px 22px rgba(var(--entry-lock-border-rgb), .08);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(var(--entry-lock-border-rgb), .30), 0 14px 32px rgba(var(--entry-lock-border-rgb), .13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-focus {
    animation: none;
  }
}

@media (max-width: 760px) {
  .step-guide {
    margin: 0 0 12px;
    padding: 10px 12px;
  }

  .step-list {
    display: none;
  }

  .step-mobile-status {
    display: grid;
    gap: 8px;
  }

  .step-progress {
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7ecef;
  }

  .step-progress span {
    display: block;
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: var(--teal);
    transition: width .2s ease;
  }
}


/* 2026-07-28 update: prevent iPhone Safari input zoom */
@media (max-width: 760px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
}


/* 2026-07-28 update: iPhone-friendly sticky header, step and toolbar */
@media (max-width: 760px) {
  .site-frame {
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    padding: 10px 12px 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(33, 39, 43, .08);
  }

  .brand h1 {
    font-size: 16px;
    line-height: 1.25;
  }

  .brand p {
    display: none;
  }

  .step-guide {
    position: sticky;
    top: 44px;
    z-index: 65;
    margin: 0 -12px 8px;
    padding: 8px 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(33, 39, 43, .07);
  }

  .step-mobile-status {
    gap: 6px;
  }

  .step-mobile-status strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .step-hint {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
  }

  .toolbar {
    position: sticky;
    top: 112px;
    z-index: 60;
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px 12px;
    padding: 8px 12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(33, 39, 43, .08);
  }

  .toolbar-left,
  .toolbar-right {
    display: contents;
  }

  #usageHelpBtn { order: 1; }
  #addRowBtn { order: 2; }
  #importBtn { order: 3; }
  #downloadBtn { order: 4; }
  .toolbar-right .btn-primary { order: 5; }

  .toolbar .count {
    order: 6;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    flex: 0 0 auto;
  }

  .toolbar .btn {
    min-width: max-content;
    flex: 0 0 auto;
  }

  .mobile-current-entry {
    position: sticky;
    top: var(--mobile-current-top, 166px);
    z-index: 58;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 10px rgba(33, 39, 43, .07);
    color: #3f4a51;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .mobile-current-entry strong {
    font-size: 14px;
    line-height: 1.2;
  }

  .mobile-current-entry span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
  }
}
