:root {
  --vvh:100vh;
  --vh-fixed:100vh;
  --modal-a-offset: 30px;
  --modal-b-offset: 30px;
  --base-bg: #e9f6f1;
  --primary: #28a398;
  --accent: #38bdf8;
  --text: #166b5f;
  --muted: #e0f2ef;
  --card-bg: #fff;
}

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

.icon-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}
.icon-preview img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #eee;
}
.logo-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 200px;
  border: none;
  border-radius: 0;
}
.og-preview img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #eee;
}

/* 占いカード用プレビュー（5:7） */
.card-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
  width: 225px;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  aspect-ratio: 5 / 7;
}
.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #eee;
}

.file-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 18px 0 6px;
  width: 100%;
}
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  min-height: 52px;
  padding: 14px 18px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid #c9c9c9;
  background: #f7f7f7;
  color: #444;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
  box-sizing: border-box;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
  overflow: hidden;
}
.file-btn__text {
  display: block;
  width: 100%;
  text-align: center;
}
.file-btn:hover {
  background: #f1f1f1;
  border-color: #bdbdbd;
  transform: translateY(-1px);
}
.file-name {
  display: block;
  margin-top: 0;
  font-size: 12px;
  color: #666;
  text-align: center;
  white-space: nowrap;
  height: 0;
  overflow: hidden;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "M PLUS 1", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  background: var(--base-bg);
  color: var(--text);
  height: 100%;
}
html { height: 100%; }

.login-page {
  overflow-y: auto;
  overflow-x: hidden;
}
.login-page .app-wrap { min-height: var(--vh-fixed); }
.login-page .login-app {
  padding: 24px 12px;
  justify-content: flex-start;
  padding-top: 170px;
  padding-bottom: 120px;
}

.login-card {
  width: 99%;
  max-width: 99%;
  min-width: 320px;
  background: var(--card-bg);
  border-radius: 22px;
  padding: 40px 40px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 767px) {
 .login-page .login-app {
  padding-top: 50px;
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 80px;
} 
  .login-app {
    padding-left: 4px;
    padding-right: 4px;
    gap: 12px;
  }
  .login-card {
    width: 100%;
    max-width: 100%;
    min-width: 320px;
    padding: 20px 20px 20px;
  }
  .app-wrap {
    max-width: 100%;
    padding-left: 2px;
    padding-right: 2px;
  }
  input,
  select,
  textarea {
    font-size: 13px;
  }
}

.app-wrap {
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
  padding-left: 8px;
  padding-right: 8px;
}

@media (min-width: 768px) {
  .app-wrap--narrow {
    max-width: 600px;
  }
}

.login-app {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 12px;
  gap: 16px;
  min-height: var(--vh-fixed);
}

.logout-link {
  text-align: right;
  padding: 0 12px;
  margin-top: 4px;
}

.logout-link a {
  color: #0f5132;
  text-decoration: underline;
  font-weight: 600;
}

