:root {
  color-scheme: light;
  --ink: #20201d;
  --muted: #6d675e;
  --line: #ddd5ca;
  --paper: #f8f4ed;
  --panel: #fffdf8;
  --accent: #3d6f63;
  --accent-dark: #28544a;
  --warm: #c2784b;
  --shadow: 0 22px 60px rgba(46, 37, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(248, 244, 237, 0.88), rgba(248, 244, 237, 0.94)),
    url("https://images.unsplash.com/photo-1511285560929-80b456fea0bc?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.liff-form-mode .liff-header,
.liff-form-mode .liff-notice,
.liff-form-mode .liff-profile,
.liff-form-mode .liff-bookings,
.liff-form-mode .liff-actions {
  display: none;
}

.liff-form-mode .liff-shell {
  max-width: none;
  padding: 0;
}

.liff-form-frame {
  width: 100%;
  min-height: 100vh;
  border: 0;
}

.app-shell {
  width: min(760px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.hero,
.form-view,
.confirm-view,
.thanks-view,
.admin-shell {
  width: 100%;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(221, 213, 202, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero,
.confirm-view,
.thanks-view {
  padding: clamp(28px, 7vw, 64px);
}

.brand {
  margin: 0 0 20px;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: clamp(40px, 8vw, 76px);
  font-family: Georgia, "Times New Roman", serif;
}

h2 {
  font-size: clamp(25px, 5vw, 42px);
}

.lead {
  max-width: 34em;
  margin: 18px 0 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.sub-lead {
  max-width: 34em;
  margin: -18px 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.primary-button,
.ghost-button,
.option-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 0 22px;
  color: #fff;
  background: var(--accent);
}

a.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.next-step-box {
  margin: 0 0 24px;
  padding: 18px 20px;
  background: rgba(61, 111, 99, 0.08);
  border: 1px solid rgba(61, 111, 99, 0.18);
  border-radius: 8px;
}

.next-step-box p {
  margin: 0 0 10px;
  font-weight: 700;
}

.next-step-box ul {
  margin: 0;
  padding-left: 1.4em;
  color: var(--muted);
  line-height: 1.8;
}

.line-button {
  background: #06c755;
}

.liff-shell {
  width: min(720px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 28px;
}

.liff-header,
.liff-profile,
.liff-notice,
.liff-empty,
.liff-card {
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(221, 213, 202, 0.9);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(46, 37, 24, 0.09);
}

.liff-header {
  padding: 24px;
}

.liff-header h1 {
  font-size: 34px;
}

.liff-header p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.liff-notice {
  margin-top: 14px;
  padding: 16px 18px;
  color: var(--muted);
}

.liff-notice.warn {
  color: #7c4b16;
  background: #fff7e8;
}

.liff-notice.error {
  color: #a3422b;
  background: #fff1ec;
}

.liff-notice p {
  margin: 0;
  line-height: 1.7;
}

.liff-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.liff-profile img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.liff-profile p {
  margin: 0 0 3px;
  font-weight: 700;
}

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

.liff-bookings {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.liff-empty,
.liff-card {
  padding: 18px;
}

.liff-empty h2,
.liff-card h2 {
  font-size: 22px;
}

.liff-empty p,
.liff-card-note {
  color: var(--muted);
  line-height: 1.7;
}

.liff-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.liff-card header p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.liff-card header span {
  align-self: flex-start;
  min-height: 28px;
  padding: 5px 10px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.liff-card dl {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.liff-card dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.liff-followups {
  margin-top: 16px;
}

.liff-followups h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.liff-followups ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.liff-followups li {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: rgba(61, 111, 99, 0.08);
  border-radius: 8px;
}

.liff-followups strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.liff-followups small {
  color: var(--muted);
}

.liff-followup-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.liff-kind-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.liff-kind-toggle button {
  min-height: 40px;
  color: var(--ink);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.liff-kind-toggle button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.liff-followup-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.liff-form-message {
  min-height: 1.4em;
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
}

.liff-actions {
  display: flex;
  margin-top: 14px;
}

.liff-actions .primary-button {
  width: 100%;
}

.primary-button:hover,
.option-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.ghost-button {
  padding: 0 20px;
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.form-view {
  display: flex;
  flex-direction: column;
  min-height: min(720px, calc(100vh - 64px));
  overflow: hidden;
}

.progress-wrap {
  padding: 22px clamp(20px, 5vw, 44px);
  border-bottom: 1px solid var(--line);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  background: #ece4d8;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 14%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 220ms ease;
}

.question-card {
  flex: 1;
  min-height: 0;
  padding: clamp(24px, 6vw, 48px);
}

.step-label {
  margin: 0 0 10px;
  color: var(--warm);
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.question-hint {
  margin: 8px 0 -10px;
  color: var(--muted);
  font-size: 14px;
}

.required-note,
.contact-required-note {
  color: #a3422b;
  font-size: 13px;
  font-weight: 700;
}

.required-note {
  margin: 8px 0 -10px;
}

.contact-required-note {
  margin: 22px 0 0;
}

.form-error {
  min-height: 1.5em;
  margin: 0 clamp(20px, 5vw, 44px) 8px;
  color: #a3422b;
  font-size: 14px;
  font-weight: 700;
}

.option-button {
  width: 100%;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background: #fffaf2;
  border-color: var(--line);
}

.option-button[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.date-field,
.location-detail-field,
.contact-fields,
.note-field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
}

.date-field p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.contact-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.contact-fields label {
  display: grid;
  gap: 8px;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.field-label strong {
  color: #a3422b;
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
}

input {
  height: 48px;
  padding: 0 14px;
}

textarea {
  padding: 14px;
  resize: vertical;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(20px, 5vw, 44px);
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: rgba(255, 253, 248, 0.98);
  backdrop-filter: blur(8px);
}

.summary-list,
.submission-card dl {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.summary-list div,
.submission-card dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.error-text {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: #a3422b;
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
  padding: clamp(24px, 5vw, 44px);
}

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

.admin-login {
  display: flex;
  gap: 10px;
}

.admin-lead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
}

.admin-tabs button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.admin-tabs button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.admin-stats > div {
  min-height: 92px;
  padding: 18px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-stats strong {
  display: block;
  font-size: 36px;
}

.admin-stats span {
  display: inline-block;
  margin: 4px 10px 4px 0;
  color: var(--muted);
}

.submission-list {
  display: grid;
  gap: 14px;
}

.admin-panel,
.admin-grid,
.admin-section {
  min-width: 0;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

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

.admin-section {
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-section h2 {
  font-size: 22px;
}

.empty-text {
  margin: 0;
  color: var(--muted);
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-list span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: rgba(61, 111, 99, 0.09);
  border: 1px solid rgba(61, 111, 99, 0.16);
  border-radius: 999px;
  font-size: 12px;
}

.submission-card {
  padding: 20px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.submission-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.submission-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.submission-card h2 {
  font-size: 20px;
}

.submission-card header span {
  height: 28px;
  padding: 4px 10px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  font-size: 13px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.status-actions button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.status-actions button:hover {
  border-color: var(--accent);
}

.status-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.followup-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.followup-list li {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  background: rgba(61, 111, 99, 0.07);
  border-radius: 8px;
}

.followup-list strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.followup-list small {
  color: var(--muted);
}

.admin-table-wrap {
  overflow-x: auto;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

.admin-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.log-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.log-list span {
  color: var(--muted);
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .app-shell {
    width: min(100% - 20px, 760px);
    padding: 10px 0;
  }

  .option-grid,
  .contact-fields,
  .admin-stats,
  .admin-grid.two,
  .summary-list div,
  .liff-card dl div,
  .submission-card dl div {
    grid-template-columns: 1fr;
  }

  .question-card {
    padding: 24px 20px;
  }

  .admin-header,
  .admin-login {
    flex-direction: column;
  }

  .nav-row {
    padding: 14px 20px;
  }

  .log-list article {
    display: grid;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
