:root {
  --bg: #f4f4f6;
  --text: #1a1a2e;
  --text-muted: #666;
  --border: rgba(0,0,0,0.1);
  --card-bg: #ffffff;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --nav-bg: #ffffff;
  --nav-border: rgba(0,0,0,0.08);
  --input-bg: #f0f0f2;
  --input-border: rgba(0,0,0,0.15);
  --link: #5b6af0;
  --btn: #5b6af0;
}
[data-theme="dark"] {
  --bg: #111318;
  --text: #e8e8f0;
  --text-muted: #888;
  --border: rgba(255,255,255,0.08);
  --card-bg: #1e2130;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --nav-bg: #15171f;
  --nav-border: rgba(255,255,255,0.07);
  --input-bg: #252836;
  --input-border: rgba(255,255,255,0.12);
  --link: #7c8fff;
  --btn: #5b6af0;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #111318;
    --text: #e8e8f0;
    --text-muted: #888;
    --border: rgba(255,255,255,0.08);
    --card-bg: #1e2130;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
    --nav-bg: #15171f;
    --nav-border: rgba(255,255,255,0.07);
    --input-bg: #252836;
    --input-border: rgba(255,255,255,0.12);
    --link: #7c8fff;
    --btn: #5b6af0;
  }
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* ドロワー（デフォルトで非表示） */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  transition: left 0.25s ease;
  z-index: 200;
  padding: 1.5rem 1.2rem;
}
.drawer.open { left: 0; }
.drawer h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.drawer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  opacity: 0.85;
}
.drawer a:hover { background: var(--border); opacity: 1; }
/* ナビバー */
.topbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 300;
  flex-shrink: 0;
}
.topbar img.logo {
  height: 32px;
  width: auto;
  display: block;
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0.6;
  flex-shrink: 0;
}
.hamburger:hover { opacity: 1; }
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
/* メインコンテンツ：2カラム横並び */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 2rem;
}
.info-panel {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.85;
  text-align: left;
}
.info-panel h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.info-panel p { margin-bottom: 1rem; }
.info-panel p:last-child { margin-bottom: 0; }
.info-panel a { color: var(--link); text-decoration: none; }
.form-panel {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.form-panel h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}
#groupform {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#groupform input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
#groupform input[type="text"]:focus {
  border-color: var(--link);
}
#groupform input[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  border-radius: 10px;
  border: none;
  background: var(--btn);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
#groupform input[type="submit"]:hover { opacity: 0.85; }
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}
#errormessage {
  color: #f87171;
  font-size: 0.85rem;
  min-height: 1em;
}
/* (No groups found.) を非表示 */
#public-groups { display: none !important; }
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  opacity: 0.6;
}
footer a { color: inherit; }
@media (max-width: 640px) {
  .main-content {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }
}
#public-groups { display: none !important; }
.theme-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  color: var(--text);
  background: none;
  border: none;
  font-size: 0.9rem;
  border-radius: 6px;
  opacity: 0.75;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.theme-btn:hover { background: var(--border); opacity: 1; }
.theme-btn.active { opacity: 1; font-weight: 600; }
[data-theme="light"] {
  --bg: #f4f4f6;
  --text: #1a1a2e;
  --text-muted: #666;
  --border: rgba(0,0,0,0.1);
  --card-bg: #ffffff;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --nav-bg: #ffffff;
  --nav-border: rgba(0,0,0,0.08);
  --input-bg: #f0f0f2;
  --input-border: rgba(0,0,0,0.15);
  --link: #5b6af0;
  --btn: #5b6af0;
}
