﻿:root {
  --navy: #1b1b1b;
  --navy-2: #2a2a2a;
  --gold: #f57c00;
  --orange-strong: #ff9800;
  --orange-soft: #fff3e0;
  --bg: #fff8f0;
  --card: #ffffff;
  --soft: #fffaf3;
  --line: #eadfce;
  --text: #1d1d1d;
  --muted: #666666;
  --danger: #b42318;
  --ok: #027a48;
  --warn: #b54708;
  --focus: #f57c00;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

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

.wrap,
.app-main {
  width: min(900px, 100%);
  margin: 0 auto;
}

.app-header {
  padding: max(22px, env(safe-area-inset-top)) 16px 28px;
  background: linear-gradient(135deg, #111111, var(--navy-2));
  color: #ffffff;
  border-bottom: 5px solid var(--gold);
}

.header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.guide-open-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 42px;
  padding: 8px 15px;
  color: #ffffff;
  background: rgba(245, 124, 0, .16);
  border: 1px solid rgba(255, 152, 0, .85);
  border-radius: 999px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.guide-open-button:hover,
.guide-open-button:focus-visible {
  color: #111111;
  background: var(--orange-strong);
  transform: none;
}

.app-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

body.guide-is-open {
  overflow: hidden;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
}

.guide-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 6px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  outline: none;
  overscroll-behavior: contain;
}

.guide-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.guide-dialog-header h2 {
  margin: 4px 0 0;
}

.guide-close-button {
  flex: 0 0 auto;
  width: auto;
}

.guide-steps {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.guide-steps > li {
  position: relative;
  min-width: 0;
  padding: 14px 14px 14px 52px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  counter-increment: guide-step;
}

.guide-steps > li::before {
  position: absolute;
  top: 13px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  content: counter(guide-step);
  color: #ffffff;
  background: var(--gold);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.guide-steps h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 16px;
}

.guide-steps p {
  margin: 0;
  color: #475467;
  font-size: 14px;
}

.guide-steps ul {
  margin: 7px 0;
  padding-left: 20px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.guide-qa {
  margin-top: 20px;
}

.guide-qa h3 {
  color: var(--navy);
}

.guide-qa dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.guide-qa dl > div {
  padding: 12px 14px;
  background: var(--orange-soft);
  border: 1px solid #ffd08a;
  border-radius: 10px;
}

.guide-qa dt {
  color: var(--navy);
  font-weight: 900;
}

.guide-qa dd {
  margin: 4px 0 0;
  color: #475467;
}

.guide-dialog-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.guide-dialog-footer button {
  min-width: 180px;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.2;
  letter-spacing: 0;
}

.subtitle {
  margin: 8px 0 0;
  color: #f6efe6;
  font-size: 15px;
}

.header-lead {
  margin: 6px 0 0;
  color: #eadfce;
  font-size: 14px;
}

.app-main {
  padding: 18px 14px calc(64px + env(safe-area-inset-bottom));
}

.app-footer {
  width: min(900px, 100%);
  margin: -32px auto 28px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(27, 27, 27, .06);
}

h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

h2 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: #ffffff;
  font-size: 14px;
}

h3 {
  margin: 18px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.grid,
.mini-grid,
.category-counts,
.summary-grid {
  display: grid;
  gap: 12px;
}

.grid,
.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.settings-card {
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.settings-card h3 {
  margin-top: 0;
}

.settings-stack {
  display: grid;
  gap: 12px;
}

.details-panel summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.details-summary-text {
  display: grid;
  gap: 8px;
}

.details-summary-note {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

.details-summary-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.details-panel[open] .details-summary-note {
  color: rgba(255, 255, 255, .82);
}

.details-panel[open] .details-summary-help {
  color: rgba(255, 255, 255, .78);
}

.friendly-amount-settings {
  display: grid;
  gap: 12px;
}

.result-details-wrap {
  margin-top: 14px;
}

.result-details summary {
  margin-bottom: 0;
}

.result-details[open] summary {
  margin-bottom: 14px;
}

.payment-result-list {
  display: grid;
  gap: 10px;
}

.payment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
}

.payment-info {
  min-width: 0;
}

.payment-breakdown,
.payment-reason {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.payment-main {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.payment-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payment-main strong {
  color: var(--text);
  font-size: 24px;
  white-space: nowrap;
}

.refund-card {
  border-left-color: var(--warn);
  background: #fffaf2;
}

.refund-warning,
.adjustment-warning {
  margin-top: 10px;
  padding: 9px 11px;
  color: var(--warn);
  background: #fff7e8;
  border: 1px solid #f2d29b;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.refund-text {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.refund-summary {
  display: block;
  margin-top: 3px;
  color: var(--warn);
  font-size: 12px;
}

.payment-name {
  min-width: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.payment-amount {
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}
.details-open-label,
.details-close-label {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.details-panel[open] .details-close-label {
  background: #ffffff;
  color: var(--navy);
}

.details-panel summary::marker {
  color: var(--navy);
}

.details-close-label {
  display: none;
}

.details-panel[open] summary {
  margin-bottom: 12px;
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.details-panel[open] summary::marker {
  color: #ffffff;
}

.details-panel[open] .details-open-label {
  display: none;
}

.details-panel[open] .details-close-label {
  display: inline;
}

.detail-close-button {
  width: 100%;
}

.details-panel h2 {
  margin-top: 0;
}

.save-settings {
  margin-top: 16px;
}

.save-settings h4 {
  margin: 16px 0 8px;
}

.named-save-field {
  margin-top: 12px;
}

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

.saved-preset-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.saved-preset-title {
  min-width: 0;
  color: var(--navy);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.saved-preset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-preset-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

.field-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-counts {
  display: grid;
  gap: 6px;
}

.count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 94px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.count-header {
  padding-block: 2px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.count-title {
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.count-cell {
  min-width: 0;
}

.count-input {
  min-height: 40px;
  padding: 6px 8px;
  text-align: center;
}

label,
.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, .18);
}

input::placeholder,
textarea::placeholder {
  color: #a9b2c3;
  opacity: 1;
}

textarea {
  min-height: 240px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--gold);
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-card input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  accent-color: var(--gold);
}

.checkbox-card:has(input:checked) {
  border-color: var(--focus);
  background: var(--orange-soft);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, .14);
}

.checkbox-card.disabled {
  color: var(--muted);
  background: #f3f5f8;
  cursor: not-allowed;
}

.field-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

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

.input-card {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.input-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 900;
}

.group-details {
  padding: 0;
  overflow: hidden;
}

.group-summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 12px 14px;
  background: var(--soft);
  cursor: pointer;
}

.group-summary::marker {
  color: var(--navy);
}

.group-details[open] .group-summary {
  border-bottom: 1px solid var(--line);
}

.group-summary-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.group-summary-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.group-detail-body {
  padding: 12px;
}

.adjustment-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  overflow: hidden;
}

.adjustment-details > summary {
  padding: 12px 14px;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.adjustment-details[open] > summary {
  color: #ffffff;
  background: var(--navy);
}

.adjustment-detail-body {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.adjustment-grid {
  margin-top: 12px;
}

.overall-adjustment-details {
  margin-bottom: 14px;
}

.compact-actions {
  margin: -2px 0 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.action-bar {
  align-items: stretch;
}

button {
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--orange-strong));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 124, 0, .22);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  touch-action: manipulation;
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: #ffffff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.gold {
  background: linear-gradient(135deg, var(--gold), var(--orange-strong));
  color: #ffffff;
}

button.danger {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffccc7;
  box-shadow: none;
}

button.warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  box-shadow: none;
}

.input-card-title button {
  min-height: 36px;
  padding: 8px 12px;
}

.metric {
  min-width: 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric-value {
  font-size: 19px;
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.ok {
  color: var(--ok);
}

.ng {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th {
  padding: 9px;
  background: var(--navy);
  color: #ffffff;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

td {
  padding: 9px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.right {
  text-align: right;
  white-space: nowrap;
}

.mobile-result-list {
  display: none;
}

.result-card-list {
  gap: 10px;
}

.result-card {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  overflow-wrap: anywhere;
}

.result-card-title {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
}

.result-card-grid {
  display: grid;
  gap: 6px;
  margin: 0;
}

.result-card-grid div,
.result-line,
.result-amount {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-card-grid dt,
.result-line span,
.result-amount span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-card-grid dd,
.result-line strong {
  min-width: 0;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.result-amount {
  align-items: baseline;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.result-amount strong {
  color: var(--gold);
  font-size: 21px;
  font-weight: 900;
  text-align: right;
}

.toggle-box {
  margin-bottom: 10px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.card-check {
  min-height: 48px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.card-check:has(input:checked) {
  background: var(--orange-soft);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, .12);
}

.check-label input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  accent-color: var(--gold);
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status.auto {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

.status.lock {
  background: #fff7ed;
  color: #b54708;
  border: 1px solid #fed7aa;
}

.print-title {
  display: none;
}

.print-share-message {
  display: none;
}

.pdf-help {
  margin-top: 8px;
}

.save-help {
  margin-top: 8px;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: inline;
}

.is-mobile-device .pc-print-button,
.is-mobile-device .desktop-only {
  display: none;
}

.is-mobile-device .mobile-only {
  display: inline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

[data-workflow-step] {
  min-width: 0;
}

.workflow-choice {
  padding: 22px;
  border-top: 5px solid var(--gold);
}

.workflow-choice-heading h2 {
  margin-top: 4px;
}

.workflow-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.workflow-choice-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 154px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
}

.workflow-choice-card:hover,
.workflow-choice-card:focus-visible {
  color: var(--text);
  background: var(--orange-soft);
  border-color: var(--gold);
  transform: none;
}

.workflow-choice-card strong {
  color: var(--navy);
  font-size: 20px;
  line-height: 1.35;
}

.workflow-choice-card > span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.workflow-choice-kicker {
  width: fit-content;
  padding: 3px 9px;
  color: #ffffff;
  background: var(--gold);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

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

.workflow-toolbar > div {
  display: grid;
  min-width: 0;
}

.workflow-toolbar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-toolbar strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.workflow-toolbar button {
  flex: 0 0 auto;
}

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

.step-progress li {
  min-width: 0;
  padding: 8px 5px;
  color: var(--muted);
  background: #f2eadf;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.step-progress li.is-complete {
  color: var(--navy);
  background: #ffe0b2;
}

.step-progress li.is-current {
  color: #ffffff;
  background: var(--gold);
}

.workflow-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  color: var(--danger);
  background: #fff2f0;
  border: 1px solid #f5b7b1;
  border-radius: 10px;
  font-weight: 800;
}

.meeting-flag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meeting-flag {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.meeting-flag:has(input:checked) {
  background: var(--orange-soft);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 124, 0, .12);
}

.meeting-flag input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.payment-method-card {
  margin-top: 14px;
}

.payment-method-card .field {
  margin: 0;
}

.paypay-settings {
  margin-top: 14px;
}

.compact-textarea {
  min-height: 88px;
}

.paypay-image-field {
  margin-top: 14px;
}

.paypay-preview-wrap {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.paypay-preview-wrap img {
  display: block;
  width: min(280px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.paypay-include-label {
  margin-top: 16px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.paypay-result-card {
  margin-top: 16px;
  padding: 18px;
  background: #ffffff;
  border: 2px solid var(--gold);
  border-left-width: 6px;
  border-radius: 14px;
}

.paypay-result-card h3 {
  margin-top: 0;
  color: var(--navy);
}

.paypay-result-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.paypay-result-layout img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #ffffff;
  border: 2px solid var(--navy);
  border-radius: 10px;
}

.paypay-result-text {
  min-width: 0;
}

.paypay-result-text p {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}

.paypay-result-name {
  color: var(--navy);
  font-size: 19px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.paypay-result-card.has-refund::after {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  content: "返金候補の方には、幹事から別途ご連絡します。";
  color: var(--warn);
  background: #fff7e8;
  border: 1px solid #f2d29b;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

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

.confirmation-row {
  display: grid;
  grid-template-columns: minmax(110px, .4fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.confirmation-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.confirmation-value {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.step-navigation {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(27, 27, 27, .14);
  backdrop-filter: blur(8px);
}

.step-navigation span {
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .app-main {
    padding-inline: 10px;
  }

  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .header-title-row {
    align-items: flex-start;
  }

  .guide-open-button {
    width: auto;
    min-height: 40px;
    padding: 7px 12px;
    font-size: 13px;
  }

  .guide-dialog {
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom)));
    padding: 16px;
    border-radius: 14px;
  }

  .guide-dialog-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .guide-close-button {
    width: 100%;
  }

  .guide-steps > li {
    padding: 13px 12px 13px 48px;
  }

  .guide-steps > li::before {
    left: 11px;
  }

  .guide-dialog-footer button {
    width: 100%;
  }

  .grid,
  .mini-grid,
  .summary-grid,
  .workflow-choice-grid,
  .meeting-flag-grid {
    grid-template-columns: 1fr;
  }

  .workflow-choice {
    padding: 16px;
  }

  .workflow-choice-card {
    min-height: 0;
  }

  .workflow-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-toolbar button {
    width: 100%;
  }

  .step-progress {
    gap: 4px;
  }

  .step-progress li {
    padding: 7px 3px;
    font-size: 10px;
  }

  .confirmation-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .payment-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .paypay-result-layout {
    grid-template-columns: 1fr;
  }

  .paypay-result-layout img {
    width: min(260px, 100%);
    margin: 0 auto;
  }

  .paypay-preview-wrap {
    justify-items: stretch;
  }

  .paypay-preview-wrap img {
    width: min(260px, 100%);
    margin: 0 auto;
  }

  .payment-main {
    justify-items: start;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .payment-main strong {
    font-size: 28px;
  }

  .step-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .step-navigation span {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .count-row {
    grid-template-columns: minmax(0, 1fr) 58px 78px;
    gap: 6px;
    padding-inline: 6px;
  }

  .count-title {
    font-size: 12px;
  }

  .count-input {
    min-height: 42px;
    padding-inline: 6px;
  }

  .field-wide {
    grid-column: auto;
  }

  button {
    width: 100%;
  }

  .input-card-title button {
    width: auto;
  }

  .saved-preset-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toggle-line {
    align-items: flex-start;
  }

  .pc-print-button,
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline;
  }

  .result-table-wrap {
    display: none;
  }

  .mobile-result-list {
    display: grid;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #ffffff;
  }

  .app-header,
  .no-print,
  .actions,
  button {
    display: none !important;
  }

  .app-main {
    width: auto;
    max-width: none;
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .print-title {
    display: block;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--navy);
    color: #ffffff;
    border-bottom: 4px solid var(--gold);
  }

  .print-label {
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
  }

  .print-main {
    margin-top: 2px;
    font-size: 26px;
    font-weight: 900;
  }

  #shareMessage {
    display: none;
  }

  .print-share-message {
    display: block;
    white-space: pre-wrap;
    overflow: visible;
    min-height: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.65;
    break-inside: auto;
  }

  .table-wrap {
    overflow: visible;
  }

  .result-table-wrap {
    display: block;
  }

  .mobile-result-list {
    display: none !important;
  }
}