.btn-wrap {
  text-align: center;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  min-width: 220px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.header {
  text-align: center;
  padding: 36px 0 16px;
  font-weight: 600;
  font-size: 1.7em;
}

.global-head {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2px 0 4px;
  background: color-mix(in srgb, var(--card-bg) 92%, #fff 8%);
  border-radius: 0;
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  z-index: 9000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.global-logo {
  width: 120px;
  height: auto;
  display: block;
}
.global-burger {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 36px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.global-preview-btn {
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f9b233;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(249, 178, 51, 0.35);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 2px;
}
.global-preview-btn:hover {
  background: #e53935;
  box-shadow: 0 6px 14px rgba(229, 57, 53, 0.35);
}
.preview-btn-mobile {
  display: none;
}
@media (max-width: 767px) {
  .preview-btn-desktop { display: none; }
  .preview-btn-mobile {
    display: inline-flex;
    left: 46px;
    font-size: 10px;
  }
}
.global-user {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.global-user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 5px;
}
.global-user-role {
  display: block;
  font-size: 9px;
  color: color-mix(in srgb, var(--text) 70%, #7f8c8d);
  margin-top: -1px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 3px;
}
.global-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: color-mix(in srgb, var(--text) 80%, #555);
  border-radius: 2px;
  transition: transform .25s ease;
}
.global-burger:hover {
  transform: translateY(-50%) scale(1.05);
  opacity: 0.9;
}
.global-menu {
  position: fixed;
  left: 12px;
  top: 54px;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0,0,0,0.08);
  padding: 8px 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9050;
}
.global-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.global-menu a {
  display: block;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.global-menu a:hover {
  background: #f5f7f9;
}
.global-foot {
  position: static;
  margin: 16px auto 24px;
  text-align: center;
  font-size: 9px;
  color: #9a9a9a;
  background: transparent;
}

.card {
  background: #fff;
  margin: 12px;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.label {
  color: #888;
  font-size: 12px;
}

.value {
  font-weight: 500;
}

.card.alert { background:#ffecec; color:#b30000; border:1px solid #ffb3b3; }
.card.success { background:#e6f7f3; color:#0f5132; border:1px solid #9be0c7; }
.card.disabled { cursor: default; opacity: .8; }
.card.ore {
  background-image: linear-gradient(89deg, rgba(255,142,0,1.00) 0%, rgba(255,63,0,1.00) 100%);
  color: #fff;
}

.small { color:#888; font-size:12px; margin:12px 12px 0; }
.list-wrap { margin: 12px; background:var(--card-bg); border-radius:16px; padding:12px; }
.list-wrap table { width:100%; border-collapse: collapse; font-size:14px; }
.list-wrap th, .list-wrap td { padding:8px; border-bottom:1px solid color-mix(in srgb, var(--text) 10%, #eee); text-align:left; color: var(--text); }
.list-wrap th { background: color-mix(in srgb, var(--card-bg) 90%, #fafafa 10%); }

/* modal bg */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: .35s;
}
.modal-bg.show {
  opacity: 1;
  pointer-events: auto;
}

/* sheet */
.sheet {
  position: fixed;
  inset: 0;
  height: var(--vh-fixed);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 8px) 16px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden; /* 背景はスクロールさせず、モーダル内のみスクロール */
}
.sheet.show { pointer-events: auto; opacity: 1; }

/* modal */
.modal {
  width: 92%;
  max-width: 520px;
  background: var(--card-bg);
  border-radius: 22px;
  padding: 14px 14px 16px;
  transform: translateY(120%) scale(.98);
  transition: .7s cubic-bezier(.22, 1.4, .36, 1);
  max-height: calc(var(--vh-fixed) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet.show .modal { transform: translateY(0) scale(1); }
.modal h3 { margin-top: 0; font-size: 16px; margin-bottom: 6px; color: var(--text); }
#loginForm h3 { text-align: center; color: var(--text); }
.modal-footer { margin-top: 8px; padding-top: 8px; }

.modal.is-long {
  align-self: stretch;
  overflow: hidden;
  transform: translateY(0) scale(1);
  margin-top: calc(env(safe-area-inset-top) + var(--modal-b-offset));
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 24px 24px;
}

.modal.is-push{
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

label { display:block; margin:6px 0 10px; font-weight:600; font-size: 14px; color: var(--text); }
.req-mark {
  font-size: 9px;
  color: #d93025;
  font-weight: 700;
}
.form-control,
input,
select,
textarea,
button {
  font-family: inherit;
}
.title-label {
  border-left: 4px solid var(--primary);
  padding-left: 8px;
  display: block;
  width: 100%;
  margin-bottom: 10px;
}
.push-form .title-label {
  margin-top: 20px;
}
.push-form .title-label:first-of-type {
  margin-top: 0;
}
.push-form {
  padding-top: 10px;
}
.title-label.no-border {
  border-left: none;
  padding-left: 0;
}
input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--text) 14%, #e2e2e2);
  font-size: 14px;
  box-sizing: border-box;
  background: var(--card-bg);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow .25s ease, border-color .2s ease;
  margin-bottom: 10px;
}
input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: transparent;
  margin-bottom: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}
input:focus {
  outline: none;
  background: var(--card-bg);
  border-color: color-mix(in srgb, var(--primary) 70%, var(--text));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent),
    0 0 0 10px color-mix(in srgb, var(--primary) 15%, transparent),
    0 10px 26px color-mix(in srgb, var(--primary) 20%, transparent);
}
input[type="file"] {
  width: 100%;
}
select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--text) 14%, #e2e2e2);
  font-size: 14px;
  box-sizing: border-box;
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  transition: box-shadow .25s ease, border-color .2s ease;
  margin-bottom: 10px;
}
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 70%, var(--text));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 26%, transparent),
    0 0 0 10px color-mix(in srgb, var(--primary) 15%, transparent),
    0 10px 26px color-mix(in srgb, var(--primary) 20%, transparent);
}
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 14%, #e2e2e2);
  background: var(--card-bg);
  color: var(--text);
  font-size: 15px;
  box-sizing: border-box;
  resize: vertical;
  transition: box-shadow .25s ease, border-color .2s ease;
}
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 70%, var(--text));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--primary) 24%, transparent),
    0 0 0 16px color-mix(in srgb, var(--primary) 14%, transparent),
    0 14px 32px color-mix(in srgb, var(--primary) 22%, transparent),
    0 0 24px color-mix(in srgb, var(--primary) 10%, transparent);
  background: var(--card-bg);
}
img {
  max-width: 100%;
  height: auto;
}

