:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273549;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px;
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

.brand {
  text-align: center;
  margin-bottom: 20px;
}

.brand h1 {
  margin: 8px 0 4px;
  font-size: 1.5rem;
}

.brand-badge {
  display: inline-block;
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

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

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

input, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

input:focus, select:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-lg { padding: 12px 16px; font-size: 1rem; }
.btn-sm { padding: 6px 10px; font-size: 0.82rem; }

.btn-primary {
  background: var(--primary);
  color: #052e16;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #334155; }

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.3); }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--primary);
}

.info-box {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin: 0;
}

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

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.pill-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
}

.badge-owner { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-manager { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-participant { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.nav-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-tabs-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.nav-btn.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.row-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-form input {
  flex: 1;
  min-width: 160px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.invite-highlight {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 10px;
  padding: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.account-id-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: 10px;
  font-size: 1.2rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.toast.error {
  border-color: var(--danger);
  background: #450a0a;
}

.collapsible {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.collapsible summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

.collapsible[open] summary {
  margin-bottom: 10px;
}
