:root {
  --bg: #F1EEE8;
  --card: #FFFFFF;
  --ink: #16161D;
  --ink2: #5A5964;
  --ink3: #8E8C96;
  --line: rgba(22, 22, 29, .09);
  --glass: rgba(255, 255, 255, .58);
  --glass-dark: rgba(22, 22, 29, .72);
  --hi: #FFB100;
  --ok: #00A56A;
  --ng: #FF3B1F;
  --r: 18px;
  --gut: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Outfit", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input, textarea { font: inherit; font-size: 16px; color: var(--ink); -webkit-user-select: text; user-select: text; }
.num { font-family: "Outfit", var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 30px rgba(22, 22, 29, .12), inset 0 1px 0 rgba(255, 255, 255, .8);
}
[hidden] { display: none !important; }
.press { transition: transform .12s; }
.press:active, button:active { transform: scale(.94); }

/* ---- 画面の枠 ---- */
#screen { padding: 0 0 calc(110px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 14px) var(--gut) 12px;
  background: linear-gradient(var(--bg) 55%, rgba(241, 238, 232, 0));
}
.top.scrolled { background: rgba(241, 238, 232, .7); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.top h1 .i { width: 26px; height: 26px; }
.top .grow { flex: 1; }
.date { display: flex; align-items: baseline; gap: 8px; }
.date .big { font-size: 34px; font-weight: 800; line-height: 1; }
.date .dow { font-size: 16px; font-weight: 800; color: #fff; background: var(--ink); border-radius: 8px; padding: 3px 7px; transform: translateY(-4px); }
.date .dow.sun { background: var(--ng); }
.date .dow.sat { background: #2F54FF; }
.syncdot { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink2); border-radius: 50%; }
.syncdot .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.iconbtn.ink { background: var(--ink); color: #fff; }
.iconbtn.ghost { background: transparent; box-shadow: none; }
.iconbtn[disabled] { opacity: .3; }

/* ---- 下のタブ ---- */
#tabs {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b)); display: flex; gap: 6px; padding: 6px; border-radius: 999px;
}
#tabs button { position: relative; width: 58px; height: 50px; border-radius: 999px; display: grid; place-items: center; color: var(--ink2); transition: background .2s, color .2s; }
#tabs button .i { width: 24px; height: 24px; }
#tabs button.on { background: var(--ink); color: #fff; }
.badge { position: absolute; top: 5px; right: 9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ng); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

/* ---- 人の丸 ---- */
.av { --c: #888; width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; flex: none; position: relative; }
.av .i { width: 58%; height: 58%; stroke-width: 2.4; }
.av.both { background: linear-gradient(90deg, var(--a) 50%, var(--b) 50%); }
.av.xs { width: 20px; height: 20px; }
.av.sm { width: 26px; height: 26px; }
.av.lg { width: 56px; height: 56px; }
.av.xl { width: 88px; height: 88px; }
.av.ghostav { background: transparent; color: var(--ink2); border: 2px dashed var(--ink3); }
.av.skip { background: var(--ink3); }

/* ---- 今日：上のまとめ ---- */
.hero { margin: 4px var(--gut) 18px; background: var(--ink); color: #fff; border-radius: 26px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; position: relative; overflow: hidden; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .mid b { font-size: 30px; font-weight: 800; line-height: 1; }
.ring .mid small { display: block; font-size: 13px; color: rgba(255, 255, 255, .6); margin-top: 2px; }
.ring .mid .i { width: 34px; height: 34px; color: var(--hi); }
.garb { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.garb .lab { font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .55); display: flex; align-items: center; gap: 6px; }
.garb .lab .i { width: 15px; height: 15px; }
.gtiles { display: flex; gap: 8px; flex-wrap: wrap; }
.gt { --c: #888; background: var(--c); color: #fff; border-radius: 14px; padding: 8px 12px 8px 9px; display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; }
.gt .i { width: 22px; height: 22px; }
.gt.dim { background: transparent; box-shadow: inset 0 0 0 2px var(--c); color: #fff; padding: 5px 10px 5px 7px; font-size: 13px; }
.gt.dim .i { width: 17px; height: 17px; color: var(--c); }
.gt.none { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .5); }
.bal { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.bal .bar { flex: 1; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .12); display: flex; overflow: hidden; gap: 2px; }
.bal .bar span { height: 100%; transition: flex-grow .6s cubic-bezier(.2, .8, .2, 1); }
.bal .pct { font-size: 15px; font-weight: 800; min-width: 38px; text-align: center; }
.bal .wk { font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, .45); position: absolute; right: 18px; top: 16px; display: flex; gap: 4px; align-items: center; }
.bal .wk .i { width: 14px; height: 14px; }

/* ---- 家事のカード ---- */
.sec { display: flex; align-items: center; gap: 8px; margin: 22px var(--gut) 10px; font-size: 14px; font-weight: 800; color: var(--ink2); }
.sec .i { width: 18px; height: 18px; }
.sec .n { background: var(--ink); color: #fff; border-radius: 8px; padding: 1px 7px; font-size: 12px; }
.sec button.fold { margin-left: auto; color: var(--ink2); }
.cards { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gut); }
.card { --c: #888; background: var(--card); border-radius: var(--r); display: flex; align-items: center; padding: 10px 10px 10px 10px; gap: 6px; box-shadow: 0 1px 0 var(--line); position: relative; }
.card .cbody { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 2px; border-radius: 14px; }
.tile { --c: #888; width: 48px; height: 48px; border-radius: 15px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; position: relative; }
.tile .i { width: 26px; height: 26px; }
.tile.sm { width: 30px; height: 30px; border-radius: 10px; }
.tile.sm .i { width: 18px; height: 18px; }
.tile.lg { width: 64px; height: 64px; border-radius: 20px; }
.tile.lg .i { width: 34px; height: 34px; }
.ctext { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cname { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 18px; color: var(--ink2); font-size: 13px; font-weight: 700; }
.cmeta .i { width: 15px; height: 15px; }
.pips { display: flex; gap: 4px; }
.pip { width: 16px; height: 8px; border-radius: 4px; background: rgba(22, 22, 29, .14); }
.chip { --c: #888; display: inline-flex; align-items: center; gap: 4px; background: var(--c); color: #fff; border-radius: 8px; padding: 2px 7px 2px 5px; font-size: 12px; font-weight: 800; }
.chip .i { width: 14px; height: 14px; }
.late { color: var(--ng); display: inline-flex; align-items: center; gap: 3px; font-weight: 800; }
.who { display: flex; gap: 6px; flex: none; }
.who .av { width: 46px; height: 46px; box-shadow: 0 3px 0 rgba(0, 0, 0, .14); transition: transform .12s; }
.who .av .i { width: 24px; height: 24px; }
.card.done { background: rgba(255, 255, 255, .55); box-shadow: none; }
.card.done .cname { color: var(--ink2); }
.card.done .tile::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat; border: 2px solid var(--bg); }
.card.done .who .av { width: 38px; height: 38px; opacity: .3; box-shadow: none; }
.card.done .who .av .i { width: 20px; height: 20px; }
.card.compact { padding: 7px 8px; }
.card.compact .tile { width: 40px; height: 40px; border-radius: 13px; }
.card.compact .tile .i { width: 22px; height: 22px; }
.card.compact .cname { font-size: 16px; }
.card.compact .who .av { width: 40px; height: 40px; box-shadow: none; }
.card.compact .who .av .i { width: 21px; height: 21px; }
.card.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 40% { transform: scale(1.025); } }
.empty { margin: 30px var(--gut); text-align: center; color: var(--ink3); display: grid; justify-items: center; gap: 10px; }
.empty .i { width: 44px; height: 44px; }

/* ---- 取り消しの帯 ---- */
#undo { position: fixed; z-index: 41; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); border-radius: 999px; padding: 6px 6px 6px 8px; display: flex; align-items: center; gap: 8px; animation: rise .3s cubic-bezier(.2, 1.4, .4, 1); }
#undo button { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
#undo .arrow { color: var(--ink3); }
#undo .arrow .i { width: 16px; height: 16px; }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ---- 下から出る板 ---- */
#sheet { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#sheet .scrim { position: absolute; inset: 0; background: rgba(22, 22, 29, .38); opacity: 0; transition: opacity .25s; pointer-events: auto; }
#sheet .panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 90dvh;
  border-radius: 30px 30px 0 0; display: flex; flex-direction: column; pointer-events: auto;
  transform: translateY(105%); transition: transform .34s cubic-bezier(.2, .9, .25, 1);
  background: rgba(250, 249, 246, .82); -webkit-backdrop-filter: blur(28px) saturate(190%); backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 -10px 40px rgba(22, 22, 29, .2), inset 0 1px 0 rgba(255, 255, 255, .9);
}
#sheet.open .scrim { opacity: 1; }
#sheet.open .panel { transform: none; }
#sheet:not(.open) .scrim { pointer-events: none; }
#sheet:not(.open) .panel { pointer-events: none; }
.grab { flex: none; height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 42px; height: 5px; border-radius: 3px; background: rgba(22, 22, 29, .22); }
.sbody { overflow-y: auto; padding: 0 var(--gut) 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sfoot { flex: none; padding: 12px var(--gut) calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .5); }
.shead { display: flex; align-items: center; gap: 14px; margin: 2px 0 14px; }
.shead .t { flex: 1; min-width: 0; }
.shead h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shead .sub { display: flex; gap: 8px; align-items: center; color: var(--ink2); font-size: 13px; font-weight: 700; margin-top: 4px; flex-wrap: wrap; }
.shead .sub .i { width: 15px; height: 15px; }

/* 記録する板 */
.when { display: flex; gap: 8px; margin-bottom: 12px; }
.seg { display: flex; background: rgba(22, 22, 29, .07); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button { padding: 8px 13px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--ink2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(22, 22, 29, .12); }
.seg button .i { width: 18px; height: 18px; }
.datepick { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 14px; background: rgba(22, 22, 29, .07); font-weight: 800; font-size: 14px; color: var(--ink2); }
.datepick.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(22, 22, 29, .12); }
.datepick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.datepick .i { width: 18px; height: 18px; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 20px; background: var(--card); font-size: 12px; font-weight: 800; color: var(--ink2); box-shadow: 0 1px 0 var(--line); }
.act .av { width: 54px; height: 54px; }
.act .av .i { width: 28px; height: 28px; }
.act .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notein { margin-top: 10px; display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 12px; box-shadow: 0 1px 0 var(--line); }
.notein .i { color: var(--ink3); width: 19px; height: 19px; }
.notein input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; min-width: 0; }

.list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; min-height: 54px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.row:last-child { border-bottom: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { display: flex; align-items: center; gap: 6px; color: var(--ink2); font-size: 13px; font-weight: 700; margin-top: 2px; flex-wrap: wrap; }
.row .t small .i { width: 14px; height: 14px; }
.row .d { font-size: 15px; font-weight: 800; min-width: 74px; }
.row .d small { display: block; color: var(--ink3); font-size: 12px; }
.row .tail { color: var(--ink3); }
.row.muted { color: var(--ink3); }
.lab2 { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--ink2); margin: 18px 2px 8px; }
.lab2 .i { width: 16px; height: 16px; }
.kill { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink3); transition: background .15s, color .15s; }
.kill .i { width: 19px; height: 19px; }
.kill.arm { background: var(--ng); color: #fff; }
.week7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week7 .d { background: var(--card); border-radius: 14px; padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 84px; font-size: 13px; font-weight: 800; }
.week7 .d.today { box-shadow: inset 0 0 0 2.5px var(--ink); }
.week7 .d small { font-size: 11px; color: var(--ink3); }
.week7 .g { --c: #888; width: 30px; height: 30px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; }
.week7 .g .i { width: 18px; height: 18px; }

/* ---- みんなのようす（フィード） ---- */
.day { margin: 18px var(--gut) 8px; display: flex; align-items: baseline; gap: 8px; font-weight: 800; }
.day .num { font-size: 20px; }
.day small { color: var(--ink2); font-size: 13px; }
.feed { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--gut); }
.fi { background: var(--card); border-radius: var(--r); padding: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; position: relative; box-shadow: 0 1px 0 var(--line); }
.fi.new::before { content: ""; position: absolute; left: -5px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--ng); border: 2px solid var(--bg); }
.fi.skipped { background: rgba(255, 255, 255, .5); box-shadow: none; }
.fi .l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fi .l1 b { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi .l1 .tm { margin-left: auto; color: var(--ink3); font-size: 13px; }
.fi .l1 .ago { color: var(--ink3); font-size: 12px; display: flex; align-items: center; gap: 3px; }
.fi .l1 .ago .i { width: 13px; height: 13px; }
.fi .l2 { grid-column: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.st { --c: #888; height: 32px; border-radius: 16px; padding: 0 4px 0 6px; display: inline-flex; align-items: center; gap: 4px; background: var(--c); color: #fff; }
.st .i { width: 18px; height: 18px; }
.st .av { width: 22px; height: 22px; border: 2px solid rgba(255, 255, 255, .9); }
.st .av .i { width: 12px; height: 12px; }
.st.pickme { animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
.mini { height: 32px; min-width: 32px; padding: 0 8px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--ink2); background: rgba(22, 22, 29, .06); font-weight: 800; font-size: 13px; }
.mini .i { width: 18px; height: 18px; }
.mini.on { background: var(--ink); color: #fff; }
.picker { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 4px; margin-top: 8px; padding: 6px; border-radius: 22px; background: rgba(22, 22, 29, .05); animation: rise2 .25s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes rise2 { from { transform: translateY(-6px); opacity: 0; } }
.picker button { --c: #888; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }
.picker button.mine { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.cmts { grid-column: 2; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bub { display: flex; gap: 7px; align-items: flex-end; }
.bub p { margin: 0; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: rgba(22, 22, 29, .06); font-size: 15px; font-weight: 600; white-space: pre-wrap; word-break: break-word; -webkit-user-select: text; user-select: text; }
.bub.me { flex-direction: row-reverse; }
.bub.me p { border-radius: 16px 16px 4px 16px; background: var(--c); color: #fff; }
.bub .tm { font-size: 11px; color: var(--ink3); flex: none; }
.more { display: flex; justify-content: center; margin: 18px; }
.thread { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 4px; }
.send { display: flex; gap: 8px; align-items: flex-end; }
.send textarea { flex: 1; resize: none; border: 0; outline: 0; background: var(--card); border-radius: 18px; padding: 11px 14px; max-height: 120px; line-height: 1.35; box-shadow: 0 1px 0 var(--line); }
.send button { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.send button[disabled] { opacity: .25; }

/* ---- 集計 ---- */
.units { margin: 0 var(--gut); display: flex; gap: 8px; align-items: center; }
.units .seg { flex: 1; }
.units .seg button { flex: 1; justify-content: center; }
.pnav { display: flex; align-items: center; justify-content: space-between; margin: 12px var(--gut) 10px; }
.pnav .lbl { font-size: 20px; font-weight: 800; }
.bigcard { margin: 0 var(--gut); background: var(--ink); color: #fff; border-radius: 26px; padding: 18px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs .p { display: flex; align-items: center; gap: 10px; }
.vs .p:last-child { flex-direction: row-reverse; text-align: right; }
.vs .p b { font-size: 40px; font-weight: 800; line-height: 1; }
.vs .p b small { font-size: 18px; }
.vs .p .q { font-size: 13px; color: rgba(255, 255, 255, .55); display: flex; gap: 4px; align-items: center; }
.vs .p:last-child .q { justify-content: flex-end; }
.vs .p .q .i { width: 14px; height: 14px; }
.vs .mid { display: grid; justify-items: center; gap: 2px; color: rgba(255, 255, 255, .5); font-size: 12px; }
.vs .mid .i { width: 18px; height: 18px; }
.sbar { height: 18px; border-radius: 9px; display: flex; gap: 3px; overflow: hidden; margin-top: 14px; background: rgba(255, 255, 255, .12); }
.sbar span { height: 100%; transition: flex-grow .6s cubic-bezier(.2, .8, .2, 1); }
.modes { display: flex; justify-content: center; margin-top: 14px; }
.modes .seg { background: rgba(255, 255, 255, .1); }
.modes .seg button { color: rgba(255, 255, 255, .6); }
.modes .seg button.on { background: #fff; color: var(--ink); }
.chart { margin: 14px var(--gut) 0; background: var(--card); border-radius: var(--r); padding: 14px 12px 8px; }
.chart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.chart .ax { font-family: var(--font); font-size: 10px; font-weight: 700; fill: var(--ink3); }
.crow { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow .nm { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.crow .nm span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .nums { display: flex; gap: 10px; font-size: 13px; font-weight: 800; color: var(--ink2); }
.crow .nums span { display: inline-flex; align-items: center; gap: 4px; }
.crow .nums .i { width: 14px; height: 14px; }
.cbar { grid-column: 2; height: 10px; border-radius: 5px; background: rgba(22, 22, 29, .07); display: flex; gap: 2px; overflow: hidden; }
.cbar span { height: 100%; }
.dot { --c: #888; width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }

/* ---- 設定 ---- */
.block { margin: 0 var(--gut) 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mem { background: var(--card); border-radius: var(--r); padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 800; position: relative; }
.mem .youtag { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: 11px; border-radius: 7px; padding: 2px 6px; }
.mem .edit { position: absolute; top: 8px; right: 8px; color: var(--ink3); }
.mem .edit .i { width: 17px; height: 17px; }
.code { font-size: 30px; font-weight: 800; letter-spacing: .08em; text-align: center; margin: 6px 0; }
.code-card { background: var(--card); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.code-card .btns { display: flex; gap: 8px; justify-content: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps div { background: rgba(22, 22, 29, .05); border-radius: 14px; padding: 10px 6px; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--ink2); text-align: center; }
.steps .i { width: 22px; height: 22px; color: var(--ink); }
.wdots { display: inline-flex; gap: 3px; }
.wdots i { width: 6px; height: 12px; border-radius: 2px; background: var(--ink); display: inline-block; }
.wdots i.off { background: rgba(22, 22, 29, .15); }
.handle { color: var(--ink3); touch-action: none; width: 34px; height: 40px; display: grid; place-items: center; cursor: grab; }
.row.dragging { position: relative; z-index: 3; background: #fff; box-shadow: 0 12px 30px rgba(22, 22, 29, .2); border-radius: 14px; }
.addbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: var(--r); border: 2px dashed rgba(22, 22, 29, .2); color: var(--ink2); margin-top: 8px; }
.wk-table { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--card); border-radius: var(--r); padding: 10px 8px; }
.wk-table .h { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink2); }
.wk-table .c { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 34px; }
.wk-table .g { --c: #888; width: 28px; height: 28px; border-radius: 9px; background: var(--c); color: #fff; display: grid; place-items: center; position: relative; }
.wk-table .g .i { width: 16px; height: 16px; }
.wk-table .g sup { position: absolute; right: -5px; top: -5px; background: var(--ink); color: #fff; font-size: 9px; border-radius: 6px; padding: 0 3px; line-height: 13px; }

/* 編集の板 */
.namein { width: 100%; border: 0; outline: 0; background: var(--card); border-radius: 16px; padding: 14px 16px; font-size: 20px; font-weight: 800; box-shadow: 0 1px 0 var(--line); }
.namein::placeholder { color: var(--ink3); }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.igrid button { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; background: var(--card); color: var(--ink2); }
.igrid button.on { background: var(--c, var(--ink)); color: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { --c: #888; width: 40px; height: 40px; border-radius: 50%; background: var(--c); }
.swatches button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--c); }
.swatches button[disabled] { opacity: .2; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { height: 44px; border-radius: 14px; background: var(--card); font-weight: 800; color: var(--ink2); }
.days button.on { background: var(--ink); color: #fff; }
.weeks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.weeks button { height: 40px; border-radius: 12px; background: var(--card); font-weight: 800; color: var(--ink2); font-size: 14px; }
.weeks button.on { background: var(--ink); color: #fff; }
.freqs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.freqs button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: 16px; background: var(--card); font-size: 11px; font-weight: 800; color: var(--ink2); }
.freqs button.on { background: var(--ink); color: #fff; }
.stepper { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 16px; padding: 6px; width: max-content; }
.stepper b { font-size: 22px; font-weight: 800; min-width: 54px; text-align: center; }
.stepper b small { font-size: 13px; color: var(--ink2); margin-left: 2px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: rgba(22, 22, 29, .06); display: grid; place-items: center; }
.weights { display: flex; gap: 8px; }
.weights button { flex: 1; height: 54px; border-radius: 16px; background: var(--card); display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding-bottom: 14px; }
.weights button i { width: 8px; border-radius: 3px; background: rgba(22, 22, 29, .15); display: block; }
.weights button.on { background: var(--ink); }
.weights button.on i.f { background: var(--hi); }
.weights button i.f { background: var(--ink); }
.savebar { display: flex; gap: 10px; }
.savebar .go { flex: 1; height: 54px; border-radius: 18px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 16px; }
.savebar .go[disabled] { opacity: .3; }
.savebar .kill { width: 54px; height: 54px; border-radius: 18px; background: var(--card); }
.savebar .kill.arm { background: var(--ng); color: #fff; }
.logrow .t small .from { text-decoration: line-through; color: var(--ink3); }
.sw { --c: #888; width: 14px; height: 14px; border-radius: 50%; background: var(--c); display: inline-block; vertical-align: -2px; }

/* ---- はじめての画面 ---- */
.ob { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 28px) 22px calc(var(--safe-b) + 24px); max-width: 520px; margin: 0 auto; }
.ob .logo { display: flex; align-items: center; gap: 14px; margin: 8px 0 26px; }
.ob .logo h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.mark { width: 64px; height: 64px; flex: none; }
.ob .hero2 { flex: 1; display: grid; place-items: center; }
.ob .stack { display: grid; gap: 10px; }
.bigbtn { height: 64px; border-radius: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 17px; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.bigbtn.ink { background: var(--ink); color: #fff; }
.bigbtn[disabled] { opacity: .35; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--hi); color: var(--ink); border-radius: 18px; padding: 12px 14px; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.notice .i { flex: none; margin-top: 1px; }
.notice b { font-weight: 800; }
.codein { width: 100%; text-align: center; border: 0; outline: 0; background: var(--card); border-radius: 20px; padding: 16px; font-size: 30px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 1px 0 var(--line); font-family: "Outfit", var(--font); }
.codein.err { box-shadow: 0 0 0 3px var(--ng); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picks button { background: var(--card); border-radius: 22px; padding: 20px 8px; display: grid; justify-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.backbtn { align-self: flex-start; margin-bottom: 8px; }

/* ---- はじける粒 ---- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.spark { position: absolute; width: 9px; height: 9px; border-radius: 3px; background: var(--c); animation: spark .6s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(200deg) scale(.3); opacity: 0; } }
.who .av.hit { animation: hit .4s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes hit { 40% { transform: scale(1.25); } }

@media (min-width: 700px) {
  #screen { padding-top: 10px; }
}
.logrow .t small { gap: 4px 12px; }
.chg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chg .i { width: 13px; height: 13px; }
.row .t b .i { width: 16px; height: 16px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatches button { width: auto; height: auto; aspect-ratio: 1; }