/* Cropper inline */
.cropper-inline {
  display: none;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, #e5e5e5);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}
.cropper-inline.show {
  display: block;
}
.icon-block {
  width: 100%;
}

/* びよよんテキストエリア */
.elastic-textarea {
  transition: min-height .25s ease, box-shadow .25s ease, transform .35s cubic-bezier(.23,1.24,.32,1);
}
.elastic-textarea.elastic-active {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 0 0 4px rgba(40,163,152,0.20),
    0 0 0 16px rgba(40,163,152,0.12),
    0 14px 32px rgba(40,163,152,0.22),
    0 0 24px rgba(40,163,152,0.10);
}
.elastic-textarea:focus {
  box-shadow:
    0 0 0 4px rgba(40,163,152,0.20),
    0 0 0 16px rgba(40,163,152,0.12),
    0 14px 32px rgba(40,163,152,0.22),
    0 0 24px rgba(40,163,152,0.10);
}
.input-wrap {
  position: relative;
}
.input-wrap.has-counter input {
  padding-right: 56px;
}
.input-wrap .counter-note {
  position: absolute;
  right: 12px;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  color: #666;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e3e7e6;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
  transform: translateY(3px);
}
.counter-note.is-zero {
  color: #d93025;
  font-weight: 700;
}

.section-sep {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid #e5e5e5;
}

.push-list-card {
  padding: 20px 5px 14px;
}
.push-news-item {
  box-shadow: none;
  border-radius: 0;
  padding: 12px 10px;
  border-bottom: 1px solid #eaeaea;
  background: #fff;
}
.push-news-item:nth-child(even) {
  background: #f6f7f7;
}
.push-news-item.empty {
  border-radius: 8px;
  border: 1px dashed #ddd;
}
html[data-theme="black"] .push-news-item {
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #f5f5f5;
}
html[data-theme="black"] .push-news-item:nth-child(even) {
  background: rgba(0,0,0,0.5);
}
html[data-theme="black"] .push-news-item.empty {
  border-color: rgba(255,255,255,0.25);
}
html[data-theme="black"] .push-meta {
  color: #d9d9d9;
}
html[data-theme="black"] .admin-table th,
html[data-theme="black"] .admin-table td,
html[data-theme="black"] .admin-table .dt-cell,
html[data-theme="black"] .admin-table .dt-date {
  color: #fff;
}
.push-meta {
  font-size: 9px;
  color: #8a8a8a;
}
.badge-on, .badge-off {
  font-weight: 700;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
}
.badge-on {
  color: #0f5132;
  background: #d1f2df;
}
.badge-off {
  color: #f7f7f7;
  background: #2c2c2c;
}

/* ランキング */
.ranking-item {
  align-items: flex-start;
  gap: 10px;
}
.ranking-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  color: #663c00;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(255,159,28,0.25);
  flex-shrink: 0;
}
.rank-stats {
  color: #e85a8c;
  font-weight: 700;
}
.sort-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 14px;
}
.sort-tabs a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  color: #555;
  font-size: 12px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.sort-tabs a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(40,163,152,0.22);
}
html[data-theme="black"] .sort-tabs a.active {
  background: #3aa0ff;
  border-color: #3aa0ff;
  box-shadow: 0 6px 14px rgba(58,160,255,0.26);
  color: #fff;
}
.pager a {
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  text-decoration: none;
  color: #333;
  text-align: center;
  display: inline-block;
}
.pager a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pager a.disabled {
  pointer-events: none;
  opacity: 0.4;
}
.cropper-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
}
.cropper-frame img {
  max-width: 100%;
  display: block;
}
.cropper-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.cropper-actions .cancel-btn {
  min-width: 96px;
}
.cropper-actions .save-btn {
  min-width: 120px;
}
#loginForm { display:flex; flex-direction:column; gap:6px; margin: 2px 0 10px; }

