:root{
  /* base */
  --bg:#FAFAFA;
  --card:#fff;
  --text:#111;
  --muted:#8A8F98;
  --border:#E6E6E6;

  /* design */
  --radius:14px;
  --shadow:0 6px 18px rgba(0,0,0,.06);

  /* accent */
  --green:#2FA66F;
  --green-strong:#22c55e; /* 今日強調用（好みで同じでもOK） */
  --danger:#ef4444;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

h1{
  margin: 6px 0 14px;
  font-size: 28px;
  letter-spacing: .2px;
}

a{
  color: inherit;
  text-decoration: none;
}

.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom: 10px;
}
.topbar .toggle{
  margin-left:auto;
  font-size: 14px;
  color: var(--muted);
}

/* form */
.form-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0 40px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-card label{
  display:block;
  margin: 12px 0 6px;
  font-weight:600;
}

.form-card input,
.form-card select{
  display: blok;
  width:100%;
}

/* detailsの三角を消す */
.form-toggle > summary{
  list-style: none;
}
.form-toggle > summary::-webkit-details-marker{
  display: none;
}

/* 右下の＋ボタン（Floating Action Button） */
.fab{
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));

  width: 64px;
  height: 64px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: var(--green);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  z-index: 50;

  color: transparent;

  /* 位置を動かさず見た目だけ変える */
  transform: rotate(0deg);
  transition: transform .15s ease, box-shadow .15s ease;

  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.fab::-webkit-details-marker{
  display: none;
}

/* 共通（＋/×でズレないよう基準は揃える） */
.fab::before{
  display: block;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-4px); /* ここだけで上下位置を統一 */
  content: "+";
  font-size: 57px;
}

/* 開いてる時：×（文字だけ差し替え） */
.form-toggle[open] .fab::before{
  content: "×";
  font-weight: 950;
  font-size: 50px;
  transform: translateY(-2px); /* ×は見た目が下がるので微調整 */
}

/* 開いてる時：ボタンの見た目 */
.form-toggle[open] .fab{
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);

  /* 位置を変えない回転だけ */
  transform: rotate(90deg);
}

/* フォームの箱 */
.form-card{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 92px; /* ＋ボタンの上に出す */
  max-width: 560px;
  margin: 0 auto;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.18);

  z-index: 49;

  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}

/* open時に表示 */
.form-toggle[open] .form-card{
  opacity: 1;
  transform: translateY(0);
}

.form-title{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}

.form-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 40;
}

/* open時だけ有効化 */
.form-toggle[open] .form-backdrop{
  opacity: 1;
  pointer-events: auto;
}

label{
  display:block;
  margin-top: 14px;
  font-weight: 700;
  color: #666;
}

/* iOSの見た目暴れ対策（保険） */
input, select{
  width:100%;
  height: 48px;
  padding: 0px 12px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:#fff;
  box-sizing: border-box;
}

input{
  -webkit-appearance: none;
  appearance: none;
}

/* checkboxだけはネイティブ表示を復活 */
input[type="checkbox"]{
  -webkit-appearance: checkbox;
  appearance: auto;
}

select{
  -webkit-appearance: none;
  appearance: none;
  background-clip: padding-box;
}

/* iOSの謎フォーカス枠を消す */
input:focus,
select:focus{
  outline: none;
}

input:focus-visible,
select:focus-visible{
  border-color: rgba(47,166,111,0.45);
  box-shadow: 0 0 0 3px rgba(47,166,111,0.18);
}

.weekly-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(22,163,74,0.08); /* 薄グリーン */
  font-size: 14px;
  color: #14532d;
}

.weekly-row input[type="checkbox"]{
  width: 20px;
  height: 20px;
  accent-color: #16a34a; /* 緑 */
  margin: 0;
  cursor: pointer;
}

.weekly-row span{
  cursor: pointer;
  line-height: 1.4;
}

