:root {
  color-scheme: light dark;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --accent: #ff5a5f;
  --primary: var(--accent);
  --text: #111;
  --muted: #6b7280;
  --bg: #f9fafb;
  --card: #fff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.top-bar {
  padding: 1rem;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  height: 36px;
  max-width: 140px;
  object-fit: contain;
}

.brand-row h1 {
  margin: 0;
  font-size: 1.4rem;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brand-club {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.brand-club::before {
  content: "— ";
  color: var(--muted);
  font-weight: 400;
}

.subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .brand-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .brand-club {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 600;
  }

  .brand-club::before {
    content: "";
  }
}

.date-controls {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.pill-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.65rem 1rem;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pill-btn:hover {
  border-color: var(--primary);
}

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

.pill-btn.danger {
  background: #fff5f5;
  border-color: #fecaca;
  color: #b91c1c;
}

.pill-btn.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.date-field {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
}

.date-field input {
  margin-top: 0.3rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 1rem;
  color: var(--text);
  width: 100%;
  appearance: none;
  background: #fff;
}

.field-label {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .date-controls {
    gap: 0.5rem;
  }

  .pill-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  .date-field {
    flex: 1 0 100%;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
}

.banner {
  margin: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: #fff7ed;
  color: #c2410c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid #fed7aa;
}

.banner .pill-btn {
  flex: 0 0 auto;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.1);
}

.card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.card-time {
  font-size: 1.5rem;
  font-weight: 600;
}

.card-price {
  font-weight: 600;
  color: var(--primary);
}

.card-free {
  font-size: 0.95rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.hidden {
  display: none !important;
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet-content {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 1.5rem;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.15);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

.sheet-content .close-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #4b5563;
  font-size: 1.35rem;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.sheet-content .close-btn:hover {
  color: #111;
  border-color: rgba(15, 23, 42, 0.2);
  background: #f8fafc;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.95rem;
}

.form-field input,
.form-field select {
  width: 100%;
}

.field-error {
  font-size: 0.8rem;
  color: #dc2626;
  min-height: 1em;
}

.field-error.hint {
  color: var(--muted);
}

.error-box.hidden {
  display: none;
}

input,
select {
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 1rem;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.9rem;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.sheet-footer-bar {
  position: sticky;
  bottom: 0;
  margin-top: 0.5rem;
  padding: 0.85rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  flex-wrap: nowrap;
}

.sheet-total {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
  min-width: 0;
}

.sheet-total-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sheet-total-amount {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.sheet-total-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.sheet-pay-btn {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0.9rem 1.4rem;
  min-width: 140px;
  white-space: nowrap;
}

.icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.error-box {
  padding: 0.75rem;
  border-radius: 12px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.hint.warning {
  color: #b45309;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
  padding: 1rem 1.2rem;
  width: min(90%, 420px);
  z-index: 40;
}

.notice button {
  margin-top: 0.75rem;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #111;
  padding: 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.notice button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.info-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.info-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 24px;
  width: min(360px, 95%);
  position: relative;
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.2);
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.95rem;
}

.info-item .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--primary);
}

.info-item a {
  color: var(--primary);
  text-decoration: none;
}

.info-item a:hover {
  text-decoration: underline;
}

.support-footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.support-footer a {
  color: var(--primary);
  text-decoration: none;
  margin-left: 0.35rem;
}

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

@media (min-width: 600px) {
  .sheet {
    align-items: center;
  }

  .sheet-content {
    border-radius: 24px;
  }
}

.status-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1.5rem;
}

.status-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.22);
  color-scheme: light;
}

.status-label {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.status-card h2 {
  margin: 0.5rem 0;
}

.status-subtitle {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.status-message {
  margin: 0 auto 1rem;
  color: var(--muted);
  max-width: 320px;
}

.status-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.2rem 0 0.4rem;
}

.status-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem auto 1rem;
}

.timer-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fdecc8;
  color: #8a4b00;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.timer-hint {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.status-details {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 1rem;
}

.status-details .detail-row {
  font-weight: 500;
}

.status-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.4rem 0 0.8rem;
}

.order-short {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #334155;
  cursor: pointer;
}

.order-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.status-support {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.9rem;
  margin: 0 auto 1.2rem;
  text-align: left;
}

.support-title {
  margin: 0 0 0.2rem;
  font-weight: 600;
  color: #0f172a;
}

.support-text {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: #475569;
}

.support-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.support-link:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary);
}

.status-details {
  text-align: left;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.status-details .detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.status-details .detail-row span {
  color: var(--muted);
}

.status-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.status-actions .primary-btn,
.status-actions .pill-btn {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
}

.status-actions .pill-btn {
  color: var(--text);
  background: #fff;
  border-color: #d4d4d8;
}

#statusBackBtn,
#statusCloseBtn {
  color: var(--text) !important;
  background: #f9fafb;
  border: 1px solid #d4d4d8;
  -webkit-appearance: none;
  appearance: none;
}

#statusBackBtn:hover,
#statusCloseBtn:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
}

.status-order-row {
  margin-top: 1rem;
  text-align: center;
}

.order-label {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.order-full {
  word-break: break-all;
  display: block;
  background: #f4f4f5;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.75rem;
  color: #4b5563;
}

.order-link {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.order-link:hover {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary);
}

.pill-btn.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.secondary-btn,
.pill-btn.secondary {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: var(--text);
}

.close-btn.secondary {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  background: rgba(0, 0, 0, 0.05);
}

.dev-actions {
  margin-top: 1rem;
  border-top: 1px dashed #e4e4e7;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #6b7280;
}