.save-btn{
  width: 100%;
  padding: 14px;
  border-radius: 6px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  transition: background-color .18s ease, transform .14s ease, box-shadow .18s ease;
}
.save-btn:hover{
  background: color-mix(in srgb, var(--primary) 82%, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}
.save-btn:active{
  transform: translateY(-1px);
}

.modal-footer {
  margin-top: 10px;
  padding-top: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.btn {
  margin-top: 20px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 14px;
  border-radius: 14px;
  font-weight: 600;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #e5e5e5;
}
html[data-theme="black"] .news-item {
  background: rgba(0,0,0,0.5);
  color: #f5f5f5;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
html[data-theme="black"] .news-title {
  color: #f5f5f5;
}
.news-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}
.card-thumb {
  width: 70px;
  aspect-ratio: 5 / 7;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.input-compact {
  width: 110px;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 8px;
}
.news-body { flex: 1; min-width: 0; }
.news-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 7px;
  line-clamp: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-actions { display: flex; flex-direction: column; gap: 6px; }
.news-actions button {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
}
.edit { background: var(--muted); color: var(--primary); }

html[data-theme="black"] {
  color: #f2f2f2;
}
html[data-theme="black"] body {
  color: #f2f2f2;
}
html[data-theme="black"] .global-head {
  background: #0f0f0f;
  box-shadow: 0 8px 18px rgba(0,0,0,0.5);
}
html[data-theme="black"] .global-burger span {
  background: #f2f2f2;
}
html[data-theme="black"] .global-user-name,
html[data-theme="black"] .global-user-role {
  color: #f2f2f2;
}
html[data-theme="black"] .login-card,
html[data-theme="black"] .list-wrap,
html[data-theme="black"] .modal,
html[data-theme="black"] .file-btn,
html[data-theme="black"] .cropper-inline {
  background: #111;
  color: #f2f2f2;
  border-color: #2f2f2f;
}
html[data-theme="black"] .list-wrap th {
  background: #0b0b0b;
  color: #f2f2f2;
}
html[data-theme="black"] .list-wrap td {
  color: #f2f2f2;
}
html[data-theme="black"] a {
  color: var(--accent);
}
html[data-theme="black"] .save-btn,
html[data-theme="black"] .new-btn,
html[data-theme="black"] .btn {
  background: #3aa0ff;
  color: #fff;
  box-shadow: 0 10px 22px rgba(58,160,255,0.28);
  border-color: #3aa0ff;
}
html[data-theme="black"] .save-btn:hover,
html[data-theme="black"] .new-btn:hover,
html[data-theme="black"] .btn:hover {
  background: #65b5ff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(58,160,255,0.32);
}
html[data-theme="black"] .save-btn:active,
html[data-theme="black"] .new-btn:active,
html[data-theme="black"] .btn:active {
  transform: translateY(-1px);
}
html[data-theme="black"] .edit {
  background: #3aa0ff;
  color: #fff;
  box-shadow: 0 8px 18px rgba(58,160,255,0.26);
}
html[data-theme="black"] .card {
  background: rgba(0,0,0,0.5);
  color: #f5f5f5;
  border: 1px solid rgba(255,255,255,0.08);
}
html[data-theme="black"] .progress-card {
  background: transparent;
  color: #f5f5f5;
  border-radius: 18px;
  padding: 16px;
  border: none;
}
html[data-theme="black"] .progress-card .ring-track {
  stroke: rgba(255,255,255,0.18);
}
html[data-theme="black"] .progress-card .ring-bar {
  stroke: #3aa0ff;
}
html[data-theme="black"] .progress-card .ring-level-label,
html[data-theme="black"] .progress-card .ring-subtext,
html[data-theme="black"] .progress-card .progress-caption,
html[data-theme="black"] .progress-card .stat-label {
  color: rgba(255,255,255,0.7);
}
html[data-theme="black"] .progress-card .ring-level-value,
html[data-theme="black"] .progress-card .ring-points,
html[data-theme="black"] .progress-card .stat-value {
  color: #f5f5f5;
}
html[data-theme="black"] .progress-card .stat-value {
  font-size: clamp(18px, 3.2vw, 26px);
}
html[data-theme="black"] .progress-card .progress-stats {
  border-top: 1px solid rgba(255,255,255,0.12);
}
html[data-theme="black"] .progress-card .progress-stat:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.12);
}
html[data-theme="black"] .progress-openrate .rate-value,
html[data-theme="black"] .progress-openrate .rate-unit {
  color: #fff;
}
html[data-theme="black"] #statOpenRate {
  color: #fff;
}
html[data-theme="black"] .progress-divider {
  background: rgba(255,255,255,0.12);
}
html[data-theme="black"] .mini-analytics-btn {
  background: rgba(58, 160, 255, 0.15);
  border-color: rgba(58, 160, 255, 0.35);
  color: #f5f5f5;
}
html[data-theme="black"] .detail-snapshot {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.12);
}
html[data-theme="black"] .detail-label {
  color: rgba(255,255,255,0.7);
}
html[data-theme="black"] .detail-value {
  color: #f5f5f5;
}
html[data-theme="black"] .detail-action {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #f5f5f5;
}
html[data-theme="black"] .icon-help-trigger,
html[data-theme="black"] .icon-help-trigger i {
  color: #f5f5f5;
}
html[data-theme="black"] .icon-help-panel {
  color: #f5f5f5;
}
html[data-theme="black"] .icon-help-panel.show {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #f5f5f5;
}
html[data-theme="black"] .analytics-card {
  background: rgba(0,0,0,0.55);
  border-color: rgba(255,255,255,0.12);
  box-shadow: none;
}
html[data-theme="black"] .file-btn {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
html[data-theme="black"] .analytics-title {
  color: #f5f5f5;
}
html[data-theme="black"] .analytics-meta {
  color: rgba(255,255,255,0.7);
}
html[data-theme="black"] .analytics-card .stat-label {
  color: rgba(255,255,255,0.7);
}
html[data-theme="black"] .analytics-card .stat-value {
  color: #f5f5f5;
}
html[data-theme="black"] .analytics-topstats .topstat:not(:last-child)::after {
  background: rgba(255,255,255,0.14);
}
html[data-theme="black"] .range-divider {
  background: rgba(255,255,255,0.12);
}
html[data-theme="black"] .trend-dot {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}
html[data-theme="black"] .analytics-quicklinks .card {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.12);
}
html[data-theme="black"] .range-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #f5f5f5;
}
html[data-theme="black"] .range-btn.is-active {
  background: #3aa0ff;
  border-color: #3aa0ff;
}
html[data-theme="black"] .trend-grid line {
  stroke: rgba(255,255,255,0.12);
}
html[data-theme="black"] .analytics-link {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: #f5f5f5;
}
html[data-theme="black"] .dashboard-blank {
  background: transparent;
  box-shadow: none;
}
.delete { background: #fdeaea; color: #d93025; }

.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 30px;
}
.pager button {
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}
.pager .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.textarea-wrap{
  position: relative;
  padding-bottom: 60vh;
  padding-bottom: calc(60vh + env(safe-area-inset-bottom));
}
textarea{
  width: 100%;
  min-height: 140px;
  font-size: 14px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #e2e2e2;
  box-sizing: border-box;
  transition: box-shadow .25s ease, border-color .2s ease;
  margin-bottom: 10px;
}
#pushText{
  transition: min-height .35s ease;
}

.firework {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  pointer-events: none;
  animation: fw 2.2s cubic-bezier(.18, .9, .25, 1) forwards;
}
.pop-firework {
  z-index: 9895;
}
@keyframes fw {
  from { transform:translate(-50%, -50%); opacity:1; }
  to { transform:translate(calc(-50% + var(--x)), calc(-50% + var(--y))); opacity:0; }
}
.complete-msg {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 600;
  z-index: 9999;
}
.ore {
  background-image: linear-gradient(89deg, rgba(255,142,0,1.00) 0%, rgba(255,63,0,1.00) 100%);
  color: hsla(0,0%,100%,1.00);
}
.modal.keyboard-open #modalContent{
  padding-bottom: 50vh;
}

