/* x-tool.site 管理画面 — iOS のグループ化リスト風 + 左サイドバー
   色・角丸・動きは tyoubuzz.com/shadowban_checker と同じトークンを使う。 */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card2: #f2f2f7;
  --side: rgba(255, 255, 255, .78);
  --label: #000000;
  --label2: rgba(60, 60, 67, .62);
  --label3: rgba(60, 60, 67, .32);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --purple: #af52de;
  --pink: #ff2d55;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --gray: #8e8e93;
  --t-blue: rgba(0, 122, 255, .12);
  --t-green: rgba(52, 199, 89, .14);
  --t-red: rgba(255, 59, 48, .12);
  --t-orange: rgba(255, 149, 0, .14);
  --t-purple: rgba(175, 82, 222, .13);
  --t-pink: rgba(255, 45, 85, .12);
  --t-teal: rgba(48, 176, 199, .14);
  --t-indigo: rgba(88, 86, 214, .13);
  --t-gray: rgba(142, 142, 147, .16);
  --glass: rgba(255, 255, 255, .72);
  --glass-shadow: 0 8px 30px rgba(0, 0, 0, .12), 0 1px 0 rgba(0, 0, 0, .04);
  --radius: 22px;
  --radius-s: 14px;
  --side-w: 264px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card2: #2c2c2e;
    --side: rgba(28, 28, 30, .82);
    --label: #ffffff;
    --label2: rgba(235, 235, 245, .62);
    --label3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55);
    --fill: rgba(118, 118, 128, .24);
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --pink: #ff375f;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --gray: #98989f;
    --t-blue: rgba(10, 132, 255, .2);
    --t-green: rgba(48, 209, 88, .2);
    --t-red: rgba(255, 69, 58, .2);
    --t-orange: rgba(255, 159, 10, .2);
    --t-purple: rgba(191, 90, 242, .2);
    --t-pink: rgba(255, 55, 95, .2);
    --t-teal: rgba(64, 200, 224, .2);
    --t-indigo: rgba(94, 92, 230, .22);
    --t-gray: rgba(152, 152, 159, .2);
    --glass: rgba(37, 37, 40, .72);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue); text-decoration: none; }
.i { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2;
     stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--label2); }
.faint { color: var(--label3); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- レイアウト ---------- */
.shell { display: flex; min-height: 100dvh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 18px) 14px calc(env(safe-area-inset-bottom) + 14px);
  background: var(--side);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--sep);
  transition: transform .38s var(--ease);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand-icon { width: 40px; height: 40px; border-radius: 11px; flex: none;
              box-shadow: 0 6px 16px rgba(0, 122, 255, .3); }
.brand-icon svg { width: 100%; height: 100%; display: block; }
.brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.brand small { color: var(--label2); font-size: 12px; }

.nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-head { font-size: 12px; font-weight: 700; color: var(--label2); margin: 16px 10px 6px; letter-spacing: .03em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px;
  color: var(--label); font-weight: 600; font-size: 15px; transition: background .15s;
}
.nav a + a { margin-top: 2px; }
.nav a:hover { background: var(--fill); }
.nav a.on { background: var(--blue); color: #fff; }
.nav a.on .nav-ico { background: rgba(255,255,255,.22) !important; color: #fff !important; }
.nav-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.nav-ico .i { width: 17px; height: 17px; }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; border-radius: 999px; padding: 0 7px;
              font-size: 12px; font-weight: 700; display: grid; place-items: center;
              background: var(--red); color: #fff; }
.nav a.on .badge { background: #fff; color: var(--blue); }
.side-foot { border-top: 1px solid var(--sep); padding-top: 12px; margin-top: 8px;
             display: flex; align-items: center; gap: 10px; font-size: 13px; }
.side-foot .who { flex: 1; min-width: 0; color: var(--label2); }
.side-foot .who b { color: var(--label); display: block; font-size: 14px; }

.main { flex: 1; min-width: 0; margin-left: var(--side-w); }
.topbar { display: none; }
.content {
  max-width: 1180px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 26px) 32px calc(env(safe-area-inset-bottom) + 60px);
}
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 32px; font-weight: 800; margin: 0; line-height: 1.15; letter-spacing: .01em; }
.page-head .sub { color: var(--label2); font-size: 14px; margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.scrim { display: none; }

@media (max-width: 900px) {
  .side { transform: translateX(-102%); box-shadow: var(--glass-shadow); }
  body.nav-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.28);
           opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
    background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--sep);
  }
  .topbar .t { font-weight: 700; font-size: 17px; flex: 1; text-align: center; margin-right: 40px; }
  .topbar button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--blue); }
  .content { padding: 18px 16px calc(env(safe-area-inset-bottom) + 60px); }
  .page-head h1 { font-size: 28px; }
  .page-head .actions { margin-left: 0; width: 100%; }
}

