/* reminders/style.css — Tiresize.NET リマインダー（掲示板と同トーン） */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --text-soft: #5a6675;
  --border: #dfe5ec;
  --primary: #1a6ee0;
  --primary-press: #155bb8;
  --danger: #d23b3b;
  --ok-bg: #e6f6ec;
  --ok-text: #1d7a3e;
  --warn-bg: #fff4e0;
  --warn-text: #9a6208;
  --overdue-bg: #fde8e8;
  --overdue-text: #b32626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --surface: #1a212b;
    --text: #e6ebf2;
    --text-soft: #93a0b1;
    --border: #2c3644;
    --primary: #4d8df0;
    --primary-press: #3b78d6;
    --danger: #e05c5c;
    --ok-bg: #17351f;
    --ok-text: #6fd096;
    --warn-bg: #3a2d12;
    --warn-text: #e0b464;
    --overdue-bg: #3d1a1a;
    --overdue-text: #ef8a8a;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 56px; min-height: 60vh; }

/* ---------- ヘッダ・フッタ ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; padding-bottom: 14px;
}
.site-title { font-size: 17px; font-weight: 700; color: var(--text); }
.site-auth { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-link { font-size: 13px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 14px 0; font-size: 13px; color: var(--text-soft); }

/* ---------- タイトル ---------- */
.auth-handle { font-weight: 600; }
a.auth-handle { color: inherit; }
a.auth-handle:hover { color: var(--primary); }
.auth-logout { display: inline-flex; }
.login-card { max-width: 460px; }
.login-card input[type=email] { width: 100%; }
.login-desc { color: var(--text-soft); font-size: 14px; }
.login-dev-link { word-break: break-all; font-size: 13px; }
.merge-stats { font-size: 15px; }
.merge-stats strong { color: var(--primary); font-size: 16px; }
.back-line { margin: 0 0 10px; }
.page-desc { margin: 0 0 18px; color: var(--text-soft); font-size: 14px; }