/* ポップアップ（更新完了） */
.pop-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #ffffff;
  color: var(--primary);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.14);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  z-index: 9900;
  opacity: 0;
  animation:
    popToast 600ms cubic-bezier(.3, 1.15, .4, 1) forwards,
    popFrame 620ms ease-out forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: opacity .35s ease, transform .35s ease;
}
.pop-dim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9890;
  opacity: 0;
  animation: popDim 900ms ease forwards;
  pointer-events: none;
  transition: opacity .45s ease;
}
@keyframes popDim {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.pop-icon {
  font-size: 44px;
  line-height: 1;
  color: var(--primary);
  animation: popSquish 650ms ease-out;
  transform-origin: center;
}
.pop-text {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  animation: popWobble 680ms ease-out 30ms;
  transform-origin: center;
}
@keyframes popToast {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  30%  { transform: translate(-50%, -50%) scale(0.88); }
  45%  { transform: translate(-50%, -50%) scale(1.12); }
  60%  { transform: translate(-50%, -50%) scale(0.96); }
  75%  { transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes popFrame {
  0%   { border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,0.18); }
  25%  { border-radius: 18px; box-shadow: 0 22px 44px rgba(0,0,0,0.16); }
  50%  { border-radius: 14px; box-shadow: 0 16px 36px rgba(0,0,0,0.14); }
  75%  { border-radius: 16px; box-shadow: 0 20px 42px rgba(0,0,0,0.15); }
  100% { border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,0.14); }
}
@keyframes popSquish {
  0%   { transform: scale(0.8) rotate(0deg); }
  25%  { transform: scale(1.15, 0.85) rotate(-2deg); }
  45%  { transform: scale(0.9, 1.1) rotate(2deg); }
  65%  { transform: scale(1.08, 0.94) rotate(-1deg); }
  85%  { transform: scale(0.98, 1.02) rotate(0.6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes popWobble {
  0%   { transform: scale(0.9) translateY(2px); }
  25%  { transform: scale(1.08, 0.9) translateY(-2px); }
  50%  { transform: scale(0.95, 1.05) translateY(1px); }
  75%  { transform: scale(1.03, 0.97) translateY(-1px); }
  100% { transform: scale(1) translateY(0); }
}
.pop-bubble {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.18;
  z-index: 9895;
  animation: popBubble 900ms ease-out forwards;
}
@keyframes popBubble {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.35; }
  50% { opacity: 0.28; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.25); opacity: 0; }
}

/* =========================================================
   共通UI（管理系）
========================================================= */
.back-link { text-align:center; margin-bottom:10px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px 8px;
  font-size: 13px;
  color: #fff;
  background: #c3c3c3;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.back-btn:hover {
  background: #ededed;
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.back-link-bottom {
  width: 100%;
  text-align: center;
  margin-top: 20px;
}

.actions {
  display: flex;
  gap: 6px;
  flex-direction: column;
  align-items: flex-start;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap;
}
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.06);
}
.action-edit {
  background: linear-gradient(135deg, #f5fbff, #e2f1ff);
  border-color: #c8e0ff;
  color: #1d6fd1;
}
.action-delete {
  background: linear-gradient(135deg, #fff6f6, #ffe9e9);
  border-color: #f5c4c4;
  color: #d14646;
}
.action-delete:hover { background: #ffe8e8; }
.action-edit:hover { background: #dcedff; }

.new-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 26px;
}
.new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9f1c, #ff6f00);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(255,111,0,0.18);
  border: 1px solid rgba(255,111,0,0.22);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(255,111,0,0.22);
  filter: brightness(1.02);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  padding: 7px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.admin-table th {
  background: #fafafa;
  font-size: 12.5px;
  color: #222;
}
.admin-table td {
  font-size: 12px;
  color: #555;
}
.admin-table td:first-child {
  font-weight: 700;
  color: #222;
}
.dt-cell {
  text-align: left;
  line-height: 1.3;
  padding-top: 6px;
  white-space: nowrap;
  font-size: 11px;
  color: #666;
}
.dt-date {
  font-size: 7px;
  color: #666;
}

.field-note {
  display: none;
  font-size: 11px;
  color: #8a8a8a;
  margin: -2px 0 6px;
}
.field-note.keep {
  display: block;
}
.field-hint {
  width: 100%;
  max-width: 100%;
  max-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(1);
  padding: 0 14px;
  margin: 0;
  box-sizing: border-box;
  background: #f4faf8;
  border: 1px solid rgba(40,163,152,0.18);
  border-radius: 12px;
  color: #4f706b;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  transition:
    max-height .35s cubic-bezier(.25,1.5,.35,1),
    opacity .32s ease,
    transform .35s cubic-bezier(.25,1.2,.35,1),
    padding .35s ease,
    margin .35s ease;
}
.field-hint.show {
  max-height: 300px;
  opacity: 1;
  transform: translateY(0) scale(1);
  padding: 10px 14px;
  margin: 15px 0 2px;
}
.backup-upload-form .field-hint {
  display: none !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.field-spacer { height: 5px; }
.role-hint {
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: #f8f9fb;
  border: 1px solid #e6e8ed;
  border-radius: 10px;
  color: #666;
  font-size: 11px;
  line-height: 1.5;
}

/* カードのふわっと演出 */
#cardShell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  filter: blur(1px);
  transform-origin: 50% 45%;
}
#cardShell.is-entered {
  animation: shellFloat 360ms cubic-bezier(.2, .9, .26, 1.12) forwards;
}
#cardShell.is-entered .login-card {
  animation: cardSquish 420ms cubic-bezier(.3, 1.05, .45, 1) forwards;
}
#cardShell.is-entered .login-card > * {
  animation: cardContentWobble 460ms ease-out forwards;
  transform-origin: center;
}
@keyframes shellFloat {
  0%   { opacity: 0; transform: translateY(18px) scale(0.985) rotate(-0.08deg); filter: blur(1px); }
  52%  { opacity: 1; transform: translateY(-4px) scale(1.012) rotate(-0.28deg); filter: blur(0.25px); }
  76%  { transform: translateY(2px) scale(0.998) rotate(-0.12deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); filter: blur(0); }
}
#cardShell::after {
  content: "";
  position: absolute;
  inset: -12px -8px 18px -8px;
  border-radius: 28px;
  background:
    radial-gradient(140% 100% at 50% 50%, rgba(40,163,152,.18), rgba(40,163,152,0)),
    radial-gradient(120% 80% at 50% 100%, rgba(0,0,0,.08), rgba(0,0,0,0));
  filter: blur(12px);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  z-index: 0;
}
#cardShell.is-entered::after {
  animation: smoke 820ms cubic-bezier(.25, .8, .32, 1) 90ms forwards;
}
@keyframes smoke {
  0%   { opacity: 0; transform: translateY(14px) scale(.98); }
  32%  { opacity: .52; transform: translateY(4px) scale(1.01); }
  68%  { opacity: .18; transform: translateY(-6px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-12px) scale(1.08); }
}
@keyframes cardSquish {
  0%   { transform: scale(0.96); }
  16%  { transform: scale(1.04, 0.96); }
  34%  { transform: scale(0.97, 1.02); }
  56%  { transform: scale(1.015, 0.985); }
  78%  { transform: scale(0.995, 1.005); }
  100% { transform: scale(1); }
}
@keyframes cardContentWobble {
  0%   { transform: scale(0.97) translateY(1px); opacity: 0; }
  20%  { transform: scale(1.04, 0.96) translateY(-1px); opacity: 1; }
  40%  { transform: scale(0.985, 1.015) translateY(0.5px); }
  60%  { transform: scale(1.01, 0.99); }
  80%  { transform: scale(0.995, 1.005); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* switch */
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  display: inline-block;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 30px;
  transition: .3s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}
.switch input:checked + .slider {
  background: #4cd964;
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* PC向け調整 */
@media (min-width: 960px) {
  .login-page .login-app {
    padding-top: 40px;
    padding-bottom: 80px;
  }
  .modal {
    width: 60%;
    max-width: 360px;
  }
  .modal h3 { font-size: 18px; }
  label { font-size: 15px; }
  input { font-size: 13px; padding: 14px 18px; }
  #loginForm { gap: 16px; }
  .save-btn { font-size: 15px; }
  .remember-row { gap: 8px; }
  .login-card {
    width: 600px;
    min-width: 600px;
    max-width: 600px;
  }

  .new-btn {
    padding: 8px 26px 10px 22px;
    font-size: 15px;
  }
  .admin-table {
    font-size: 14px;
  }
  .admin-table th {
    font-size: 13px;
  }
  .admin-table td {
    font-size: 13px;
    color: #444;
  }
  .dt-cell {
    text-align: left;
    line-height: 1.4;
    font-size: 12px;
    color: #555;
  }
  .dt-date {
    font-size: 8px;
    color: #555;
  }

  .field-note {
    font-size: 12px;
  }

  .login-card {
    width: 600px;
    min-width: 600px;
    max-width: 600px;
  }
}

.remember-row {
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:4px;
  padding-top:4px;
}

/* エフェクト層 */
#fxLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
#fxLayer.active { opacity: 1; }
.fx-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: burst 0.7s ease-out forwards;
}
@keyframes burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.3); }
}