/* ---------- カード・グループ ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; }
.card + .card, .group + .card, .card + .group, .group + .group, .grid + .card, .grid + .group,
.card + .grid, .group + .grid, .section-head + .grid { margin-top: 14px; }
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--label2);
  margin: 26px 16px 8px; letter-spacing: .02em;
}
.section-head:first-child { margin-top: 4px; }
.section-head .r { margin-left: auto; font-weight: 600; }
.section-head a.r { color: var(--blue); }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }

.row {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; width: 100%; text-align: left; transition: background .15s; min-height: 56px;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 72px; border-top: 1px solid var(--sep);
}
.row.no-ico + .row::before, .row.no-ico::before { left: 18px; }
a.row { color: inherit; }
a.row:hover, button.row:hover { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 700; line-height: 1.35; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-sub { font-size: 13px; color: var(--label2); margin-top: 1px; }
.row-end { display: flex; align-items: center; gap: 8px; flex: none; }
.chev { color: var(--label3); }

/* 丸アイコン */
.ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ico .i { width: 20px; height: 20px; }
.ico.sq { border-radius: 11px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--fill); }
.avatar.s { width: 28px; height: 28px; }
.avatar.l { width: 72px; height: 72px; }
.t-blue { background: var(--t-blue); color: var(--blue); }
.t-green { background: var(--t-green); color: var(--green); }
.t-red { background: var(--t-red); color: var(--red); }
.t-orange { background: var(--t-orange); color: var(--orange); }
.t-purple { background: var(--t-purple); color: var(--purple); }
.t-pink { background: var(--t-pink); color: var(--pink); }
.t-teal { background: var(--t-teal); color: var(--teal); }
.t-indigo { background: var(--t-indigo); color: var(--indigo); }
.t-gray { background: var(--t-gray); color: var(--gray); }

/* ピル型タグ */
.pill { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700;
        padding: 2px 9px; border-radius: 7px; white-space: nowrap; line-height: 1.6; }
.pill .i { width: 1em; height: 1em; stroke-width: 2.6; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.dot.gray { background: var(--gray); }
.dot.blue { background: var(--blue); }
.dot.pulse { animation: pulse-dot 1.6s ease-in-out infinite; }

/* ---------- 統計タイル ---------- */
.grid { display: grid; gap: 12px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid.k3, .grid.k2 { grid-template-columns: minmax(0, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden;
        animation: rise .5s var(--ease) both; }
.stat .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stat .top .ico { width: 32px; height: 32px; border-radius: 10px; }
.stat .top .ico .i { width: 17px; height: 17px; }
.stat .top span { font-size: 13px; font-weight: 700; color: var(--label2); }
.stat b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat small { display: block; font-size: 12px; color: var(--label2); margin-top: 4px; }
.stat:nth-child(2) { animation-delay: .04s; } .stat:nth-child(3) { animation-delay: .08s; }
.stat:nth-child(4) { animation-delay: .12s; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--t-blue); color: var(--blue); white-space: nowrap;
  transition: transform .15s var(--ease), opacity .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(0,122,255,.28); }
.btn.danger { background: var(--t-red); color: var(--red); }
.btn.green { background: var(--t-green); color: var(--green); }
.btn.plain { background: var(--fill); color: var(--label); }
.btn.s { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; height: 34px; }
.btn.busy { pointer-events: none; }
.btn.busy .i { animation: spin .8s linear infinite; }
.btn.wide { width: 100%; height: 48px; font-size: 16px; }

/* ---------- 入力 ---------- */
.field { display: flex; align-items: center; gap: 8px; background: var(--card2); border-radius: 12px;
         padding: 0 12px; transition: box-shadow .2s, background .2s; min-height: 42px; }
.field:focus-within { box-shadow: 0 0 0 3px var(--t-blue); background: var(--card); outline: 1px solid var(--blue); }
.field input, .field select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
         font-size: 16px; padding: 9px 0; }
.field .i { color: var(--label3); }
textarea.ta { width: 100%; min-height: 120px; border: 0; outline: 0; border-radius: 12px; background: var(--card2);
              padding: 12px; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
              resize: vertical; transition: box-shadow .2s; }
textarea.ta:focus { box-shadow: 0 0 0 3px var(--t-blue); outline: 1px solid var(--blue); background: var(--card); }
select.sel { appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: var(--fill);
             border-radius: 9px; padding: 5px 26px 5px 10px; font-size: 14px; font-weight: 600;
             background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
             background-repeat: no-repeat; background-position: right 7px center; background-size: 12px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row + .form-row { margin-top: 10px; }
.label-s { font-size: 13px; font-weight: 700; color: var(--label2); }
input, select, textarea { font-size: 16px; }   /* iOSで入力時に拡大されないように */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* iOS スイッチ */
.sw { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background .25s; }
.sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
                  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16);
                  transition: transform .3s var(--spring); }
