/* Doreco 画面のデザイン（デザインC：緑・判子・押した感触） */
:root {
  --green: #00A83D;
  --btn: #007F2E;
  --btn-dark: #00692A;
  --lip: #004A1D;
  --forest: #003D1A;
  --paper: #F3F6F3;
  --mint: #E3F2E6;
  --mint2: #CFE8D6;
  --tile: #F2FAF3;
  --ink: #121613;
  --sub: #5B6360;
  --line: #DDE4DE;
  --line2: #C9D2CB;
  --red: #C8372D;
  --amber-bg: #FFF7E3;
  --amber: #8A5A00;
  --amber-ink: #3B2A00;
  --yellow: #FFC93C;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--btn-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.num { font-family: 'Oswald', 'Noto Sans JP', sans-serif; font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.black { font-weight: 900; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* 押した感触 */
.lip { transition: transform .07s ease-out, box-shadow .07s ease-out; }
.lip:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--lip) !important; }
.press { transition: transform .14s cubic-bezier(.3,1.7,.5,1); }
.press:active:not(:disabled) { transform: scale(.94); }
@keyframes stamp { 0% { transform: scale(2) rotate(-24deg); opacity: 0 } 55% { transform: scale(.9) rotate(-11deg); opacity: 1 } 75% { transform: scale(1.04) rotate(-12deg) } 100% { transform: scale(1) rotate(-12deg); opacity: 1 } }
@keyframes rise { 0% { transform: translateY(16px); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes drive { 0% { transform: translateX(-40px) } 100% { transform: translateX(0) } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes up { from { transform: translateY(100%) } to { transform: none } }
@keyframes spin { to { transform: rotate(360deg) } }
.stamp-anim { animation: stamp .55s cubic-bezier(.2,.9,.3,1.2) both; }
.rise { animation: rise .4s ease-out .35s both; }
.drive { animation: drive 1.2s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .stamp-anim, .rise, .drive { animation: none } .lip:active, .press:active { transform: none } }

/* 画面の枠 */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--paper); position: relative; }
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 6px; background: rgba(243,246,243,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 900; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--ink); }
.iconbtn:hover { background: rgba(0,0,0,.04); }
.body { flex: 1; padding: 16px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.sheet-body { padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 16px; }
.footer { position: sticky; bottom: 0; z-index: 5; padding: 10px 16px calc(14px + var(--safe-bottom)); background: linear-gradient(to top, #fff 78%, rgba(255,255,255,0)); display: flex; flex-direction: column; gap: 8px; }
.white { background: #fff; }

/* カード */
.card { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 1px 0 rgba(0,0,0,.04); border: 1px solid #E6ECE7; }
.card h2 { margin: 0 0 8px; font-size: 16px; font-weight: 900; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 900; }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 4px; border-bottom: 1px solid #EEF2EF; text-decoration: none; color: inherit; background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.list > .item:last-child { border-bottom: 0; }
.list > .item > .row { flex: 1; min-width: 0; }
.item .t { font-weight: 700; }
.item .s { font-size: 12px; color: var(--sub); }
.chev { color: #9AA49C; flex-shrink: 0; }
.kv { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--sub); }
.kv dd { margin: 0; word-break: break-word; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line2); background: #fff; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.btn.block { width: 100%; }
.btn.primary { border: 0; background: var(--green); color: #fff; font-size: 19px; font-weight: 900; letter-spacing: .04em; min-height: 58px; border-radius: 16px; box-shadow: 0 4px 0 var(--lip); }
.btn.green { border: 0; background: var(--btn); color: #fff; font-weight: 900; box-shadow: 0 4px 0 var(--lip); }
.btn.ghost { border-color: var(--line2); color: var(--btn-dark); }
.btn.danger { border: 0; background: var(--red); color: #fff; box-shadow: 0 4px 0 #7E1F18; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; }
.chip.big { flex: 1; min-height: 48px; font-size: 15px; border-radius: 24px; }
.chip[aria-pressed="true"] { border: 2px solid var(--btn-dark); background: var(--btn-dark); color: #fff; font-weight: 700; }
.chip.wide { width: 100%; border-radius: 12px; text-align: left; padding: 10px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.fill > .chip { flex: 1; }
.seg { display: flex; background: #E9EEEA; border-radius: 12px; padding: 4px; gap: 4px; }
.seg > button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 700; color: var(--sub); }
.seg > button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* 入力 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 700; }
.field .help { font-size: 12px; color: var(--sub); }
.field .err { font-size: 13px; color: var(--red); font-weight: 700; }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
.textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.input.num-input { font-family: 'Oswald', 'Noto Sans JP', sans-serif; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.suffix { position: relative; }
.suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--sub); font-size: 14px; pointer-events: none; }
.note { background: var(--amber-bg); color: var(--amber-ink); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.note.green { background: #E9F6EC; color: #1C3B25; }
.note.red { background: #FCE9E7; color: #6E1A13; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos .ph { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #E9EEEA; border: 1px solid var(--line); }
.photo-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px dashed #9AA49C; border-radius: 12px; background: var(--paper); font-size: 14px; color: var(--ink); width: 100%; }

/* メーター */
.meter { position: relative; display: flex; align-items: center; gap: 10px; background: var(--ink); border-radius: var(--radius); padding: 10px 12px; }
.meter .digits { display: flex; gap: 4px; }
.meter .d { width: 34px; height: 46px; border-radius: 6px; background: #2A302B; color: #fff; font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 500; display: flex; align-items: center; justify-content: center; }
.meter .d.zero { color: #7E877F; }
.meter .d.hi { background: #F4FBF5; color: var(--ink); }
.meter .unit { color: #B9C2BA; font-size: 12px; line-height: 1.4; }
.meter .unit b { color: #7FE3A0; }
.meter input { position: absolute; inset: 0; opacity: 0; width: 100%; border: 0; font-size: 16px; }
.meter.focus { box-shadow: 0 0 0 3px var(--green); }

/* 下から出る画面 */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(18,22,19,.45); display: flex; flex-direction: column; justify-content: flex-end; animation: fade .15s ease-out; }
.sheet { background: #fff; border-radius: 24px 24px 0 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 10px 18px calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; animation: up .22s cubic-bezier(.2,.8,.2,1); max-width: 560px; width: 100%; margin: 0 auto; }
.sheet .grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line); flex-shrink: 0; }
.sheet h2 { margin: 0; font-size: 18px; font-weight: 900; }

/* お知らせ */
/* 真ん中に出す（動きの指定で横の位置がずれないよう、translateX を使わない）。下の固定ボタン・メニューより上に出す */
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; bottom: calc(96px + var(--safe-bottom)); z-index: 80; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: rise .25s ease-out both; }
.toast.err { background: var(--red); }
.banner { background: var(--amber-bg); color: var(--amber-ink); padding: 8px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.banner.offline { background: #2A302B; color: #fff; }
.banner.info { background: #E8F1FB; color: #1D3F66; }
.banner.warn { background: var(--amber-bg); color: var(--amber-ink); }
.banner .grow { flex: 1; }
.banner-x { background: none; border: 0; font-size: 18px; line-height: 1; color: inherit; padding: 0 4px; cursor: pointer; }

/* 判子 */
.hanko { width: 152px; height: 152px; border-radius: 76px; border: 6px solid var(--red); color: var(--red); display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-12deg); background: rgba(255,255,255,.6); }
.hanko .top { font-size: 13px; font-weight: 700; border-bottom: 2px solid var(--red); padding: 0 10px 2px; }
.hanko .mid { font-size: 40px; font-weight: 900; line-height: 1.15; }
.hanko .bot { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600; border-top: 2px solid var(--red); padding: 2px 10px 0; }
.dots { display: flex; justify-content: center; gap: 5px; }
.dots span { width: 16px; height: 16px; border-radius: 8px; background: var(--line); }
.dots span.on { background: var(--green); }
.dots span.off { background: #fff; border: 2px solid var(--line); }

/* ホーム */
.hero { position: relative; overflow: hidden; background: var(--mint); padding: 18px 18px 22px; }
.hero h1 { margin: 2px 0 0; font-size: 22px; font-weight: 900; line-height: 1.35; color: var(--forest); position: relative; }
.hero .date { font-size: 13px; color: #2E5E3A; position: relative; }
.big-money { font-size: 40px; line-height: 1.05; }
.progress { height: 12px; border-radius: 6px; background: #E3EBE5; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green), var(--btn-dark)); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles .tl { min-height: 92px; border: 0; border-radius: 16px; background: var(--tile); color: var(--forest); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; text-decoration: none; padding: 8px 4px; text-align: center; }
.tiles .tl.on { background: var(--btn); color: #fff; font-weight: 900; }
.tiles .tl svg { width: 44px; height: 38px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber-ink); text-decoration: none; font-size: 13px; }
.notice.overdue { background: #FCE9E7; color: #6E1A13; }
.notice.info { background: #EEF4F0; color: #24402D; }
.notice + .notice { margin-top: 6px; }

/* カレンダー */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 0; }
.cal .wd { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0; }
.cal .wd.sun { color: #B4372E; } .cal .wd.sat { color: #2F5E9E; }
.cal .c { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; border: 2px solid transparent; border-radius: 12px; background: transparent; padding: 3px 0 0; }
.cal .c[aria-current="true"] { border-color: var(--btn-dark); background: #F1FAF3; }
.cal .c .n { font-size: 12px; line-height: 1; }
.cal .c .b { width: 30px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; }
.b.done { border: 2px solid var(--red); color: var(--red); background: #fff; transform: rotate(-12deg); }
.b.stopped { border: 2px solid var(--red); color: var(--red); background: #fff; }
.b.miss { background: #FFD66B; color: #5C3B00; }
.b.off { background: #E3E8E3; color: var(--sub); }
.b.today { border: 2px solid var(--green); background: #E2F4E8; color: var(--btn-dark); }
.b.future { border: 1px dashed #C9D2CB; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--sub); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 6px; vertical-align: -2px; margin-right: 3px; }

/* グラフ */
.chart { width: 100%; height: auto; display: block; }
.bar-label { font-size: 10px; fill: var(--sub); }

/* 読み込み中 */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 0; color: var(--sub); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.empty { text-align: center; color: var(--sub); padding: 28px 12px; font-size: 14px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .ev { position: relative; padding: 4px 0 10px; }
.timeline .ev::before { content: ''; position: absolute; left: -17px; top: 9px; width: 10px; height: 10px; border-radius: 5px; background: #fff; border: 2px solid var(--green); }
.timeline .ev.wait::before { border-color: var(--amber); background: #FFD66B; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11px; font-weight: 700; background: #EEF4F0; color: #24402D; }
.tag.red { background: #FCE9E7; color: #6E1A13; }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.green { background: #E2F4E8; color: var(--btn-dark); }
hr.sep { border: 0; border-top: 1px solid #EEF2EF; margin: 4px 0; }

/* プロの入口（ぼかして見せる） */
.blur { filter: blur(5px); user-select: none; pointer-events: none; }
.locked { position: relative; }
.lockbadge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; background: #003D1A; color: #fff; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.teaser { border: 1.5px dashed #9BCFAA; background: linear-gradient(180deg, #F4FBF6, #fff); }
.teaser .t { font-weight: 900; color: var(--forest); }
.plan-card { border: 1px solid #E6ECE7; border-radius: 18px; background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.reco { border: 2px solid var(--green); box-shadow: 0 6px 18px rgba(0,104,42,.12); }
.plan-card .price { display: flex; align-items: baseline; gap: 6px; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.ribbon { align-self: flex-start; background: var(--yellow); color: #3B2A00; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 6px; }
.legal-items { display: grid; grid-template-columns: 8.5em 1fr; gap: 6px 10px; font-size: 13px; background: #F7FAF8; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.legal-items dt { font-weight: 700; color: var(--forest); }
.legal-items dd { margin: 0; }

/* 会社の管理（パソコンでも見やすく） */
body.wide #app { max-width: 1120px; }
body.wide .sheet { max-width: 640px; }
.cnav { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 9; scrollbar-width: none; }
.cnav::-webkit-scrollbar { display: none; }
.cnav a { flex-shrink: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--sub); text-decoration: none; white-space: nowrap; }
.cnav a[aria-current="page"] { background: var(--btn-dark); color: #fff; }
.cnav .dot { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; text-align: center; margin-left: 4px; padding: 0 4px; }
.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid #E6ECE7; background: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; color: var(--sub); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #F7FAF8; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #EEF2EF; vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #F4FBF6; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.counts > div { background: #fff; border: 1px solid #E6ECE7; border-radius: 14px; padding: 10px 12px; }
.counts .n { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 600; line-height: 1.1; }
.counts .l { font-size: 12px; color: var(--sub); }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.state i { width: 9px; height: 9px; border-radius: 5px; display: inline-block; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } body.wide .body { padding: 20px 24px 32px; } }
.qrbox { display: flex; flex-direction: column; align-items: center; gap: 14px; background: #fff; border-radius: 24px; padding: 24px; border: 1px solid #E6ECE7; }
.qrbox svg { width: 240px; height: 240px; }
.match { font-family: 'Oswald', sans-serif; font-size: 56px; font-weight: 600; letter-spacing: .08em; color: var(--forest); line-height: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--btn-dark); }
.strike { text-decoration: line-through; color: var(--sub); font-weight: 400; }
/* 数字のカードを2列に（スマホでも） */
.stats2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats2 > .card { margin: 0; }
.bullet svg { flex-shrink: 0; margin-top: 2px; color: #00A83D; }

/* 1日のメモ */
.cal .c { position: relative; }
.cal .c .memo { position: absolute; top: 3px; right: 5px; width: 8px; height: 8px; border-radius: 4px; background: #2F6FB8; }
.legend i.memo { width: 8px; height: 8px; background: #2F6FB8; }
.memo-card { display: flex; flex-direction: column; gap: 6px; background: #EEF4FB; border-radius: 12px; padding: 10px 12px; color: #17304D; text-decoration: none; }
.memo-card .t { font-size: 13px; line-height: 1.6; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.memo-text { white-space: pre-wrap; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ph.sm { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #E9EEEA; border: 1px solid var(--line); }
input[type=checkbox], input[type=radio] { flex-shrink: 0; }
