/* 家族共有 — スマホ前提の 1 枚。部品の形は suite.css（ボタン・入力欄・小窓・暦と時刻の小窓）。色だけここで上書き */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --s-band: #2bb673; --s-accent: #2bb673; --s-deep: #1e8a56;
  --accent: #2bb673; --accent-weak: #e6f6ee;
  --border: #e3e6ea; --text: #222; --muted: #6b7280; --danger: #b91c1c;
  --tabbar: 66px;
  --sun: #e03e3e; --sat: #2f6fd6;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px; color: var(--text); background: #fff; min-height: 100vh;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button { -webkit-touch-callout: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0; }

/* ─── 上の帯（画面ごとの題） ─── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; gap: 10px; min-height: 52px; }
.top h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.top .spacer { flex: 1; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #333;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 18px; line-height: 1; }
.iconbtn:active { background: #f1f3f5; }
.iconbtn svg { width: 20px; height: 20px; }
.top .todaybtn { font-size: 12px; padding: 5px 10px; border-radius: 14px; border: 1px solid var(--border); background: #fff; }

/* ─── 下のタブ ─── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--border); display: flex; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #8a8f98; text-decoration: none; font-size: 11px; }
.tabbar a svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--s-deep); font-weight: 700; }
.tabbar a.active svg { stroke-width: 2.2; }

/* ─── 共通の中身 ─── */
.wrap { padding: 8px 16px 24px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.card h3 { font-size: 15px; margin-bottom: 8px; }
label.fl { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=date], input[type=time], input[type=url], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 16px; background: #fff; }
input[data-date], input[data-time] { background-color: #fff; }
textarea { resize: vertical; }
.btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btns button { flex: 1; padding: 12px; font-size: 15px; border-radius: 10px; }
.btns button.danger { flex: 0 0 auto; }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; object-fit: cover; flex: none; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; border: 0; font-size: 34px; line-height: 1;
  box-shadow: 0 6px 18px rgba(43,182,115,.45); display: flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.fab:active { transform: scale(.96); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }
#flash { position: fixed; top: auto; right: auto; left: 50%; bottom: calc(var(--tabbar) + 90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px);
  background: rgba(34,34,34,.92); color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 13px; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; max-width: 90vw; }
#flash.show { opacity: 1; transform: translateX(-50%); }
#flash.err { background: #b91c1c; }

/* 下からせり上がる小窓 */
.modal.bottom { align-items: flex-end; padding: 0; }
.modal.bottom .sheet { max-width: 560px; border-radius: 16px 16px 0 0; padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow: auto; transform: translateY(100%); transition: transform .2s ease-out; }
.modal.bottom.in .sheet { transform: none; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: #ddd; margin: -4px auto 4px; }
.sheet .fl:first-of-type { margin-top: 0; }
.sheet .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .actions { margin-top: 10px; }
.sheet .actions button { padding: 11px 16px; }

/* 切り替え（家族／自分だけ・終日） */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border); background: #fff; font-size: 13px; color: #444; }
.chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--s-deep); font-weight: 700; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: #d6d9de; position: relative; transition: .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 21px; }