.sw input:checked + span { background: var(--green); }
.sw input:checked + span::after { transform: translateX(20px); }
.sw.s { width: 42px; height: 26px; }
.sw.s span::after { width: 22px; height: 22px; }
.sw.s input:checked + span::after { transform: translateX(16px); }

/* セグメント */
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { padding: 6px 14px; font-size: 13px; font-weight: 600; border-radius: 8px; color: var(--label);
                      transition: background .2s; white-space: nowrap; }
.seg a.on, .seg button.on { background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.seg .c { color: var(--label2); font-weight: 600; margin-left: 4px; }

/* ---------- ポストカード ---------- */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.post { background: var(--card); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
        animation: rise .45s var(--ease) both; }
.post-media { display: grid; gap: 2px; background: var(--card2); aspect-ratio: 16/10; overflow: hidden; }
.post-media.n2 { grid-template-columns: 1fr 1fr; }
.post-media.n3, .post-media.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media.n3 > :first-child { grid-row: span 2; }
.post-media img, .post-media video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.post-body { padding: 12px 14px 4px; flex: 1; }
.post-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; display: -webkit-box;
             -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-text.open { -webkit-line-clamp: unset; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--label2); margin-top: 8px; }
.post-foot { display: flex; gap: 6px; padding: 10px 12px 12px; flex-wrap: wrap; align-items: center; }

/* ---------- 表 ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--label2); padding: 10px 12px;
          border-bottom: 1px solid var(--sep); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--fill); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 700; display: block; line-height: 1.25; }
.who small { color: var(--label2); font-size: 12px; display: block; }
.up { color: var(--green); font-weight: 700; }
.down { color: var(--red); font-weight: 700; }

/* スマホ: 表をカードに畳む(data-label方式) */
@media (max-width: 760px) {
  table.tbl.fold thead { display: none; }
  table.tbl.fold, .tbl.fold tbody, .tbl.fold tr, .tbl.fold td { display: block; width: 100%; }
  .tbl.fold tr { padding: 10px 14px; border-bottom: 1px solid var(--sep); }
  .tbl.fold tr:last-child { border-bottom: 0; }
  .tbl.fold td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: right; }
  .tbl.fold td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--label2); text-align: left; flex: none; }
  .tbl.fold td.head { padding-bottom: 6px; }
  .tbl.fold td.head::before { display: none; }
  .tbl.fold td.r, .tbl.fold td.c { text-align: right; }
}

/* ---------- ログ ---------- */
.log { font-size: 13px; padding: 9px 18px; display: flex; gap: 10px; align-items: baseline; }
.log + .log { border-top: 1px solid var(--sep); }
.log time { color: var(--label3); font-variant-numeric: tabular-nums; flex: none; font-size: 12px; }
.log .k { flex: none; }
.log .m { word-break: break-word; min-width: 0; }
.log.warn .m { color: var(--orange); }
.log.error .m { color: var(--red); }

