* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
       background: #f4f6f8; color: #222; padding-bottom: 84px; }
.topbar { position: sticky; top: 0; background: #2f5d3a; color: #fff; padding: 10px 14px;
          display: flex; justify-content: space-between; align-items: center; z-index: 10; }
.appname { font-weight: bold; font-size: 17px; }
.name-change-link { font-size: 13px; font-weight: normal; white-space: nowrap; }
.section-title { margin-top: 2px; }
.shift-table-img { max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 6px; }
input[type=month], input[type=file] { width: 100%; padding: 10px; font-size: 16px;
  border: 1px solid #bbb; border-radius: 8px; margin-top: 4px; background: #fff; }
main { max-width: 640px; margin: 0 auto; padding: 14px; }
h1 { font-size: 20px; margin: 6px 0 12px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.card { background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,.08); display: block; }
label { display: block; margin: 10px 0; font-size: 14px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 10px; font-size: 16px; border: 1px solid #bbb; border-radius: 8px; margin-top: 4px; }
button { padding: 10px 14px; font-size: 15px; border: 1px solid #999; background: #fff;
         border-radius: 8px; cursor: pointer; }
button.primary { background: #2f5d3a; color: #fff; border-color: #2f5d3a; width: 100%; margin-top: 8px; }
form.inline { display: inline-block; }
.linklike { border: none; background: none; color: #2f5d3a; padding: 4px; font-size: 14px; }
.error { background: #fdecea; color: #a33; padding: 10px; border-radius: 8px; }
.ok { background: #e7f6e7; color: #256029; padding: 10px; border-radius: 8px; }
.hint { color: #666; font-size: 13px; }
.stat-grid { display: grid; gap: 10px; }
.stat { text-decoration: none; color: #222; text-align: center; }
.stat-num { display: block; font-size: 34px; font-weight: bold; }
.stat-num.warn { color: #c0392b; }
.stat-label { font-size: 13px; color: #555; }
.entry-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.badge { background: #eef2ee; border-radius: 999px; padding: 2px 8px; }
.author { color: #555; }
.entry-body { white-space: pre-wrap; margin: 8px 0; font-size: 15px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.entry-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.readers { color: #666; font-size: 13px; margin: 6px 0 0; overflow-wrap: break-word; }
.done-btn { background: #2f5d3a; color: #fff; border-color: #2f5d3a; }
.item-head { display: flex; justify-content: space-between; align-items: center; }
.item-name { font-weight: bold; font-size: 16px; }
.item-meta { color: #555; font-size: 13px; }
.level-overdue { border-left: 6px solid #c0392b; }
.level-today { border-left: 6px solid #e67e22; }
.level-soon { border-left: 6px solid #f1c40f; }
.level-ok { border-left: 6px solid #2ecc71; }
.level-unknown { border-left: 6px solid #bbb; }
.level-badge-overdue { background: #fdecea; color: #a33; }
.level-badge-today { background: #fdf0e2; color: #b35c00; }
.level-badge-soon { background: #fef9e0; color: #7a6400; }
.level-badge-ok { background: #e7f6e7; color: #256029; }
.level-badge-unknown { background: #eee; color: #555; }
.stat-num.level-overdue { color: #c0392b; }
.stat-num.level-today, .stat-num.level-soon { color: #e67e22; }
.linklist { list-style: none; padding: 0; }
.linklist li { margin: 6px 0; }
.linklist a { color: #2f5d3a; font-size: 15px; }
.kindcounts { margin: 4px 0; }
fieldset { border: 1px solid #ccc; border-radius: 8px; margin: 10px 0; }
.check { display: inline-block; margin: 4px 8px 4px 0; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #ddd;
          display: flex; justify-content: space-around; padding: 10px 2px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabbar a { color: #2f5d3a; text-decoration: none; font-size: 13px; font-weight: bold; white-space: nowrap; }

/* 初回の名前選択カード */
.name-card { border: 2px solid #2f5d3a; }
.name-card-title { font-size: 17px; font-weight: bold; margin: 4px 0 10px; }
.name-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.name-btn { padding: 16px 10px; font-size: 18px; font-weight: bold; border: 1px solid #2f5d3a;
            color: #2f5d3a; background: #eef5ee; border-radius: 10px; }

/* ホーム: 今日の予定 */
.today-line { color: #555; margin: 0 0 10px; font-size: 15px; }
.today-plan .plan-row { margin: 8px 0; font-size: 15px; }
.plan-label { font-weight: bold; margin-right: 6px; }
.plan-note { margin: 2px 0 10px; font-size: 13px; }
.plan-note a { color: #2f5d3a; }
.muted { color: #999; }
.warn-num { color: #c0392b; }
.plan-row.due { padding: 4px 8px; border-radius: 6px; }
.plan-row.due a { color: #222; font-weight: bold; }

/* 財布管理 */
.balance-card { text-align: center; border: 2px solid #2f5d3a; }
.balance-label { display: block; font-size: 13px; color: #555; }
.balance-num { display: block; font-size: 36px; font-weight: bold; color: #2f5d3a; }
.wallet-main { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 4px; gap: 8px; }
.wallet-title { font-size: 15px; }
.wallet-amount { font-size: 17px; font-weight: bold; white-space: nowrap; }
.wallet-amount.in { color: #256029; }
.wallet-amount.out { color: #c0392b; }
.badge.wallet-in { background: #e7f6e7; color: #256029; }
.badge.wallet-out { background: #fdecea; color: #a33; }

/* シフトカレンダー */
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-title { font-size: 17px; font-weight: bold; }
.cal { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden;
       box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal th { background: #eef2ee; font-size: 12px; padding: 6px 0; color: #555; }
.cal td { border-top: 1px solid #eee; width: 14.28%; vertical-align: top; padding: 0; }
.cal-empty { background: #fafafa; }
.cal-today { background: #fdf6e0; }
.cal-link { display: block; padding: 5px 4px 6px; text-decoration: none; color: #222; min-height: 64px; }
.cal-date { display: block; font-size: 13px; font-weight: bold; margin-bottom: 2px; }
.cal-today .cal-date { color: #b35c00; }
.cal-shift { display: block; font-size: 10px; line-height: 1.5; color: #333; word-break: break-all; }
.cal-shift.night { color: #445; }

details.card summary { cursor: pointer; font-weight: bold; }

/* 日付タブ */
.date-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.date-tabs a { padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid #ccc;
               color: #222; text-decoration: none; font-size: 14px; }
.date-tabs a.active { background: #2f5d3a; color: #fff; border-color: #2f5d3a; }
.date-tabs .cnt { background: #eef2ee; border-radius: 999px; padding: 0 7px; font-size: 12px; color: #333; }
.date-tabs a.active .cnt { background: rgba(255,255,255,.25); color: #fff; }

/* 編集リンク・削除ボタン */
a.btnlike { display: inline-block; padding: 10px 14px; font-size: 15px; border: 1px solid #999;
            background: #fff; border-radius: 8px; color: #222; text-decoration: none; }
button.danger { color: #a33; border-color: #d3a1a1; }
.thumb-sm { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

/* 実績時間 (計算専用) */
.time-pair { display: flex; gap: 8px; }
.time-pair label { flex: 1; margin-top: 4px; }
.drive-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.drive-row input[type=time] { flex: 1; min-width: 0; }
.drive-row button { white-space: nowrap; }
.work-result-card { border: 2px solid #2f5d3a; }
.work-result { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0; }
.work-result-label { font-size: 17px; font-weight: bold; }
.work-result-num { font-size: 34px; font-weight: bold; color: #2f5d3a; }
#reset-btn { width: 100%; margin-top: 10px; }

/* 操作ログ */
.log-detail { margin: 6px 0 2px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.log-ip { margin: 0; color: #888; font-size: 12px; }
.log-action { background: #e7f0e7; }