/* ダッシュボード余白 & カードアニメ */
.dashboard-space {
  height: 50px;
}
.dashboard-blank {
  min-height: 320px;
  margin-bottom: 20px;
  margin-top: 15px;
  border-radius: 16px;
  background: #f7f9f8;
  border: none;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 20px;
}
.jump-card-ready {
  opacity: 0;
  transform: translateY(-18px);
}
.jump-card-show {
  animation: jumpIn 0.5s ease-out forwards;
}
.jump-card {
  transform-origin: center;
  transition: transform 0.12s ease-out, background-color 0.2s ease, box-shadow 0.2s ease;
}
.jump-card .label,
.jump-card .label_ore {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.jump-card .value {
  color: #666;
  font-size: 13px;
  font-weight: 400;
}
.jump-card.ore .label_ore,
.jump-card.ore .value {
  color: #fff;
}
.jump-card:hover {
  background: #f0fbff;
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.15);
}
.jump-card.alert-hover:hover {
  background: #e53935;
  box-shadow: 0 10px 22px rgba(229, 57, 53, 0.25);
}
.jump-card.alert-hover:hover .label,
.jump-card.alert-hover:hover .label_ore,
.jump-card.alert-hover:hover .value {
  color: #fff;
}
.jump-card.poyo {
  animation: poyo 0.42s cubic-bezier(0.25, 1.4, 0.3, 1);
}
.jump-card.jump-press {
  transform: scale(1.03);
}
@keyframes jumpIn {
  0%   { opacity:0; transform: translateY(-20px); }
  60%  { opacity:1; transform: translateY(8px); }
  100% { opacity:1; transform: translateY(0); }
}
@keyframes poyo {
  0%   { transform: translateY(0) scale(1); }
  20%  { transform: translateY(-8px) scale(1.02, 0.98); }
  45%  { transform: translateY(4px) scale(0.96, 1.04); }
  70%  { transform: translateY(-3px) scale(1.01, 0.99); }
  100% { transform: translateY(0) scale(1); }
}
.jump-card-show .label,
.jump-card-show .label_ore,
.jump-card-show .value {
  transform-origin: center;
  animation: textSquish 0.45s ease-out forwards;
}
@keyframes textSquish {
  0%   { transform: scale(0.9, 1.1); }
  40%  { transform: scale(1.12, 0.9); }
  70%  { transform: scale(0.96, 1.04); }
  100% { transform: scale(1, 1); }
}

