
.mypage-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.mypage-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  text-align: center;
}
.mypage-stat-icon { font-size: 22px; line-height: 1; }
.mypage-stat-value {
  font-family: var(--font-num, inherit);
  font-size: 18px;
  font-weight: 800;
}
.mypage-stat-label { font-size: 11px; color: var(--muted); }

.mypage-guest-warn {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 2px solid var(--acc);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.6;
}
.mypage-guest-warn a { color: var(--acc); font-weight: 700; }

.mypage-switch {
  display: flex;
  gap: 4px;
  max-width: 320px;
  margin: 0 auto 20px;
  padding: 4px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.mypage-switch-item {
  flex: 1;
  padding: 9px 8px;
  border-radius: var(--r);
  font: 700 14px/1 var(--font);
  color: var(--muted);
  text-align: center;
  text-decoration: none;
}
.mypage-switch-item.is-on {
  background: var(--acc);
  color: var(--on-acc, #fff);
}

.jar-btn { display: block; width: 100%; max-width: 280px; margin: 10px auto 0; }
.jar-btn { touch-action: none; user-select: none; -webkit-user-select: none; }
.jar-btn[hidden] { display: none; }

/*
 * 瓶のボタン。もともと inline で #ffffff を直に書いていた。
 * 🚨 暗い配色にすると、真っ白な板が地の上で浮いて目が痛い（2026-08-30）。
 *    面と縁と文字を変数に寄せて、明るい時だけ白にする。
 */
.jar-btn--plain {
  --btn-face: #ffffff;
  --btn-lip: #d9d9d9;
  --btn-ink: #21242c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .jar-btn--plain {
    --btn-face: var(--surface);
    --btn-lip: var(--border);
    --btn-ink: var(--text);
  }
}
[data-theme="dark"] .jar-btn--plain {
  --btn-face: var(--surface);
  --btn-lip: var(--border);
  --btn-ink: var(--text);
}


.mypage-h2 { margin: 24px 0 12px; font-size: 15px; font-weight: 800; }

.mypage-empty { font-size: 14px; color: var(--muted); line-height: 1.6; }
.mypage-empty a { color: var(--acc); font-weight: 700; }

.mypage-sections {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mypage-section {
  --sc: var(--acc);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--text);
}
.mypage-section-icon { flex: none; font-size: 26px; line-height: 1; }
.mypage-section-body { flex: 1; min-width: 0; }
.mypage-section-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mypage-section-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.mypage-section-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--sc);
}
.mypage-section-count {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}


.mypage-notes[hidden] { display: none; }

.note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.note-item {
  margin-bottom: 8px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.note-item.is-open { border-color: var(--acc); }

.note-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.note-item-head:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }

.note-item-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-item-date {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}

.note-item-body { padding: 0 14px 14px; }

.note-item-area {
  display: block;
  width: 100%;
  min-height: 160px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  font: 400 15px/1.8 inherit;
  color: var(--text);
  resize: vertical;
}
.note-item-area:focus { outline: 2px solid var(--acc); outline-offset: 1px; }

.note-item-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.note-item-state {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}
.note-item-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--acc);
}
.note-item-save,
.note-item-del {
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font: 700 13px/1 inherit;
  color: var(--text);
  cursor: pointer;
}
.note-item-save { border-color: var(--acc); color: var(--acc); }
.note-item-del { color: var(--muted); }


.note-item .note-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.note-item .note-tab {
  padding: 7px 12px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--muted);
  font: 700 13px/1 inherit;
  cursor: pointer;
}
.note-item .note-tab.is-active { border-color: var(--acc); color: var(--acc); }
.note-item .note-panel[hidden] { display: none; }

.note-item .note-mini-btn {
  padding: 7px 12px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--text);
  font: 700 13px/1 inherit;
  cursor: pointer;
}
.note-item .note-mini-btn.is-active { border-color: var(--acc); color: var(--acc); }

.note-item .note-draw { display: flex; flex-direction: column; gap: 10px; }
.note-item .note-draw-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.note-item .note-draw-group { display: flex; gap: 4px; }
.note-item .note-draw-canvas-wrap {
  height: 220px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.note-item .note-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.note-item .note-table { display: flex; flex-direction: column; gap: 10px; }
.note-item .note-table-scroll {
  max-height: 260px;
  overflow: auto;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.note-item .note-table-grid { border-collapse: collapse; width: 100%; }
.note-item .note-table-grid td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  min-width: 72px;
  font-size: 16px;          
  color: var(--text);
}
.note-item .note-table-grid td:focus {
  outline: 2px solid var(--acc);
  outline-offset: -2px;
  background: var(--bg);
}
.note-item .note-table-tools { display: flex; flex-wrap: wrap; gap: 6px; }


.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.mode-card[data-mode="strict"],
.mode-card[data-tone="adult"] { border-color: var(--acc); }

.mode-card-body {
  flex: 1;
  min-width: 0;
}
.mode-card-name {
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.mode-card-note {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.mode-card-btn {
  flex: none;
  padding: 9px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  font: 700 13px/1 inherit;
  color: var(--text);
  cursor: pointer;
}
.mode-card-btn:disabled { opacity: .5; cursor: default; }