/* ---------- ツールバー・フィルタ ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.search-form input[type=text] { flex: 1; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
  padding: 8px 12px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px;
}
.filter-label { color: var(--text-soft); margin-right: 2px; font-weight: 700; }
.node-stats { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.node-stats .st-over { color: var(--overdue-text); font-weight: 700; }
.fold-btns { display: inline-flex; gap: 4px; margin-left: 8px; }
.sort-label { margin-left: 14px; }
.filter-link { color: var(--text-soft); padding: 2px 6px; border-radius: 8px; }
.filter-link:hover { background: var(--bg); text-decoration: none; }
.filter-link.active { color: var(--primary); font-weight: 600; background: var(--bg); }

/* ---------- 階層ノード ---------- */
.tree { display: flex; flex-direction: column; gap: 12px; }
/* 管理対象なしセクション: 管理対象と同じノード箱（中性色・折りたたみ可） */
.node-orphan > .node-head { font-size: 15px; }
.node {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0 14px;
}
.node .node { margin: 10px 0 10px 8px; padding: 0 10px; }
.node-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 0; cursor: pointer; list-style: none; user-select: none;
}
.node-head::-webkit-details-marker { display: none; }
.node-head::before {
  content: "▾"; color: var(--text-soft); font-size: 12px; width: 12px; transition: transform .15s;
}
details:not([open]) > .node-head::before { transform: rotate(-90deg); }
.node-name { font-weight: 700; font-size: 16px; }
.node-item > .node-head, .node .node-item > .node-head { font-size: 15px; }
/* グループ見出し: 立体球体●＋色合い（グループの --g 色。NULL=既定 sandybrown） */
.node-sphere {
  flex: none; display: inline-block;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--g, #f4a460); /* フォールバック（radial-gradient/color-mix 非対応時） */
  background: radial-gradient(circle at 32% 28%,
      rgba(255, 255, 255, .9) 0%,
      var(--g, #f4a460) 45%,
      color-mix(in srgb, var(--g, #f4a460) 55%, #1c2430) 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .35), inset -1px -2px 3px rgba(0, 0, 0, .2);
}
.node-group > .node-head .node-sphere { width: 16px; height: 16px; }
.node-group {
  background: rgba(244, 164, 96, .2);   /* フォールバック（color-mix 非対応ブラウザ。既定 sandybrown 系） */
  background: color-mix(in srgb, var(--g, #f4a460) 20%, var(--surface));
  border-color: rgba(244, 164, 96, .5); /* フォールバック */
  border-color: color-mix(in srgb, var(--g, #f4a460) 50%, var(--border));
}
/* 空グループのヒント */
.empty-hint { padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty-text { color: var(--text-muted, #888); font-size: 13px; }
/* 上へ/下へ（表示順）ボタン */
.move-col { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.move-btns { display: flex; flex-direction: column; gap: 2px; }
.mv { display: block; margin: 0; }
.btn-move {
  width: 100%; min-width: 34px; padding: 1px 0; font-size: 10px; line-height: 1.5;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-soft); cursor: pointer; font-family: inherit;
}
.btn-move:hover { border-color: var(--primary); color: var(--text); }
.node-move { margin-left: auto; display: flex; flex-direction: column; gap: 2px; }
.node-move .btn-move { min-width: 26px; }

.color-pick { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text-soft); }
.color-pick input[type=color] {
  width: 36px; height: 30px; padding: 2px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer;
}

/* ---------- タスクカード ---------- */
.task {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.task-main { flex: 1; min-width: 240px; }
.task-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.task-name { font-weight: 600; }
.task-note { color: var(--text-soft); font-size: 13px; }
.task-head .hist-link { margin-left: auto; font-size: 13px; white-space: nowrap; font-weight: 500; }
.task-meta { color: var(--text-soft); font-size: 13.5px; margin-top: 1px; }
.task-actions { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- タイムライン ---------- */
.timeline { position: relative; height: 16px; margin: 4px 0 2px 2px; }
.timeline .track {
  position: absolute; left: 5px; right: 5px; top: 50%; height: 3px;
  background: var(--border); border-radius: 2px; transform: translateY(-50%);
}
.timeline .dot {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.dot-start { left: 5px; background: var(--text-soft); }
.dot-end   { left: calc(100% - 5px); background: var(--surface); border: 2px solid var(--text-soft); }
.timeline .now {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--surface);
  transform: translate(-50%, -50%); z-index: 1;
}

/* ---------- 通知・空状態 ---------- */
.notice-ok, .notice-error, .notice-empty { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.notice-ok    { background: var(--ok-bg); color: var(--ok-text); margin: 10px 0; }
.notice-error { background: var(--overdue-bg); color: var(--overdue-text); margin: 6px 0; }
.notice-empty { color: var(--text-soft); }
.count-line { color: var(--text-soft); font-size: 13.5px; margin: 4px 2px 12px; }

/* ---------- カード・フォーム ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 16px;
}
.card-title { margin: 2px 0 10px; font-size: 16px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.chk-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-soft); margin: 2px 0 10px; }

input[type=text], input[type=date], input[type=number], select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 14.5px;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-inline input[type=text], .form-inline select { flex: 0 1 auto; }

/* 期限方式の選択（経過日数管理 / 日付固定管理 / 期限なし）— 縦並びでラジオボタンを縦に揃える */
.sched { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; margin: 6px 0; }
.sched-opt { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--text); }
.sched-opt input[type=radio] { accent-color: var(--primary); margin: 0; flex: 0 0 auto; }
.sched-opt .iv { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--text-soft); font-size: 13.5px; }
.sched-opt .iv input[type=number] { width: 74px; padding: 5px 8px; font-size: 13.5px; }
.sched-opt .iv select { padding: 5px 6px; font-size: 13.5px; }
.sched-opt .fux { display: inline-flex; align-items: center; gap: 5px; }
/* 期限方式: 選択されていないradioの入力欄(.iv)を非表示（JS無効時のフォールバックは全表示） */
@supports selector(:has(*)) {
  .sched-opt:has(input[type=radio]:not(:checked)) .iv { display: none; }
}
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 14px; color: var(--text-soft); }
.form-row input { display: block; margin-top: 4px; width: 100%; max-width: 320px; }
.form-row select { display: inline-block; margin-top: 4px; max-width: 200px; }
.form-row .btn { margin-left: 10px; margin-top: 6px; }
.form-hint { color: var(--text-soft); font-size: 13px; margin: 8px 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block; padding: 7px 14px; border-radius: 9px;
  border: 1px solid transparent; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-align: center; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 13.5px; }
.move-form { margin: 2px 0 10px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-press); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--overdue-bg); }

/* ---------- 管理行 ---------- */
.manage-row { padding: 12px 0; border-top: 1px solid var(--border); }
.manage-row:first-of-type { border-top: none; }
.manage-row-main { margin-bottom: 8px; }
.manage-sub { color: var(--text-soft); font-size: 13.5px; margin-left: 8px; }
.manage-del { flex: 0 0 auto; }
/* 編集画面: 補足の下に[更新]と[タスクを削除]を1行に（補足と0.5行ほど間隔） */
.edit-actions { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 10px; }
.edit-actions .manage-edit { flex: 1 1 auto; row-gap: 12px; }
.edit-actions .manage-edit .note-field { flex: 1 1 100%; }
.edit-actions .manage-del { margin-left: auto; }

/* ---------- 編集画面: 一覧と同じツリー（manage.php） ---------- */
.node-meta-label { color: var(--text-soft); font-size: 13px; }
.node-edit { padding: 0 0 12px 26px; }
.m-task { padding: 10px 0 12px; border-top: 1px solid var(--border); }
.m-task > .task { padding-top: 0; border-top: none; }
.m-edit { padding: 2px 0 0 26px; display: flex; flex-direction: column; gap: 10px; }
.m-edit .rec-list { border-top: none; padding-top: 0; margin-top: 0; }

.task-info {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14.5px; margin-bottom: 16px;
}

/* ---------- モバイル ---------- */
@media (max-width: 560px) {
  .task { flex-direction: column; align-items: stretch; }
  .task-actions { justify-content: flex-start; }
  .filter-bar { gap: 4px 8px; }
  .form-inline { flex-direction: column; align-items: stretch; }
  .form-inline input, .form-inline select { width: 100%; }
}

/* ---------- 履歴リスト（管理画面・詳細画面） ---------- */
.rec-list { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; }
.rec-item { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.rec-date { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; min-width: 92px; }
.rec-memo { flex: 1; min-width: 120px; color: var(--text-soft); }
.rec-nomemo { opacity: .55; }
.rec-edit, .rec-del { margin-left: auto; }
.rec-edit summary, .rec-del summary {
  cursor: pointer; font-size: 12.5px; color: var(--primary); list-style: none;
  padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.rec-edit summary::-webkit-details-marker { display: none; }
.rec-del summary { color: var(--text-soft); }
.rec-del summary:hover { color: var(--danger); }
.rec-edit[open] form, .rec-del[open] form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.more-link { font-size: 13.5px; font-weight: 600; margin-top: 4px; }
.btn-xs { padding: 3px 9px; font-size: 12.5px; }

/* ---------- 統計・プロット ---------- */
.stats-line { color: var(--text-soft); font-size: 14px; margin: 2px 0 10px; }
.plot { width: 100%; height: auto; display: block; }
.plot-base { stroke: var(--border); stroke-width: 2; stroke-dasharray: 6 5; }
.plot-bar  { stroke: var(--primary); stroke-width: 5; stroke-linecap: round; }
.plot-tick { stroke: var(--border); stroke-width: 1.5; }
.plot-label { fill: var(--text-soft); font-size: 11px; font-family: inherit; }
.plot-today { stroke: var(--text-soft); stroke-width: 1.5; stroke-dasharray: 4 3; }
.plot-dot { fill: var(--primary); }
.plot-dot:hover { fill: var(--primary-press); }
.plot-due { fill: var(--surface); stroke: var(--text-soft); stroke-width: 2; }
.plot-due-over { stroke: var(--danger); }

/* ---------- タイムライン v2（今日中心ウィンドウ・スケール付き） ---------- */
.tl-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.tl-elapsed {
  min-width: 58px; font-weight: 700; font-size: 14.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tl { position: relative; flex: 1; height: 20px; }
.tl-base {
  position: absolute; left: 0; right: 0; top: 50%; height: 0;
  border-top: 2px dashed var(--border); transform: translateY(-50%);
}
.tl-bar {
  position: absolute; top: 50%; height: 5px; border-radius: 3px;
  background: var(--primary); transform: translateY(-50%);
}
.tl-dot {
  position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--text); transform: translate(-50%, -50%);
}
.tl-dot:hover { background: var(--text-soft); }
.tl-due {
  position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--text-soft);
  transform: translate(-50%, -50%);
}
.tl-due-over { border-color: var(--danger); }
.tl-now {
  position: absolute; top: 50%; width: 2px; height: 15px;
  background: var(--primary); transform: translate(-50%, -50%);
}
.due-over { color: var(--overdue-text); font-weight: 700; }

/* レジェンド */
.legend { font-size: 12.5px; color: var(--text-soft); margin: -6px 0 16px; }
.lg { display: inline-block; vertical-align: middle; margin-right: 4px; }
.lg-bar  { width: 18px; height: 5px; border-radius: 3px; background: var(--primary); }
.lg-dash { width: 18px; height: 0; border-top: 2px dashed var(--border); }
.lg-dot  { width: 9px; height: 9px; border-radius: 50%; background: var(--text); }
.lg-due  { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--text-soft); }

/* タイムラインの月変わり目（縦線＋月ラベル） */
.tl-row { margin-bottom: 18px; }
.tl { height: 22px; }
.tl-mark { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--text-soft); opacity: .75; }
.tl-mark-label {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 3px; font-size: 10.5px; color: var(--text-soft); white-space: nowrap;
}

/* タイムライン左端の月ラベル（ウィンドウ先頭が月の途中の場合） */
.scale-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 4px; }
.window-range { margin-left: 14px; font-size: 0.85em; color: var(--text-dim, #777); }

/* ---------- 通知（メール）トグル＋一覧のメールマーク（2026-10-24） ---------- */
.notify-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.notify-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 22px; transition: background .15s; cursor: pointer; }
.switch i:before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i:before { transform: translateX(18px); }
.notify-ic { display: inline-flex; align-items: center; margin-left: 4px; }
.notify-ic.on { color: var(--primary); }
.notify-ic.off { color: #c3cad4; }
@media (prefers-color-scheme: dark) { .notify-ic.off { color: #46536a; } }

/* ---------- マイページ: アカウント（メール）（2026-10-25） ---------- */
.acct-sub { font-size: 15px; margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.code-row label { display: inline-block; }
.code-row input[name=email] { display: inline-block; width: 240px; max-width: 100%; margin: 0 8px 0 0; vertical-align: middle; }
.code-row input[name=code] { display: inline-block; width: 84px; margin: 0 8px 0 0; vertical-align: middle; text-align: center; letter-spacing: 3px; }
.code-row .btn { vertical-align: middle; }
.backup-list { margin-top: 14px; }
.backup-item { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.backup-item .btn { margin-left: 0; }

.gear-link { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 18px; color: inherit; opacity: 0.65; text-decoration: none; border-radius: 50%; transition: opacity 0.15s, background 0.15s; }
.gear-link:hover { opacity: 1; background: var(--bg-hover, rgba(0,0,0,0.06)); }


/* ---------- 広告（AdSense・掲示板と同じスロット） ---------- */
/* レイアウトは崩さない: コンテナ860pxはそのまま中央寄せ、右レールは余白に配置 */
.ad-layout { position: relative; }
.ad-box { max-width: 100%; }
.ad-label { display: block; font-size: 11px; color: #999; margin-bottom: 3px; }
.ad-bottom { margin: 28px 0 8px; }
.ad-bottom ins.adsbygoogle { max-height: 150px; overflow: hidden; }
.ad-rail { display: none; }
@media (min-width: 1300px) {
  .ad-rail {
    display: block;
    position: absolute;
    top: 24px;
    left: calc(50% + 458px); /* コンテナ半幅430px ＋ 間隔28px */
    width: 180px;
  }
}