.progress-card {
  width: min(520px, 100%);
  text-align: center;
  color: #4b2e2e;
  margin-top: 15px;
}
.max_box {
  width: 100%;
  max-width: none;
  margin: 0 auto 20px;
  padding: 16px 18px;
  background: #fff;
  border: none;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  color: #333;
  text-align: center;
}
.max_box h2 {
  margin: 0 0 8px;
  font-size: 1.5em;
  color: #ff4f9f;
}
.max_box p {
  margin: 0;
  line-height: 1.4;
  font-size: 0.8em;
  color: #777;
  text-align: left;
}
html[data-theme="black"] .max_box {
  background: #111;
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #f5f5f5;
}
html[data-theme="black"] .max_box h2 {
  color: #ff4f9f;
}
html[data-theme="black"] .max_box p {
  color: #f5f5f5;
}
.progress-title {
  font-size: 18px;
  margin-bottom: 12px;
}
.ring-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
}
.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: #e8e8e8;
  stroke-width: 12;
  stroke-linecap: round;
}
.ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 0 999;
  stroke-dashoffset: 0;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  gap: 2px;
}
.ring-center > * {
  margin: 0;
  line-height: 1;
}
.ring-level-label {
  font-size: 12px;
  letter-spacing: 1px;
  color: #777;
}
.ring-level-value {
  font-size: 42px;
  font-weight: 700;
  color: #4b2e2e;
  line-height: 1.1;
}
.ring-subtext {
  font-size: 12px;
  color: #888;
}
.ring-points {
  font-size: 22px;
  font-weight: 700;
  color: #4b2e2e;
}
.progress-caption {
  margin-top: 14px;
  font-size: 13px;
  color: #555;
  min-height: 22px;
}
.caption-number {
  font-weight: 700;
  color: var(--primary);
}
html[data-theme="black"] .caption-number {
  color: #fff;
}
.progress-stats {
  display: flex;
  gap: 0;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}