/* ─── 予定表 ─── */
.cal { user-select: none; -webkit-user-select: none; }
.cal .dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; border-bottom: 1px solid var(--border); }
.cal .dow span:first-child { color: var(--sun); } .cal .dow span:last-child { color: var(--sat); }
.wk { position: relative; border-bottom: 1px solid var(--border); }
.wk .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.wk .d { min-height: 30px; text-align: center; padding-top: 5px; font-size: 14px; position: relative; }
.wk .d:not(:first-child) { border-left: 1px solid #f0f1f3; }
.wk .d .num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; }
.wk .d.out .num { color: #c3c7cd; }
.wk .d.sun .num { color: var(--sun); } .wk .d.sat .num { color: var(--sat); } .wk .d.hol .num { color: var(--sun); }
.wk .d.today .num { background: #222; color: #fff; font-weight: 700; }
.wk .d.sel { background: #f1f3f5; }
.wk .d.drop { background: var(--accent-weak); }
.wk .bars { position: relative; min-height: 6px; }
.wk .lanes { display: grid; grid-template-columns: repeat(7, 1fr); }
.bar { position: absolute; height: 20px; line-height: 20px; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; color: #fff; -webkit-touch-callout: none; touch-action: pan-y; }
.bar.priv { background: var(--tint) !important; color: var(--fg) !important; }
.bar.more { background: none; color: var(--muted); font-weight: 400; text-align: left; }
.bar.dragging { opacity: .35; }
.dragghost { position: fixed; z-index: 100; pointer-events: none; height: 22px; line-height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.3); transform: translate(-50%, -140%); white-space: nowrap; }
/* 色の札 */
.c-red { --bg: #e8716d; --fg: #c0392b; --tint: #fbe3e2; }
.c-blue { --bg: #4f8fe8; --fg: #2d64b8; --tint: #e3edfb; }
.c-sky { --bg: #6fb7ee; --fg: #2a7fb8; --tint: #e1f1fb; }
.c-navy { --bg: #2f3e9e; --fg: #2f3e9e; --tint: #e5e7f6; }
.c-yellow { --bg: #f2d24b; --fg: #8a6d00; --tint: #fdf3c4; }
.c-green { --bg: #3cb371; --fg: #227a4a; --tint: #e0f4e8; }
.c-purple { --bg: #8e5fc9; --fg: #6c3fa8; --tint: #eee5f8; }
.c-grey { --bg: #9e9e9e; --fg: #5e5e5e; --tint: #ececec; }
.bar, .swatch, .dot-c { background: var(--bg); }
.c-yellow.bar { color: #333; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); flex: none; }
.swatch.on { box-shadow: 0 0 0 2px #222; }
/* 日の一覧（押した週の下に出る） */
.daypanel { background: #fafbfc; border-top: 1px solid var(--border); padding: 8px 12px 10px; }
.daypanel .dh { font-size: 13px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.daypanel .dh .holname { color: var(--sun); font-weight: 400; font-size: 12px; }
.daypanel .ev { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; }
.daypanel .ev:active { background: #eef0f2; }
.daypanel .ev .dot-c { width: 6px; height: 28px; border-radius: 3px; flex: none; }
.daypanel .ev .t { width: 5.2em; font-size: 12px; color: var(--muted); flex: none; line-height: 1.2; }
.daypanel .ev .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.daypanel .ev .n .pv { font-size: 10px; color: var(--muted); margin-left: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 0 5px; }
.daypanel .ev .n .who { font-size: 11px; color: var(--muted); margin-left: 6px; }
.daypanel .add { color: var(--accent); font-size: 13px; padding: 6px 4px; }
.caltitle { cursor: pointer; }
.caltitle .caret { font-size: 12px; color: var(--muted); margin-left: 2px; }
.monthpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.monthpick button { padding: 10px 0; }
.monthpick button.on { background: var(--accent); color: #fff; }
.yearrow { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.yearrow button { padding: 4px 12px; }

/* ─── 買い物リスト ─── */
.listbar { display: flex; gap: 8px; align-items: center; padding: 4px 16px 8px; position: sticky; top: 52px; background: #fff; z-index: 15; }
.listbar select { flex: 1; padding: 9px 32px 9px 12px; border-radius: 20px; font-size: 15px; font-weight: 700; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.8' stroke-linecap='round'/></svg>") no-repeat right 12px center / 14px; }
.listbar .freq { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font-size: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.listbar .freq.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.listbar .freq svg { width: 20px; height: 20px; transition: transform .2s; }
.listbar .freq.on svg { transform: rotate(180deg); }
/* よく使うもの（∨ の下に出る） */
.freqpanel { margin: 0 16px 10px; border: 1px solid var(--accent); border-radius: 12px; background: #fff; overflow: hidden; }
.freqpanel .search { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.freqpanel .search input { border-radius: 8px; }
.freqpanel .fl-list { max-height: 46vh; overflow: auto; }
.frow { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f0f1f3; }
.frow:last-child { border-bottom: 0; }
.frow .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.frow .n .cnt { font-size: 11px; color: #b0b5bb; margin-left: 6px; }
.frow .n.new { color: var(--s-deep); font-weight: 700; }
.frow .storechip { flex: none; max-width: 7.5em; font-size: 12px; padding: 4px 22px 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: #f6f7f9; color: #444;
  appearance: none; -webkit-appearance: none; width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #f6f7f9 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'/></svg>") no-repeat right 7px center / 11px; }
.frow .storechip.none { color: #999; }
.frow .plus { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; border: 0; font-size: 22px; line-height: 1; padding: 0 0 2px; display: inline-flex; align-items: center; justify-content: center; }
.frow .plus.listed { background: #fff; color: var(--accent); border: 1px solid var(--accent); font-size: 16px; }
.frow .plus:active { transform: scale(.94); }
/* リストの本体 */
.grp { margin: 0 16px; }
.grp .gh { font-size: 12px; font-weight: 700; color: var(--s-deep); padding: 10px 2px 4px; display: flex; align-items: center; gap: 6px; }
.grp .gh .cnt { font-weight: 400; color: var(--muted); }
.irow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f0f1f3; }
.irow .ck { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c7cbd1; background: #fff; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.irow .ck:active { border-color: var(--accent); }
.irow .body { flex: 1; min-width: 0; }
.irow .n { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow .who { flex: none; font-size: 11px; color: #b0b5bb; }
.irow.done .ck { background: var(--accent); border-color: var(--accent); }
.irow.done .n { color: #a0a5ab; text-decoration: line-through; }
.donehead { display: flex; align-items: center; gap: 8px; margin: 18px 16px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.donehead .spacer { flex: 1; }
.donehead button { font-size: 12px; padding: 4px 10px; }

/* ─── その他 ─── */
.more h2 { font-size: 13px; color: var(--muted); margin: 18px 0 6px; font-weight: 700; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.mrow:last-child { border-bottom: 0; }
.mrow .grow { flex: 1; min-width: 0; }
.mrow .n { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .sub { font-size: 12px; color: var(--muted); }
.mrow button.mini { padding: 5px 10px; font-size: 12px; }
.mrow .move { display: flex; gap: 4px; }
.mrow .move button { padding: 4px 8px; font-size: 12px; }
.colorpick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.colorpick .swatch { border-radius: 50%; }
.qr { display: block; width: 220px; max-width: 100%; margin: 6px auto; }
.linkbox { font-size: 12px; word-break: break-all; background: #f6f7f9; border-radius: 8px; padding: 8px 10px; color: #444; }

/* ─── ログイン・招待 ─── */
.center { max-width: 420px; margin: 0 auto; padding: 60px 20px 40px; text-align: center; }
.center .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 14px; display: block; }
.center h1 { font-size: 22px; margin-bottom: 6px; }
.center p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.linebtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px; border-radius: 10px; background: #06c755; color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; border: 0; }
.linebtn:active { background: #05a847; }
.center .card { text-align: left; }