button.primary{
  margin-top: 16px;
  width:100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 12px;
  border: 0;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

/* feedback */
.msg{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e8fff2;
  color: #0a7;
  border: 1px solid #bfead0;
}
.err{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffecec;
  color: #c00;
  border: 1px solid #f3bcbc;
}

/* cards */
/* ===== category colors ===== */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 10px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}


/* カテゴリ別 */
.card.cat-concert   { border-left-color: #22c55e; } /* 💚 */
.card.cat-broadcast { border-left-color: #3b82f6; } /* 📻 */
.card.cat-event     { border-left-color: #a855f7; } /* 🎪 */
.card.cat-release   { border-left-color: #f59e0b; } /* 📦 */
.card.cat-streak    { border-left-color: #ef4444; } /* 🔥 */
.card.cat-other     { border-left-color: #9ca3af; } /* … */

/*今日をさらに目立たせる（色はカテゴリのままでOK)*/
.card.today{
  border-left-width: 10px;
  box-shadow:
    0 0 0 2px rgba(47,166,111,0.5),
    0 6px 18px rgba(47,166,111,0.3),
    0 12px 30px rgba(47,166,111,0.2);
  transform: translateY(-1px);
}

/* 今日バッジ */
.badge.today{
  background: var(--green);
  color:#fff;
  border: 0;
}

.dt{
  display:flex;
  gap:8px;
  align-items:center;
  font-size: 16px;
}

.title{
  font-weight: 900;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.meta{
  margin-top: 10px;
  display:flex;
  gap:10px;
  align-items:center;
  font-size: 13px;
  color: var(--muted);
}

.badge{
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:#fff;
  color: var(--muted);
}

.badge.weekly{
  background: rgba(22,163,74,0.12);
  color: #166534;
  border: 1px solid rgba(22,163,74,0.35);
}

/* 過去の予定を薄く */
.card.past{
  opacity: .40;              /* 0.35〜0.55で好み調整 */
  filter: grayscale(25%);    /* 色味も落とす */
}

/* actions */
.actions{
  margin-top: 10px;
  display:flex;
  justify-content:flex-end;
}

button.danger{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  color: #333;
  font-weight: 700;
}
button.danger:active{
  transform: translateY(1px);
}

/* header */
.header{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
  padding: 10px 2px;
}

.header::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;

  height: 2px;
  border-radius: 2px;

  background: linear-gradient(
    to right,
    rgba(47,166,111,0),
    rgba(47,166,111,0.35),
    rgba(47,166,111,0)
  );
}

.brand-link{
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
}

.nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

/* main */
.main{
  padding-bottom: 18px;
}

/* signature */
.signature{
  text-align:center;
  font-size: 10px;
  color: var(--muted);
  padding: 18px 0 4px;
}

.section-title{
  margin: 18px 0 10px;
  font-size: 16px;
}

.muted{
  opacity: .7;
}

.push-row{
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  padding: 16px 16px;
  border-radius: 16px;

  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);

  pointer-events: none;

  margin-top: 18px; /* 位置調整：元ボタンの余白に合わせて */
}

.push-row .switch {
  pointer-events: auto;
}

.push-row__texts{
  display: grid;
  gap: 4px;
}

.push-row__title{
  font-weight: 800;
  font-size: 16px;
}

.push-row__desc{
  font-size: 12px;
  color: rgba(0,0,0,0.55);
}

/* iOS風スイッチ */
.switch{
  position: relative;
  width: 54px;
  height: 32px;
  display: inline-block;
  flex: 0 0 auto;
}

.switch input{
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.switch__track{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  transition: background .15s ease;
}

.switch__thumb{
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform .15s ease;
}

/* ON状態 */
.switch input:checked ~ .switch__track{
  background: #2fa66f; /* ほのぴグリーン寄せ */
}
.switch input:checked ~ .switch__thumb{
  transform: translateX(22px);
}

/* キーボード操作のフォーカス */
.switch input:focus-visible ~ .switch__track{
  outline: 3px solid rgba(47,166,111,0.35);
  outline-offset: 2px;
}
