﻿:root {
  --bg: #f4f0fb;
  --panel: #fcfaff;
  --panel-strong: #e6dcfa;
  --line: #d7c9f3;
  --text: #2d2440;
  --muted: #6e6388;
  --primary: #7c5cff;
  --primary-strong: #5c3de0;
  --danger: #c1467a;
  --shadow: 0 18px 40px rgba(71, 47, 130, 0.10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 28%),
    linear-gradient(180deg, #f7f3ff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.hero {
  padding: 0 0 10px;
}

.hero-banner {
  display: block;
  width: min(100%, 720px);
  height: auto;
  margin: 0 auto;
}

.layout {
  display: grid;
  gap: 16px;
}

.card {
  background: rgba(252, 250, 255, 0.96);
  border: 1px solid rgba(124, 92, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card--accent {
  background: linear-gradient(180deg, rgba(245, 240, 255, 0.98), rgba(238, 232, 255, 0.96));
}

.card--inner {
  margin-top: 18px;
  padding: 18px;
  box-shadow: none;
}

.card--wide {
  width: 100%;
}

.section-head h2,
.section-head h3,
.section-head p {
  margin: 0;
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.section-head--inline {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.optional-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.optional-label {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(112px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.quick-form .error-message {
  grid-column: 1 / -1;
  margin-top: 0;
}

.quick-manual {
  grid-column: 1 / -1;
}

.quick-manual input {
  max-width: 180px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.field span {
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(124, 92, 255, 0.18);
  border-color: var(--primary);
}

.button {
  min-height: 48px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--ghost {
  background: rgba(124, 92, 255, 0.10);
  color: var(--primary-strong);
  font-weight: 700;
}

.button--danger {
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}

.button--primary {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.mascot-talk {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 8px;
}

.speech-bubble {
  position: relative;
  width: min(100%, 520px);
  padding: 14px 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 2px solid rgba(124, 92, 255, 0.18);
  color: var(--primary-strong);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.65;
  box-shadow: 0 14px 28px rgba(92, 61, 224, 0.10);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-right: 2px solid rgba(124, 92, 255, 0.18);
  border-bottom: 2px solid rgba(124, 92, 255, 0.18);
  transform: translateX(-50%) rotate(45deg);
}

.mascot-image {
  width: min(100%, 220px);
  height: auto;
  display: block;
}

.summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  line-height: 1.7;
}

.summary-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(124, 92, 255, 0.12);
}

.summary-box__label,
.summary-box__value,
.member-hint {
  margin: 0;
}

.summary-box__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-box__value {
  margin-top: 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.summary-box__value--small {
  font-size: 1rem;
  line-height: 1.5;
}

.advanced-panel {
  margin-top: 18px;
}

.member-section {
  margin-top: 18px;
}

.member-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.member-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(124, 92, 255, 0.14);
  background: rgba(255, 255, 255, 0.8);
  display: grid;
  gap: 12px;
}

.member-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.member-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--primary-strong);
  font-weight: 700;
  white-space: nowrap;
}

.member-name-input--compact {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.member-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  min-height: 1.6em;
}

.settlement-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.settlement-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(124, 92, 255, 0.14);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--primary-strong);
  font-weight: 700;
}

.empty-state,
.error-message {
  margin: 14px 0 0;
  line-height: 1.6;
}

.empty-state {
  color: var(--muted);
}

.error-message {
  min-height: 1.2em;
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.92rem;
}

.footer-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.install-option {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.text-option-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--primary-strong);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.install-dialog {
  width: min(92vw, 360px);
  border: none;
  padding: 0;
  background: transparent;
}

.install-dialog::backdrop {
  background: rgba(45, 36, 64, 0.26);
}

.dialog-card {
  margin: 0;
  padding: 22px 20px;
  border-radius: 22px;
  background: rgba(252, 250, 255, 0.98);
  border: 1px solid rgba(124, 92, 255, 0.14);
  box-shadow: var(--shadow);
}

.dialog-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.dialog-body {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.dialog-body p,
.dialog-body ol {
  margin: 0;
}

.dialog-body ol {
  padding-left: 1.2rem;
}

.dialog-body p + p,
.dialog-body p + ol {
  margin-top: 8px;
}

.dialog-close {
  width: 100%;
  margin-top: 16px;
}

.notice-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(124, 92, 255, 0.18);
  color: var(--muted);
}

.notice-block p {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-weight: 700;
}

.notice-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.8;
}

.notice-list li + li {
  margin-top: 4px;
}

.page-footer {
  margin-top: 18px;
  padding: 14px 4px 0;
  border-top: 1px solid rgba(124, 92, 255, 0.18);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.page-footer p {
  margin: 0;
}

.page-footer a {
  color: var(--primary-strong);
  font-weight: 700;
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 420px) {
  .quick-form {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 10px;
  }

  .speech-bubble {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
}

@media (min-width: 760px) {
  .layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .card--wide {
    grid-column: span 2;
  }

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

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

  .mascot-talk {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: end;
    justify-items: stretch;
    gap: 8px;
  }

  .speech-bubble {
    width: 100%;
    margin-top: 6px;
  }

  .speech-bubble::after {
    left: auto;
    right: -14px;
    bottom: 26px;
    transform: rotate(45deg);
  }

  .mascot-image {
    width: 260px;
    justify-self: end;
  }
}

.version-meta {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.version-meta p {
  margin: 0;
}

.usage-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(124, 92, 255, 0.18);
  color: var(--muted);
}

.usage-block p {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-weight: 700;
}

.usage-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.8;
}

.usage-list li + li {
  margin-top: 4px;
}