.progress-stats-col {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 0 8px;
}
.progress-stats-col:not(:last-child) {
  border-right: 1px solid #e6e6e6;
}
.progress-stat {
  text-align: center;
  min-width: 0;
}
.stat-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.stat-value {
  font-size: clamp(18px, 3.2vw, 26px);
  font-weight: 700;
  color: #4b2e2e;
  white-space: nowrap;
}
.progress-debug {
  margin-top: 12px;
  font-size: 11px;
  color: #246c55;
  text-align: center;
  letter-spacing: 0.05em;
}
.progress-openrate {
  margin-top: 10px;
  text-align: center;
}
.progress-openrate .rate-value {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  color: #4b2e2e;
  line-height: 1;
}
.progress-openrate .rate-unit {
  font-size: 14px;
  margin-left: 4px;
  color: #666;
}
.progress-openrate .rate-note {
  margin-top: 19px;
  font-size: 13px;
  color: #666;
}
.progress-openrate .rate-actions {
  margin-top: 8px;
}
.mini-analytics-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dfe7ec;
  background: #f0fbff;
  color: #246c55;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.mini-analytics-btn:hover {
  background: #e6f5ff;
  border-color: #cfe6f4;
  color: #1d5c4b;
}
.mini-analytics-btn i {
  font-size: 14px;
}
.progress-divider {
  width: 100%;
  height: 1px;
  background: #eee;
  margin-top: 14px;
}
.detail-snapshot {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #eee;
  background: #fff;
}
.detail-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.detail-stat {
  text-align: center;
  min-width: 0;
}
.detail-label {
  font-size: 12px;
  color: #666;
}
.detail-value {
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: #4b2e2e;
  white-space: nowrap;
}
.detail-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.detail-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e6eef2;
  background: #f7f9fb;
  color: #1d3b37;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 0;
}
.detail-action i {
  font-size: 16px;
}
.icon-help-trigger {
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.icon-help-trigger.title-label {
  border-left: 4px solid var(--primary);
  padding-left: 8px;
  justify-content: flex-start;
  text-align: left;
}
.icon-help-trigger i {
  font-size: 14px;
}
.icon-help-panel {
  max-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #4f706b;
  padding: 0 14px;
  transition:
    max-height .35s cubic-bezier(.25,1.5,.35,1),
    opacity .32s ease,
    transform .35s cubic-bezier(.25,1.2,.35,1),
    padding .35s ease,
    margin .35s ease;
  margin: 5px 0 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(8px);
}
.icon-help-panel.show {
  max-height: 300px;
  padding: 10px 14px;
  margin: 15px 0 2px;
  opacity: 1;
  transform: translateY(0);
  background: #f4faf8;
  border: 1px solid rgba(40,163,152,0.18);
}
.icon-help-logo {
  margin-top: 20px;
}
.analytics-card {
  width: min(720px, 100%);
  margin: 0 auto 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid #e6eef2;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}
.analytics-topstats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 12px;
  text-align: center;
}
.analytics-topstats .topstat {
  position: relative;
  padding: 6px 4px;
  min-width: 0;
}
.analytics-topstats .topstat:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 0;
  width: 1px;
  height: 80%;
  background: #e6eef2;
}
.analytics-topstats .stat-label {
  font-size: clamp(10px, 2.6vw, 12px);
  color: #666;
  margin-bottom: 6px;
  white-space: nowrap;
}
.analytics-topstats .stat-value {
  font-size: clamp(16px, 4.2vw, 26px);
  font-weight: 700;
  color: #4b2e2e;
  white-space: nowrap;
}
.analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.analytics-title {
  font-size: 16px;
  font-weight: 700;
  color: #2b3b39;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.analytics-meta {
  font-size: 12px;
  color: #74807c;
}
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  padding: 10px 0 4px;
}
.analytics-stat {
  text-align: center;
}
.analytics-range {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  margin: 8px 0 12px;
  padding: 2px 12px 4px;
  scroll-padding-left: 12px;
  scroll-padding-right: 12px;
}
.analytics-range::-webkit-scrollbar {
  display: none;
}
.range-btn {
  border: 1px solid #dfe7ec;
  background: #f6f8f9;
  color: #35504b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  scroll-snap-align: center;
  white-space: nowrap;
}
.range-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.range-divider {
  width: 100%;
  height: 1px;
  background: #e6eef2;
  margin: 5px 0;
}
.analytics-chart {
  width: 100%;
}
.trend-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}
.trend-grid line {
  stroke: #e6eef2;
  stroke-width: 1;
}
.trend-line {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
  transition: stroke 0.2s ease;
}
.trend-line-pv {
  stroke: var(--primary);
}
.trend-line-uu {
  stroke: var(--accent);
}
.trend-line-register {
  stroke: var(--primary);
}
.trend-line-openrate {
  stroke: var(--accent);
}
.trend-line-card-pv {
  stroke: #2c8f7a;
}
.trend-line-card-uu {
  stroke: #f2a65a;
}
.trend-line-share-pv {
  stroke: #2cb673;
}
.trend-line-share-uu {
  stroke: #ff6aa2;
}
.trend-line-draw {
  stroke: #f0b429;
}
.trend-line-cardpush {
  stroke: #8d4ef2;
}
.trend-line.is-drawn {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s ease;
}
.trend-dot {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  transform-origin: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease;
}
.trend-dot.is-visible {
  opacity: 1;
  transform: scale(1);
}
.trend-dot-pv { color: var(--primary); }
.trend-dot-uu { color: var(--accent); }
.trend-dot-register { color: var(--primary); }
.trend-dot-open { color: var(--accent); }
.trend-dot-card-pv { color: #2c8f7a; }
.trend-dot-card-uu { color: #f2a65a; }
.trend-dot-share-pv { color: #2cb673; }
.trend-dot-share-uu { color: #ff6aa2; }
.trend-dot-draw { color: #f0b429; }
.trend-dot-cardpush { color: #8d4ef2; }
.analytics-legend {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 12px;
  color: #52615d;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-item::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-pv::before {
  background: var(--primary);
}
.legend-uu::before {
  background: var(--accent);
}
.legend-register::before {
  background: var(--primary);
}
.legend-open::before {
  background: var(--accent);
}
.analytics-links {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
.analytics-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid #e6eef2;
  background: #f7f9fb;
  color: #1d3b37;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  text-decoration: none;
  border-bottom: 0;
}

.analytics-quicklinks {
  width: min(720px, 100%);
  margin: 10px auto 0;
  display: grid;
  gap: 10px;
  padding-bottom: 200px;
}
.analytics-quicklinks .card {
  margin: 0;
}

@media (max-width: 600px) {
  .analytics-range {
    justify-content: flex-start;
  }
  .progress-card .stat-value {
    font-size: clamp(18px, 3.2vw, 26px);
  }
  html[data-theme="black"] .progress-card .stat-label {
    font-size: 11px;
    white-space: nowrap;
  }
  html[data-theme="black"] .progress-stats-col {
    padding: 0 4px;
  }
}
.analytics-quicklinks .card {
  border-radius: 16px;
}

@media (max-width: 600px) {
  .analytics-topstats {
    gap: 4px;
  }
  .analytics-topstats .topstat {
    padding: 4px 2px;
  }
}
.counter-debug {
  margin-top: 18px;
  border: 1px dashed var(--muted);
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
  background: #fff;
}
.counter-debug-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.counter-debug-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
}
.counter-debug-table {
  overflow-x: auto;
}
.counter-debug-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.counter-debug-table th,
.counter-debug-table td {
  padding: 4px 6px;
  border: 1px solid #eee;
  text-align: center;
  min-width: 70px;
}
.counter-debug-table th {
  background: #f8f8f8;
  font-weight: 600;
}
.counter-debug-empty {
  font-size: 11px;
  color: #888;
}

/* 公開側ヘッダー/フッター */
.public-head {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #f7f9f8;
  border-bottom: 1px solid #e5e5e5;
}
.public-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
}
.public-logo img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.public-foot {
  height: 40px;
  width: 100%;
}

/* スマホで余白を極小に */
@media (max-width: 767px) {
  .login-page .app-wrap {
    max-width: 100vw;
    padding-left: 0;
    padding-right: 0;
    margin: 0 auto;
  }
  .login-page .login-app {
    padding-left: 4px;
    padding-right: 4px;
    padding-top: 60px;
    padding-bottom: 80px;
    gap: 12px;
    width: 100%;
    align-items: stretch;
  }
 .login-page .login-card {
    width: 97%;
    max-width: 97%;
    align-self: center;
    margin-left: auto;
    margin-right: auto;
  }
}

hr{
  width: 100%;
  border: none;
  border-bottom: 1px solid #000;
  padding: 15px 0;
  margin: 15px 0;
}

.cho_conf1{
  margin-top: -17px;
}
.cho_conf2{
  margin-top: 20px;
}
.cho_conf3{
  margin-bottom: 20px;
}
.up30{
  margin-top: 30px;
}
.dw30{
  margin-bottom: 30px;
}
.hr_box{
  width: 95%;
  margin: 15px auto;
  border-bottom: 1px solid #b0b0b063;
}
.chi_log{
  margin-top: -5px;
  margin-bottom: -2px;
}
.login-card{
  padding-top: 40px;
}
.legend-txt{
  font-size: 0.6em;
  text-align: center;
  color: #8a8a8a;
  line-height: 1.3em;
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 767px) {
  .legend-txt{
  text-align: left;
}
}