/* ---------- グラフ ---------- */
.chart { width: 100%; height: 180px; display: block; }
.chart .ln { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: url(#cg); opacity: .9; }
.chart .gl { stroke: var(--sep); stroke-width: 1; }
.chart text { fill: var(--label2); font-size: 11px; font-family: inherit; }
.chart .pt { fill: var(--card); stroke: var(--blue); stroke-width: 2; }
.empty { text-align: center; color: var(--label2); padding: 36px 20px; font-size: 14px; }
.empty .ico { margin: 0 auto 10px; width: 52px; height: 52px; }
.empty .ico .i { width: 26px; height: 26px; }

/* ---------- 大きいスイッチ行(ダッシュボード) ---------- */
.switches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .switches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .switches { grid-template-columns: minmax(0, 1fr); } }
.swcard { background: var(--card); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.swcard .ico { border-radius: 11px; }
.swcard b { display: block; font-size: 15px; }
.swcard small { display: block; font-size: 12px; color: var(--label2); }

/* ---------- 通知トースト ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); transform: translateX(-50%);
              z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
         box-shadow: var(--glass-shadow); border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600;
         display: flex; align-items: center; gap: 8px; animation: toast-in .45s var(--spring) both; }
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast .i { width: 18px; height: 18px; }
.toast.ok .i { color: var(--green); }
.toast.ng .i { color: var(--red); }

/* ---------- シート(モーダル) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.32); display: flex; align-items: center; justify-content: center;
            padding: 16px; animation: fade .25s both; }
.sheet { background: var(--bg); border-radius: 24px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
         padding: 18px; box-shadow: var(--glass-shadow); animation: sheet-in .45s var(--spring) both; }
.sheet h3 { margin: 2px 4px 14px; font-size: 20px; display: flex; align-items: center; }
.sheet h3 button { margin-left: auto; }
@media (max-width: 600px) {
  .sheet-bg { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 24px 24px 0 0; padding-bottom: calc(env(safe-area-inset-bottom) + 18px); width: 100%; animation-name: sheet-up; }
}

/* ---------- ログイン ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(380px, 100%); text-align: center; animation: rise .6s var(--ease) both; }
.login .app-icon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 20px; box-shadow: 0 12px 28px rgba(0,122,255,.32);
                   animation: float 5s ease-in-out infinite; }
.login .app-icon svg { width: 100%; height: 100%; display: block; }
.login h1 { font-size: 30px; font-weight: 800; margin: 0 0 4px; }
.login p { color: var(--label2); margin: 0 0 22px; font-size: 14px; }
.login .group { text-align: left; }
.login .group input { width: 100%; border: 0; outline: 0; background: transparent; padding: 15px 18px; font-size: 17px; }
.login .group input + input { border-top: 1px solid var(--sep); }
.login .err { color: var(--red); font-size: 14px; font-weight: 600; margin: 12px 0 0; animation: shake .4s; }
.login .btn.wide { margin-top: 16px; }

/* ---------- 動き ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 投稿時間帯のピッカー ---------- */
.hours-btn { max-width: 100%; }
.hours-btn .hv { font-variant-numeric: tabular-nums; }
.hours-sheet .hours-val { text-align: center; margin-bottom: 14px; }
.hours-sheet .hours-val b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.hours-bar { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin: 0 0 18px; }
.hours-bar i {
  position: relative; height: 44px; border-radius: 4px; background: var(--fill);
  cursor: pointer; transition: background .18s, transform .18s var(--spring);
}
.hours-bar i:first-child { border-radius: 10px 4px 4px 10px; }
.hours-bar i:last-child { border-radius: 4px 10px 10px 4px; }
.hours-bar i.on { background: var(--blue); }
.hours-bar i.edge { background: var(--blue); transform: scaleY(1.12); box-shadow: 0 2px 10px rgba(0,122,255,.4); }
.hours-bar i s { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%);
                 font-size: 10px; color: var(--label3); text-decoration: none; font-variant-numeric: tabular-nums; }
.hours-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--label2); }
.hours-row span { width: 34px; flex: none; }
.hours-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--blue); height: 26px; }
.hours-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.hours-presets button { padding: 6px 13px; border-radius: 999px; background: var(--fill);
                        font-size: 13px; font-weight: 600; transition: transform .15s var(--ease); }
.hours-presets button:active { transform: scale(.95); }

/* ---------- 戻るボタン ---------- */
.back-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 8px;
            border-radius: 999px; background: var(--fill); color: var(--label); font-size: 14px; font-weight: 600;
            margin-bottom: 10px; transition: transform .15s var(--ease), background .2s; }
.back-btn:hover { background: var(--sep); }
.back-btn:active { transform: scale(.96); }
.back-btn .i { width: 17px; height: 17px; transform: rotate(180deg); }

/* ---------- 日付の送り ---------- */
.date-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--fill); border-radius: 12px; padding: 2px; }
.date-nav button { width: 34px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--label); transition: background .15s; }
.date-nav button:hover:not(:disabled) { background: var(--card); }
.date-nav button:disabled { opacity: .3; pointer-events: none; }
.date-nav button.prev .i { transform: rotate(180deg); }
.date-nav .cur { padding: 0 12px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.date-nav .cur small { color: var(--label2); font-weight: 600; margin-left: 4px; }

/* 2段階認証コードのボタン */
.totp-btn .tv { font-variant-numeric: tabular-nums; }
.totp-btn.totp-on { background: var(--green); color: #fff; }
.totp-btn.totp-on .tv { font-size: 16px; font-weight: 800; letter-spacing: .12em; }
