/* =========================================================
   Mikan — flat design
   ルール：ドロップシャドウ禁止 / パレット外の色・透過・ブレンド禁止
   ライト：#fffffe #eff0f3 #0d0d0d #2a2a2a #ff8e3c #d9376e
   ダーク：#2b2a4c #232241 #37355f #3c3a67（オレンジに合う青紫・少し明るめ） #fffffe #a7a9be #ff8e3c（ライトと同じ） #e53170
   ========================================================= */
:root {
  --bg: #fffffe;        /* メイン面 */
  --side: #eff0f3;      /* サイドバー */
  --panel: #f7f7f9;     /* ポップアップ：サイドバーより薄く、白より濃い */
  --side-hover: #e3e4e9; /* サイドバーのホバー（少し濃いグレー） */
  --side-active: #ffeadb; /* サイドバーのアクティブ（薄いオレンジ） */
  --backdrop: rgba(13, 13, 13, .45); /* ポップアップ表示中に後ろを暗くする */
  --input-line: #dcdde2;  /* ポップアップの入力欄の線 */
  --input-line-focus: #b4b6bf;
  --muted: #8e9099;      /* 説明文などの薄いグレー */
  --fill: #eff0f3;      /* 入力・ホバー・トラック */
  --line: #eff0f3;      /* 区切り線・カード枠 */
  --frame: #0d0d0d;     /* モーダル枠・選択枠 */
  --text: #0d0d0d;      /* Headline */
  --sub: #2a2a2a;       /* Paragraph */
  --accent: #ff8e3c;    /* Button / Highlight */
  --on-accent: #fffffe; /* オレンジ背景の上の文字は白 */
  --danger: #d9376e;    /* Tertiary */
  --plus-fg: #fffffe;   /* ＋ボタンの白十字 */
  --logo-text: #000000;
  --logo-leaf: #262626;
  --radius: 10px;
  --w-narrow: 860px;  /* 通常ページの本文幅 */
  --w-wide: 1240px;   /* カレンダーなど広いページの本文幅 */
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2b2a4c; --side: #232241; --panel: #232241; --side-hover: #312f55; --side-active: #3a2733; --backdrop: rgba(10, 9, 24, .55); --input-line: #4a4877; --input-line-focus: #6c6aa2; --muted: #9e9dbc; --logo-text: #fffffe; --logo-leaf: #fffffe; --fill: #37355f; --line: #3c3a67; --frame: #a7a9be;
    --text: #fffffe; --sub: #a7a9be; --accent: #ff8e3c; --on-accent: #fffffe; --danger: #e53170;
   
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2b2a4c; --side: #232241; --panel: #232241; --side-hover: #312f55; --side-active: #3a2733; --backdrop: rgba(10, 9, 24, .55); --input-line: #4a4877; --input-line-focus: #6c6aa2; --muted: #9e9dbc; --logo-text: #fffffe; --logo-leaf: #fffffe; --fill: #37355f; --line: #3c3a67; --frame: #a7a9be;
  --text: #fffffe; --sub: #a7a9be; --accent: #ff8e3c; --on-accent: #fffffe; --danger: #e53170;
 
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.75;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--text); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sub); outline-offset: 2px; }

/* ===== Layout ===== */
.app { display: flex; height: 100dvh; }
.main { flex: 1; overflow-y: auto; min-width: 0; background: var(--bg); }
.view { max-width: calc(var(--w-narrow) + 80px); margin: 0 auto; padding: 40px 40px 120px; }
.view.wide { max-width: calc(var(--w-wide) + 80px); }

/* ===== Sidebar ===== */
.sidebar { width: 268px; flex-shrink: 0; background: var(--side); display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 4px 24px 10px; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo .logo { height: 28px; width: auto; display: block; stroke: none; }
/* ロゴの色：オレンジは固定、文字と葉はテーマに合わせる（ダークでは白） */
.logo .lg-orange { fill: #ff8e3c; }
.logo .lg-text { fill: var(--logo-text); }
.logo .lg-leaf { fill: var(--logo-leaf); }

.add-task-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; margin: 0;
  border-radius: 8px; background: transparent; font-weight: 700; font-size: 14px; color: var(--accent);
  transition: background-color .2s ease, transform .15s ease;
}
.add-task-btn:hover { background: var(--side-hover); }
.add-task-btn .plus-dot { --size: 20px; }
.add-task-btn:active { transform: scale(.98); }
.add-task-btn kbd {
  margin-left: auto; font: inherit; font-size: 11px; font-weight: 700; color: var(--sub);
  border: 1.5px solid var(--sub); border-radius: 6px; min-width: 22px; height: 22px; display: grid; place-items: center;
}

/* ＋ボタン：オレンジの円に白十字 */
.plus-dot { --size: 22px; width: var(--size); height: var(--size); border-radius: 50%; background: var(--accent); color: var(--plus-fg); display: inline-grid; place-items: center; flex-shrink: 0; }
.plus-dot svg { width: calc(var(--size) * .74); height: calc(var(--size) * .74); stroke-width: 2; }
.plus-dot.sm { --size: 20px; }
.plus-dot svg { transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
/* ホバー：十字がくるっと90°回る */
.add-task-btn:hover .plus-dot svg, .add-inline:hover .plus-dot svg, button.plus-dot:hover svg, .btn:hover .plus-dot svg { transform: rotate(90deg); }

.nav { list-style: none; margin: 4px 0; padding: 0; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; color: var(--text); transition: background-color .2s ease, color .2s ease; }
.nav-item svg { color: var(--sub); transition: color .2s ease; }
.nav-item:hover, .account:hover { background: var(--side-hover); }
.nav-item.active, .nav-item.active:hover { background: var(--side-hover); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--sub); font-weight: 400; }
.nav-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-head { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 4px 4px 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--sub); transition: background-color .2s ease; }
.nav-head:hover { background: var(--side-hover); }
.nh-actions { display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .2s ease; }
.nav-head:hover .nh-actions, .nav-head:focus-within .nh-actions { opacity: 1; }
.nh-btn { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--sub); }
.nh-btn svg { width: 16px; height: 16px; }
.nh-toggle svg { transition: transform .2s ease; }
.nav-head.collapsed .nh-toggle svg { transform: rotate(-90deg); }
@media (hover: none) { .nh-actions { opacity: 1; } }
.nav-head-link { transition: color .2s ease; display: inline-flex; align-items: center; gap: 2px; flex: 1; text-align: left; font-weight: 700; font-size: 12.5px; color: var(--sub); padding: 3px 6px 3px 0; border-radius: 6px; }
.nav-head-link svg { width: 14px; height: 14px; }
.nav-head:hover .nav-head-link, .nav-head-link.active { color: var(--text); }
.side-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 11.5px; color: var(--sub); }
.side-foot > button { color: var(--sub); text-decoration: underline; font-size: 11.5px; }
.theme-switch { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 2px; margin-bottom: 10px; }
.theme-switch button { padding: 3px 10px; border-radius: 6px; font-size: 11.5px; color: var(--sub); }
.theme-switch button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* ===== Buttons ===== */
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--sub); }
.sidebar .icon-btn { transition: background-color .2s ease, color .2s ease; }
.sidebar .icon-btn:hover { background: var(--side-hover); }
.btn { white-space: nowrap; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: var(--fill); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.outline { border: 2px solid var(--line); color: var(--text); font-weight: 500; padding: 5px 12px; }

/* ===== Page header ===== */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.page-sub { color: var(--sub); font-size: 13px; margin-bottom: 24px; }
.progress { display: flex; align-items: center; gap: 12px; margin: 14px 0 28px; }
.bar { flex: 1; height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--sub); transition: width .4s ease; }
.progress .pct { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }

/* ===== Task list ===== */
.section-title { font-size: 13px; font-weight: 700; margin: 22px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 15px; height: 15px; color: var(--sub); }
.section-title.over { color: var(--danger); }
.section-title .n { color: var(--sub); font-weight: 400; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; padding: 11px 6px; border-bottom: 2px solid var(--line); cursor: pointer; align-items: flex-start; }
.check { width: 20px; height: 20px; border-radius: 50%; margin-top: 1px; border: 1.5px solid var(--sub); display: grid; place-items: center; color: transparent; flex-shrink: 0; background: transparent; }
.check svg { width: 12px; height: 12px; stroke-width: 2.2; }
.task.done .check { background: var(--sub); border-color: var(--sub); color: var(--bg); }
.task-body { flex: 1; min-width: 0; }
.task-title { word-break: break-word; }
.task.done .task-title { color: var(--sub); text-decoration: line-through; }
.task-note { color: var(--sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 12px; color: var(--sub); }
.task-meta:empty { display: none; }
.task-meta svg, .proj-tag svg { width: 13px; height: 13px; }
.assignee { display: inline-flex; align-items: center; gap: 4px; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due.is-today { color: var(--text); font-weight: 700; }
.due.over { color: var(--danger); font-weight: 700; }
.task.done .due { color: var(--sub); font-weight: 400; }
.proj-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--sub); }
.add-inline { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 6px; color: var(--sub); }
.add-inline .plus-dot { --size: 20px; }
.show-done { margin-top: 18px; color: var(--sub); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.empty { text-align: center; color: var(--sub); padding: 48px 0 16px; }
.empty .mark { width: 56px; height: 56px; border-radius: 50%; background: var(--fill); color: var(--text); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .mark svg { width: 26px; height: 26px; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

/* ===== Forms ===== */
.add-form { border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; background: var(--bg); }
.add-form:focus-within { border-color: var(--input-line-focus); }
.add-form input[name=title] { width: 100%; border: 0; outline: 0; font-size: 15px; font-weight: 700; background: transparent; padding: 4px 0; }
.add-form textarea { width: 100%; border: 0; outline: 0; resize: none; font-size: 13px; background: transparent; color: var(--sub); padding: 2px 0 6px; }
.add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.field-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; color: var(--sub); background: var(--fill); }
.field-chip svg { width: 14px; height: 14px; }
.field-chip input, .field-chip select { border: 0; outline: 0; background: transparent; font-size: 12.5px; color: var(--text); padding: 0; }
.field-chip select option { background: var(--bg); color: var(--text); }
.field-chip input[type=date] { min-width: 104px; }
.add-foot { display: flex; gap: 8px; justify-content: flex-end; border-top: 2px solid var(--line); margin-top: 10px; padding-top: 10px; }
.text-input { width: 100%; border: 2px solid var(--fill); border-radius: 8px; padding: 8px 12px; outline: 0; background: var(--fill); }
.text-input:focus { border-color: var(--input-line-focus); }
.form-label { font-size: 12px; font-weight: 700; color: var(--sub); display: block; margin: 14px 0 6px; }

/* ===== Projects list ===== */
.proj-tabs { margin-bottom: 8px; }
.proj-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.proj-tabs svg { width: 14px; height: 14px; }
.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-row { display: flex; align-items: center; gap: 16px; padding: 14px 8px; border-bottom: 2px solid var(--line); cursor: pointer; }
.proj-main { flex: 1; min-width: 0; }
.proj-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.proj-name svg { width: 16px; height: 16px; color: var(--sub); }
.proj-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 0 0 24px; font-size: 12px; color: var(--sub); }
.proj-meta .over { color: var(--danger); font-weight: 700; }
.proj-progress { display: flex; align-items: center; gap: 8px; width: 150px; }
.proj-progress b { font-size: 12px; font-variant-numeric: tabular-nums; width: 34px; text-align: right; }
.proj-row.archived .proj-name { color: var(--sub); }
.archived-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: -12px 0 18px; border-radius: var(--radius); background: var(--fill); font-size: 13px; color: var(--text); }
.archived-note svg { color: var(--sub); }
.archived-note span { flex: 1; }

/* ===== Avatars ===== */

/* ===== Members ===== */
.mtable { border-top: 2px solid var(--line); }
.mrow { display: grid; grid-template-columns: minmax(200px, 1fr) repeat(4, 76px) 150px; align-items: center; gap: 8px; padding: 12px 8px; border-bottom: 2px solid var(--line); cursor: pointer; }
.mrow.mhead { cursor: default; padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--sub); }
.mrow.mhead span:not(:first-child) { text-align: center; }
.mname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mname > span { display: flex; flex-direction: column; min-width: 0; }
.mname b { font-size: 14px; }
.mname small { font-size: 11.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mnum { text-align: center; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mnum.over { color: var(--danger); }
.mnum .zero { color: var(--sub); font-weight: 400; }
.mprog { display: flex; align-items: center; gap: 8px; }
.mprog b { font-size: 12px; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0 10px; }
.stat { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 13px; color: var(--sub); }
.stat > span { font-size: 12px; color: var(--sub); }
.stat.over b, .stat.over > span { color: var(--danger); }
.stat .bar { flex: none; height: 5px; margin-top: 8px; }

/* ===== Calendar ===== */
.segment { display: inline-flex; background: var(--fill); border-radius: 8px; padding: 3px; }
.segment button { padding: 5px 12px; border-radius: 6px; font-size: 12.5px; color: var(--sub); }
.segment button.on { background: var(--bg); color: var(--text); font-weight: 700; }
body.cal-mode .main { overflow: hidden; display: flex; flex-direction: column; }
body.cal-mode #view { flex: 1; min-height: 0; }
.cal-view { height: 100%; max-width: calc(var(--w-wide) + 56px); margin: 0 auto; padding: 32px 0 0; display: flex; flex-direction: column; }
.cal-top, .cal-bar { padding: 0 28px; }
.cal-top h1 { font-size: 24px; font-weight: 700; margin: 0; }
.cal-desc { font-size: 13px; color: var(--sub); margin-top: 4px; }
.cal-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.cal-bar .grow { flex: 1; }
.cal-month { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-month b { font-weight: 700; }
.tool-btn, .tool-group { height: 34px; border: 2px solid var(--line); border-radius: 9px; background: var(--bg); }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.tool-btn svg { width: 16px; height: 16px; color: var(--sub); }
.tool-btn select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 180px; }
.tool-btn select option { background: var(--bg); }
.tool-btn.on, .tool-btn.open { background: var(--fill); }
.tool-btn.on svg { color: var(--text); }
.tool-btn .n { font-size: 11px; font-weight: 700; color: var(--sub); }
.tool-group { display: inline-flex; align-items: stretch; overflow: hidden; }
.tool-group button { display: grid; place-items: center; padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.tool-group .tool-icon { padding: 0 7px; color: var(--sub); }
.tool-group .tool-icon svg { width: 16px; height: 16px; }
.tool-group .tool-text { border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
.tool-group.seg button + button { border-left: 2px solid var(--line); }
.tool-group.seg button { color: var(--sub); }
.tool-group.seg button.on { color: var(--text); background: var(--fill); }

.menu-wrap { position: relative; }
/* 選択欄の共通ボタン */
.dd-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); max-width: 100%; }
.dd-btn > svg:last-child { width: 14px; height: 14px; color: var(--sub); transition: transform .2s ease; }
.dd-btn.open > svg:last-child { transform: rotate(180deg); }
.dd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-chip.dd-btn { font-size: 12.5px; font-weight: 500; }
.field-chip.dd-btn.open { background: var(--fill); }
.prop-btn { height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; }
.prop-btn.open { background: var(--fill); }
.prop-value .dd { display: inline-block; max-width: 100%; }
.add-foot-left { margin-right: auto; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; max-width: 320px; max-height: 320px; overflow-y: auto;
  background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 6px;
  animation: menu-in .16s cubic-bezier(.2, .8, .2, 1);
}
.menu-label { font-size: 11px; font-weight: 700; color: var(--sub); padding: 6px 10px 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13px; text-align: left; color: var(--text); }
.menu.up { animation-name: menu-up; }
@keyframes menu-up { from { transform: translateY(4px); } }
.menu-item { cursor: pointer; }
.menu-item > svg:first-child { width: 15px; height: 15px; color: transparent; stroke-width: 1.8; }
.menu-item.on > svg:first-child { color: var(--text); }
.menu-item .lead { display: inline-flex; align-items: center; color: var(--sub); font-style: normal; }
.menu-item .lead svg { width: 15px; height: 15px; }
.menu-item.on span { font-weight: 700; }
.menu-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item small { font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.menu-sep { height: 2px; background: var(--line); margin: 4px 6px; }
@keyframes menu-in { from { transform: translateY(-4px); } }
.cal-body { flex: 1; min-height: 0; display: flex; padding: 0 28px; }  /* 左右に余白を取り、帯がサイドバーと接しないように */
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-main .wd-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cal-main .wd-row div { text-align: center; font-size: 12px; color: var(--sub); padding: 6px 0 8px; }
.cal-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cal-scroll { position: relative; }
.cal-scroll .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; align-content: start; min-height: 120px; padding-bottom: 6px; border-bottom: 1px solid var(--line); } /* タスクの数に合わせて縦に伸びる */
.day { grid-row: 1 / -1; border-right: 1px solid var(--line); padding: 6px 8px 0; text-align: right; cursor: pointer; min-width: 0; }
.day[style*="grid-column:7"] { border-right: 0; }
.dnum { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 2px; font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; transition: color .25s ease, opacity .25s ease; white-space: nowrap; }
.day.today .dnum { background: var(--accent); color: var(--plus-fg) !important; border-radius: 12px; padding: 0 7px; font-weight: 700; }
/* タスクの帯：オレンジは使わず、グレーの面＋チェックボックスと同じリングで状態を表す */
.chip {
  position: relative; z-index: 1; align-self: start; cursor: pointer;
  font-size: 11.5px; line-height: 20px; height: 20px; padding: 0 6px; margin: 0 4px; border-radius: 5px;
  background: var(--fill); color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 完了：塗りをやめて枠線だけ＋取り消し線（未完了＝塗り、完了＝枠） */
.chip.over { color: var(--danger); font-weight: 700; }
.chip.done { background: transparent; color: var(--sub); text-decoration: none; border: 1.5px solid var(--fill); line-height: 17px; box-sizing: border-box; }
.more { position: relative; z-index: 1; font-size: 11px; color: var(--sub); padding: 0 8px; pointer-events: none; align-self: start; text-align: right; }

.undated { width: 300px; flex-shrink: 0; border-left: 1px solid var(--line); overflow-y: auto; padding: 4px 16px 24px; }
.undated-head { display: flex; align-items: center; gap: 8px; height: 40px; font-size: 13px; font-weight: 700; }
.undated-head .grow { flex: 1; }
.undated-head .n { color: var(--sub); font-weight: 400; }
.undated .proj-tag { margin-left: 0; }
.undated-empty { font-size: 12.5px; color: var(--sub); padding: 16px 0; }


/* ===== Panel（ポップアップ）=====
   PC・タブレット：画面中央に表示 / スマホ：下からのシート
   表示中は後ろのレイヤーをすべて暗くする（影は使わない） */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade-in .2s ease; }
.panel {
  --fill: var(--side); /* パネル内の選択中・ホバー面 */
  position: relative; width: min(600px, 100%); max-height: min(86dvh, 780px);
  display: flex; flex-direction: column; background: var(--bg); border-radius: 16px; overflow: hidden;
  animation: panel-in .22s cubic-bezier(.2, .8, .2, 1);
}
.panel.wide { width: min(880px, 100%); height: min(86dvh, 640px); }
.panel.still { animation: none; }
.panel-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; height: 64px; padding: 8px 20px 0 36px; flex-shrink: 0; }
.panel-head .grow, .panel-foot .grow { flex: 1; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--sub); }
.crumb svg { width: 14px; height: 14px; }
.crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 36px 32px; }
.panel-foot { display: flex; align-items: center; gap: 8px; padding: 18px 36px; flex-shrink: 0; border-top: 2px solid var(--line); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.panel-title { font-size: 24px; font-weight: 700; line-height: 1.3; margin: 4px 0 2px; display: flex; align-items: baseline; gap: 10px; }
.panel-title small { font-size: 13px; font-weight: 500; color: var(--sub); }
.panel-meta { font-size: 12px; color: var(--sub); margin-top: 18px; }
.panel-input { display: block; width: 100%; border: 1.5px solid var(--input-line); background: transparent; border-radius: 10px; outline: 0; font-size: 18px; font-weight: 700; padding: 10px 14px; margin-bottom: 10px; color: var(--text); }
.panel-input::placeholder, .detail-title::placeholder { color: var(--sub); }
.detail-head { display: flex; gap: 12px; align-items: flex-start; padding: 0 0 10px; border: 0; cursor: default; }
.detail-head .check { margin-top: 7px; width: 22px; height: 22px; }
.detail-title { flex: 1; border: 1.5px solid var(--input-line); background: transparent; border-radius: 10px; outline: 0; resize: none; overflow: hidden; font-size: 18px; font-weight: 700; line-height: 1.45; padding: 10px 14px; color: var(--text); }
.detail-head.done .detail-title { color: var(--sub); text-decoration: line-through; }
.note-box { display: block; width: 100%; min-height: 96px; border: 1.5px solid var(--input-line); background: transparent; border-radius: 10px; outline: 0; resize: vertical; padding: 12px 14px; font-size: 13.5px; color: var(--text); }
.note-box::placeholder { color: var(--sub); }
.props { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.prop { display: flex; align-items: center; min-height: 42px; gap: 12px; }
.prop-label { display: inline-flex; align-items: center; gap: 8px; width: 116px; flex-shrink: 0; font-size: 12.5px; color: var(--sub); }
.prop-label svg { width: 15px; height: 15px; }
.prop-value { flex: 1; min-width: 0; }
.prop-value select, .prop-value input {
  width: 100%; max-width: 260px; height: 36px; padding: 0 10px; border: 2px solid transparent; border-radius: 8px;
  background: transparent; outline: 0; font-size: 13.5px; color: var(--text); cursor: pointer;
  appearance: none; -webkit-appearance: none; transition: background-color .15s;
}
.prop-value select option { background: var(--bg); color: var(--text); }
.prop-value select:focus, .prop-value input:focus { background: var(--bg); border-color: var(--input-line-focus); }
.prop-value input.over { color: var(--danger); font-weight: 700; }
.prop-text { display: inline-block; padding: 0 12px; font-size: 13.5px; }
.icon-btn.danger { color: var(--danger); }
.panel .add-form { border-color: var(--input-line); }
.panel .add-form:focus-within { border-color: var(--input-line-focus); }

@keyframes panel-in { from { transform: translateY(12px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 14px 10px 18px; border-radius: 10px; display: flex; align-items: center; gap: 16px; font-size: 13px; animation: up .2s ease; }
.toast button { color: var(--bg); font-weight: 700; text-decoration: underline; }

@keyframes up { from { transform: translate(-50%, 8px); } }

/* ===== Mobile ===== */
.topbar, .bottom-nav, .home-tabs { display: none; }

@media (max-width: 768px) {
  .view, .view.wide { padding: 8px 16px calc(110px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--bg); padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; }
  .topbar-title { font-weight: 700; font-size: 15px; visibility: hidden; }
  .main.scrolled .topbar-title { visibility: visible; }
  .main.scrolled .topbar { border-bottom: 2px solid var(--line); }

  /* スマホではサイドメニューを使わない（下メニュー＋上部の通知・設定） */
  .sidebar { display: none; }
  /* ホームの上部メニュー：ページ内の切り替えボタンとは別の、下線のタブ。画面のいちばん上に固定 */
  body.home-mode .topbar { display: none; }
  .home-tabs { display: flex; position: sticky; top: 0; z-index: 10; margin: -8px -16px 18px; padding: env(safe-area-inset-top) 8px 0; background: var(--bg); border-bottom: 1.5px solid var(--line); }
  .home-tabs button { position: relative; flex: 1; padding: 13px 4px 12px; font-size: 14px; color: var(--sub); white-space: nowrap; }
  .home-tabs button.on { color: var(--text); font-weight: 700; }
  .home-tabs button.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1.5px; height: 2.5px; border-radius: 2px; background: var(--text); }
  .set-tabs { margin: 4px 0 18px; }
  .set-page .set-group:first-of-type { margin-top: 0; }

  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 2px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-width: 0; font-size: 10px; letter-spacing: .02em; color: var(--sub); padding: 4px 0; white-space: nowrap; }
  .bottom-nav button > svg { width: 24px; height: 24px; }
  .bottom-nav button.on { color: var(--text); font-weight: 700; }
  .bottom-nav button.on svg { color: var(--text); }
  .bottom-nav .bn-add { color: var(--accent); font-weight: 700; }
  .bottom-nav .bn-add .plus-dot { --size: 24px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  .page-head h1 { font-size: 24px; }
  .page-head .btn.outline { padding: 5px 10px; font-size: 12px; }
  .page-head .btn.outline > span { display: none; }
  .proj-row { flex-wrap: wrap; gap: 8px 12px; padding: 14px 2px; }
  .proj-main { flex-basis: 100%; }
  .proj-progress { flex: 1; width: auto; margin-left: 24px; }
  .task { padding: 13px 2px; }
  .task-title { font-size: 15px; }

  .cal-view { padding-top: 4px; }
  .cal-top, .cal-bar { padding: 0 16px; }
  .cal-bar { gap: 6px; margin: 12px 0 6px; }
  .cal-month { order: -2; flex: 1; font-size: 16px; }
  .cal-bar .grow { display: none; }
  .cal-bar .tool-group:not(.seg) { order: -1; }
  .cal-bar .menu-wrap { flex: 1; min-width: 0; order: 1; }
  .cal-bar .menu-wrap > .tool-btn { width: 100%; }
  .cal-bar .menu-wrap > .tool-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
  .cal-scroll { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .cal-body { padding: 0 12px; }
  .cal-scroll .week { height: 84px; row-gap: 2px; }
  /* 2週間表示：2行で画面を埋め、帯にタスク名を出す */
  .cal-view.view { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* カレンダーは上下に動かさない（横スワイプはアプリ側で処理） */
  body.cal-mode .cal-view { touch-action: none; overscroll-behavior: none; }
  .cal-two { flex: 1; min-height: 0; display: flex; flex-direction: column; touch-action: none; }
  .cal-two.slide-next { animation: slide-next .25s ease; }
  .cal-two.slide-prev { animation: slide-prev .25s ease; }
  .cal-two .week { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; align-content: start; border-bottom: 1px solid var(--line); overflow: hidden; }
  .cal-two .chip { height: 18px; line-height: 18px; margin: 0 1px; padding: 0 3px; font-size: 10px; border-radius: 4px; background: var(--fill); }
  .cal-two .chip.over { background: var(--fill); }
  .cal-two .chip.done { background: transparent; border: 1.5px solid var(--fill); line-height: 15px; height: 18px; }
  .cal-two .chip-proj { display: none; }
  .cal-filter-btn { width: 38px; height: 34px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 9px; color: var(--text); }
  .cal-filter-btn svg { width: 20px; height: 20px; }
  .day { padding: 4px 3px 0; text-align: center; }
  .dnum { font-size: 12px; min-width: 22px; height: 22px; }
  .day.today .dnum { padding: 0 6px; }
  .chip { height: 5px; line-height: 5px; padding: 0; margin: 0 2px; font-size: 0; border-radius: 3px; background: var(--sub); }
  .chip.over { background: var(--danger); }
  .chip.done { background: var(--fill); border: 0; height: 5px; }
  .more { font-size: 10px; padding: 0; text-align: center; }
  .mrow { grid-template-columns: 1fr 52px 52px; padding: 12px 2px; }
  .mrow > :nth-child(4), .mrow > :nth-child(5), .mrow > :nth-child(6) { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* 画面全体は動かさず、中の一覧（.main やシートの中身）だけをスクロールさせる */
  html, body { overflow: hidden; overscroll-behavior: none; }
  .main, .panel-body, .task-main, .task-side, .menu { overscroll-behavior: contain; }
  #modal { place-items: end stretch; padding: 0; }
  .modal-backdrop { touch-action: none; }
  .panel, .panel.wide { width: 100%; height: auto; max-height: 90dvh; border-radius: 18px 18px 0 0; animation: sheet-in .3s cubic-bezier(.2, .8, .2, 1); }
  .panel::before { content: ""; display: block; flex-shrink: 0; width: 36px; height: 4px; border-radius: 4px; background: var(--sub); margin: 8px auto 0; }
  .panel-head { height: 48px; padding-left: 20px; }
  .panel-body { padding: 0 20px 20px; }
  .prop-label { width: 100px; }
  .prop-value select, .prop-value input { max-width: none; font-size: 16px; }
  input[type=date], .add-form input[name=title], .text-input, .note-box { font-size: 16px; }
}

/* パネル内のメニューは本体の面色で */
.panel .menu { background: var(--bg); border-color: var(--line); }
.panel .menu-sep { background: var(--line); }

/* ===== Memo（プロジェクトのメモ）===== */
.memo { margin: -8px 0 8px; }
.memo-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.memo-label svg { width: 14px; height: 14px; }
.memo-box { display: block; width: 100%; min-height: 64px; resize: none; overflow: auto; border: 2px solid var(--fill); border-radius: 12px; background: var(--fill); padding: 10px 14px; font-size: 13.5px; line-height: 1.65; color: var(--text); outline: 0; }
.memo-box::placeholder { color: var(--sub); }
.note-box.tall { min-height: 200px; line-height: 1.65; }
.memo-box:focus-visible, .note-box:focus-visible { outline: none; }

/* ===== Sections ===== */
.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.sec-head h2 { font-size: 16px; font-weight: 700; margin: 0; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-head .grow { flex: 1; }
.sec-toggle { width: 24px; height: 24px; margin-left: -4px; display: grid; place-items: center; color: var(--sub); border-radius: 6px; }
.sec-toggle svg { width: 16px; height: 16px; }
.sec-count { font-size: 12px; color: var(--sub); }
.sec-prog { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; margin-right: 2px; }
.sec-prog .bar { width: 72px; flex: none; height: 4px; }
.sec-head .icon-btn { width: 28px; height: 28px; }
.sec.collapsed .sec-head { border-bottom-color: var(--line); }
.sec-note { display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; margin: 10px 0 2px; padding: 10px 12px; border-radius: 10px; background: var(--fill); font-size: 12.5px; line-height: 1.6; color: var(--sub); }
.sec-note svg { width: 14px; height: 14px; margin-top: 2px; }
.sec-note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.sec-add { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding: 10px 0; font-weight: 700; color: var(--sub); }
.sec-add svg { width: 16px; height: 16px; }
.sec-add-form { display: flex; gap: 8px; margin-top: 28px; align-items: center; }
.sec-add-form .text-input { flex: 1; }

/* ===== Datepicker ===== */
.dp-menu { width: 288px; min-width: 288px; max-height: none; padding: 6px; }
.dp-btn.empty .dd-label { color: var(--sub); }
.dp-btn.over .dd-label { color: var(--danger); font-weight: 700; }
.dp-head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 4px 10px; font-size: 13px; }
.dp-head b { font-weight: 700; }
.dp-head .grow { flex: 1; }
.dp-nav { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--sub); }
.dp-nav svg { width: 16px; height: 16px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2px 4px 4px; }
.dp-wd { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0; }
.dp-day { height: 34px; border-radius: 50%; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.dp-day.out { color: var(--sub); opacity: .4; }
.dp-day.today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.dp-day.sel { background: var(--text); color: var(--bg); font-weight: 700; opacity: 1; text-decoration: none; }
.dp-menu .menu-item small { margin-left: auto; }

@media (max-width: 768px) {
  .sec-prog .bar { display: none; }
  .dp-menu { width: 280px; min-width: 280px; }
}

/* ===== Section drag ===== */
.sec-grip { width: 20px; height: 24px; margin-left: -24px; display: grid; place-items: center; color: var(--sub); cursor: grab; touch-action: none; flex-shrink: 0; }
.sec-grip svg { width: 16px; height: 16px; }
.sec { position: relative; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
/* プロジェクトの並び替え（一覧のつまみ・サイドメニュー） */
.proj-row, #sidebar .np { transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.proj-row { position: relative; }
.proj-row.dragging, #sidebar .np.dragging { transition: none; z-index: 5; }
.proj-row.dragging { background: var(--bg); }
#sidebar .np.dragging { background: var(--side); border-radius: 8px; }
/* 行をそのままドラッグするので、文字が選択されないようにする */
.proj-list > .proj-row[data-drag], .srows > .srow[data-drag] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.sec.dragging { transition: none; z-index: 5; background: var(--bg); }
.sec.dragging .sec-head { border-bottom-color: var(--input-line-focus); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
@media (max-width: 768px) {
  .sec-grip { margin-left: -4px; }
}

/* ===== Inline title / breadcrumbs ===== */
.title-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0; font-size: 22px; font-weight: 700; color: var(--text); text-overflow: ellipsis; }
.title-input:focus { text-overflow: clip; }
.title-input:focus-visible { outline: none; }
.crumbs { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 12.5px; color: var(--sub); min-width: 0; }
.crumbs > svg { width: 14px; height: 14px; flex-shrink: 0; }
.crumbs button { display: inline-flex; align-items: center; gap: 4px; color: var(--sub); font-weight: 700; min-width: 0; }
.crumbs button svg { width: 14px; height: 14px; }
.crumbs button span, .crumb-here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.outline.danger { color: var(--danger); }
.sec-head h2 { cursor: pointer; }
@media (max-width: 768px) {
  .title-input { font-size: 24px; }
  .page-head .btn.outline { padding: 6px 8px; }
}

/* 日付ポップアップ内のその日のタスク */
.panel-list { margin-top: 24px; }
.panel-list-head { font-size: 12.5px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.panel-list-head span { color: var(--sub); font-weight: 400; margin-left: 4px; }
.panel .tasks .task { border-bottom-color: var(--line); }

/* アーカイブ済みのセクション */
.arch-toggle { margin-top: 28px; }
.arch-toggle svg + svg { width: 14px; height: 14px; }
.arch-list { list-style: none; margin: 8px 0 0; padding: 0; }
.page-tabs + .arch-title { margin-top: 14px; }
.arch-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 2px solid var(--line); cursor: pointer; }
.arch-name { font-weight: 700; color: var(--sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-row small { flex: 1; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* カレンダーの帯：タスク名の横にプロジェクト名 */
.chip-proj { margin-left: 6px; font-size: 10.5px; font-weight: 400; color: var(--sub); text-decoration: none; }
.chip.done .chip-proj { text-decoration: none; }

/* サイドバー左下：設定 */
.account { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 9px 10px; border-radius: 8px; text-align: left; color: var(--text); font-size: 14px; transition: background-color .2s ease, color .2s ease; }
.account svg { color: var(--sub); }
.account.active, .account.active:hover { background: var(--side-hover); }

/* 設定ページ */
.set-group { margin-top: 28px; }
.set-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 2px solid var(--line); font-size: 13.5px; font-weight: 700; }
.set-head small { font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; border-radius: 10px; background: var(--input-line); transition: background .2s ease; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); transition: transform .2s ease; }
.switch.on { background: var(--text); }
.switch.on::after { transform: translateX(16px); }
.set-title { font-size: 13px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 8px 0; border-bottom: 2px solid var(--line); font-size: 13.5px; }
.set-row.top { align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
.set-label { color: var(--sub); flex-shrink: 0; }
.set-form { display: flex; gap: 8px; align-items: center; }
.set-form .text-input { width: 280px; }
.set-stack { display: grid; gap: 8px; width: 340px; }
.set-error { font-size: 12px; color: var(--danger); font-weight: 700; }
@media (max-width: 768px) {
  .set-row { flex-wrap: wrap; }
  .set-form, .set-stack { width: 100%; }
  .set-form .text-input { width: auto; flex: 1; min-width: 0; }
}
.assignee { display: inline-flex; align-items: center; }
.dd-prefix { color: var(--sub); font-weight: 400; }
.modal-backdrop.still { animation: none; }

/* 設定ポップアップ：左メニュー＋右コンテンツ */
.set-layout { display: grid; grid-template-columns: 220px 1fr; height: 100%; min-height: 0; }
.set-nav { background: var(--side); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.set-nav-title { font-size: 15px; font-weight: 700; padding: 6px 10px 14px; }
.set-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; color: var(--text); font-size: 14px; transition: background-color .2s ease; }
.set-nav-item svg { color: var(--sub); }
.set-nav-item:hover, .set-nav-item.active { background: var(--side-hover); }
.set-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.set-main .panel-body { padding-top: 0; }
.set-main-title { font-size: 16px; }
.set-main .set-group:first-child { margin-top: 0; }
.set-main .set-group { margin-top: 8px; }
.set-main .text-input { border: 1.5px solid var(--input-line); background: transparent; border-radius: 8px; }
@media (max-width: 768px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; padding: 8px 12px 0; background: transparent; }
  .set-nav-title { display: none; }
  .set-nav-item { width: auto; }
  .set-main { background: transparent; }
}

.panel-input:focus-visible, .detail-title:focus-visible { outline: none; }

/* ポップアップの入力欄：線のみ。フォーカスは線を少し濃く（オレンジにはしない） */
.panel-input:focus, .detail-title:focus, .note-box:focus, .set-main .text-input:focus { border-color: var(--input-line-focus); }

/* メモの高さ変更つまみ（マウス・タッチ共通） */
.memo-resize { height: 14px; margin-top: 2px; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.memo-resize::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: var(--input-line); transition: background-color .2s ease; }
.memo-resize:hover::before { background: var(--input-line-focus); }
body.is-resizing, body.is-resizing * { cursor: ns-resize !important; user-select: none; -webkit-user-select: none; }

/* ===== タスクのポップアップ：2カラム ===== */
.panel.task-panel { width: min(920px, 100%); height: min(86dvh, 640px); }
.task-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; }
.task-main { overflow-y: auto; padding: 8px 36px 28px; min-width: 0; }
.task-side { background: var(--side); overflow-y: auto; padding: 8px 24px 24px; border-left: 1px solid var(--line); }
.task-panel .panel-head { border-bottom: 1px solid var(--line); height: 60px; padding-top: 0; }
.task-panel .task-main { padding-top: 24px; }
.task-panel .task-side { padding-top: 16px; }
.side-prop { padding: 12px 0; border-bottom: 1px solid var(--input-line); }
.side-label { font-size: 12px; font-weight: 700; color: var(--sub); margin-bottom: 4px; }
.side-value { margin-left: -10px; }
.side-value .dd { display: block; }
.side-value .prop-btn { width: 100%; justify-content: flex-start; }
.side-value .prop-btn > svg:last-child { margin-left: auto; }
.task-side .prop-btn.open { background: transparent; }

/* サブタスク */
.subtasks { margin-top: 22px; }
.sub-head { font-size: 13px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.sub-head span { font-size: 12px; font-weight: 400; color: var(--sub); }
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sub .check { width: 18px; height: 18px; margin: 0; }
.sub.done .check { background: var(--sub); border-color: var(--sub); color: var(--bg); }
.sub.done .sub-title { color: var(--sub); text-decoration: line-through; }
.sub-title { flex: 1; min-width: 0; word-break: break-word; }
.sub-del { width: 24px; height: 24px; display: grid; place-items: center; color: var(--sub); border-radius: 6px; }
.sub-del svg { width: 14px; height: 14px; }
.sub-add { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--sub); cursor: text; }
.sub-add svg { width: 18px; height: 18px; color: var(--sub); }
.sub-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--text); padding: 0; }
.sub-input::placeholder { color: var(--sub); }
.sub-count { display: inline-flex; align-items: center; gap: 3px; }

@media (max-width: 768px) {
  .panel.task-panel { height: auto; }
  .task-cols { grid-template-columns: 1fr; overflow-y: auto; }
  .task-main, .task-side { overflow: visible; }
  .task-main { padding: 12px 20px 16px; }
  .task-panel .task-main { padding-top: 12px; }
  .task-side { border-left: 0; border-top: 1px solid var(--line); padding: 4px 20px 16px; }
  .task-panel .panel-head { border-bottom: 0; }
}

/* ===== プロジェクト／セクションページ：左右分割 ===== */
.view.split { max-width: 1240px; display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 0 56px; align-items: start; }
.split-left { position: sticky; top: 0; padding-top: 0; }
.split-left .page-head { flex-wrap: wrap; row-gap: 10px; }
.split-left .page-head .title-input { flex-basis: 100%; }
.split-left .page-head .actions { margin-left: 0; }
.split-left .memo { margin-top: 4px; }
.split-left .memo-box { min-height: 160px; }
.split-right { min-width: 0; }
.split-title { font-size: 13px; font-weight: 700; color: var(--sub); margin: 6px 0 4px; }
.split-title span { font-weight: 400; margin-left: 4px; }
.split-right .sec:first-of-type, .split-right .loose-tasks + .sec { margin-top: 12px; }
.loose-tasks { margin-top: 12px; }
.loose-head { font-size: 14px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--line); }

/* タスク一覧：サブタスクの折りたたみ */
.subs-btn, .subs-btn-space { width: 20px; height: 20px; margin: 1px -6px 0 -4px; flex-shrink: 0; }
.subs-btn { display: grid; place-items: center; color: var(--sub); border-radius: 6px; }
.subs-btn svg { width: 14px; height: 14px; transition: transform .2s ease; }
.subs-btn.open svg { transform: rotate(90deg); }
.task-subs { list-style: none; border-bottom: 2px solid var(--line); padding: 2px 0 6px 52px; }
.task-subs ul { list-style: none; margin: 0; padding: 0; }
.task-subs .sub { border-bottom: 0; padding: 5px 0; font-size: 13px; }

@media (max-width: 1000px) {
  .view.split { grid-template-columns: 1fr; gap: 0; }
  .split-left { position: static; }
  .split-left .memo-box { min-height: 64px; }
  .split-right { margin-top: 20px; }
}

/* 選択メニューからの新規作成 */
.menu-create { display: flex; gap: 6px; padding: 6px; }
.menu-create-input { flex: 1; min-width: 0; height: 32px; border: 1.5px solid var(--input-line); border-radius: 8px; padding: 0 10px; background: transparent; outline: 0; font-size: 13px; color: var(--text); }
.menu-create-input:focus { border-color: var(--input-line-focus); }
.menu-create .btn { padding: 0 12px; height: 32px; }
.menu-create-open .lead svg { color: var(--sub); }

/* ===== プロジェクトページ（1カラム） ===== */
.proj-page { max-width: calc(var(--w-narrow) + 80px); }
.page-top { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; min-height: 100px; padding: 0 20px 0 24px; background: var(--bg); }
.page-top + .proj-page { padding-top: 4px; }
.page-top .crumbs { margin: 0; }
.page-top .actions { margin-left: auto; display: flex; gap: 6px; }
.proj-headline { cursor: pointer; border-radius: 10px; padding: 6px 0 2px; }
.proj-headline:not([data-act]) { cursor: default; }
.proj-title { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.35; word-break: break-word; }
.proj-desc { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-desc.is-empty { font-style: normal; }
.proj-loose { margin-top: 14px; }
.proj-loose .add-inline { padding-left: 0; }
.proj-secs { margin-top: 18px; }
.proj-page .sec { margin-top: 18px; }
.proj-page .sec-head { gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.proj-page .sec-head { position: relative; }
.proj-page .sec-toggle { position: absolute; left: -30px; top: 0; width: 24px; margin: 0; }
.proj-page .sec-toggle svg { transition: transform .2s ease; transform: rotate(90deg); }
.proj-page .sec.collapsed .sec-toggle svg { transform: none; }
.proj-page .sec-grip { position: absolute; left: -54px; top: 0; margin: 0; }
.proj-page .sec-head h2 { font-size: 15px; }
.proj-page .sec.collapsed .sec-head { border-bottom-color: var(--line); }
.act-btn > svg:last-child { transform: none !important; }
.act-btn { width: 32px; height: 30px; color: var(--text); }
.act-btn svg, .act-btn.dd-btn > svg:last-child { width: 22px; height: 20px; color: var(--sub); }
.act-menu { min-width: 200px; }
.act-menu .menu-item .lead { width: 16px; }
.menu-item.danger, .menu-item.danger .lead { color: var(--danger); }
.proj-page .sec-add { margin-top: 22px; }
.proj-page .arch-toggle { margin-top: 18px; }

/* 編集ポップアップ（名前・説明） */
.edit-form .panel-head { border-bottom: 1px solid var(--line); height: 60px; padding-top: 0; }
.panel-head-title { font-size: 17px; }
.edit-form .panel-body { padding-top: 18px; }
.edit-form .form-label { font-size: 13px; color: var(--text); margin: 4px 0 8px; }
.edit-form .form-label + .count-wrap, .edit-form .count-wrap + .form-label { margin-top: 0; }
.count-wrap { position: relative; margin-bottom: 18px; }
.line-input { width: 100%; height: 44px; border: 1.5px solid var(--input-line); border-radius: 8px; padding: 0 64px 0 14px; background: transparent; outline: 0; font-size: 15px; color: var(--text); }
.line-input:focus { border-color: var(--input-line-focus); }
.count-num { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); }
@media (max-width: 768px) {
  .page-top { position: static; padding: 4px 16px; min-height: 40px; }
  /* スマホはつまみと開閉の矢印を出さず、行の長押しで並び替え */
  .proj-page .sec .sec-head { padding-left: 0; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .proj-page .sec-toggle { display: none; }
  .proj-page .sec-grip { display: none; }
}
@media (max-width: 768px) { .page-top .btn.outline > span { display: none; } .page-top .btn.outline { padding: 6px 8px; } }

/* セクション行：名前の直下に説明（1行で省略） */
.proj-page .sec-head { align-items: center; padding: 6px 0 12px; }
.proj-page .sec-toggle, .proj-page .sec-grip { top: 50%; transform: translateY(-50%); margin-top: -3px; }
.sec-titles { flex: 1; min-width: 0; cursor: pointer; }
.sec-titles h2 { font-size: 15px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-desc { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* セクションのその場編集 */
.sec.editing { padding: 6px 0 14px; border-bottom: 1px solid var(--line); }
.sec-edit { display: grid; gap: 8px; }
.line-input.bold { font-weight: 700; padding-right: 14px; }
.sec-edit .note-box { min-height: 140px; line-height: 1.7; }
.sec-edit-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.btn.plain { color: var(--sub); background: none; }

/* 小さい文字は字間をたっぷり取る */
body { letter-spacing: .01em; }
.page-sub, .proj-desc, .sec-desc, .task-meta, .task-note, .panel-meta, .side-label, .form-label, .menu-label,
.nav-head, .nav-item .count, .section-title, .crumbs, .crumb, .show-done, .count-num, .sec-count, .sec-prog,
.proj-meta, .mrow small, .mrow.mhead, .stat > span, .cal-desc, .wd-row div, .more, .chip, .chip-proj,
.field-chip, .menu-item small, .side-foot, .undated-head, .set-label, .dp-wd, .memo-label, .prop-label,
.toast, .panel-list-head, .sub-head { letter-spacing: .04em; }

/* 並び替えアイコンはホバー時のみ */
.sec-grip { opacity: 0; transition: opacity .2s ease; }
.sec-head:hover .sec-grip, .sec.dragging .sec-grip { opacity: 1; }
@media (hover: none) { .sec-grip { opacity: 1; } }

/* オレンジ以外の主ボタン（保存など）。オレンジはタスク追加など大事な操作だけ */
.btn.neutral { background: var(--side-hover); color: var(--text); }

/* 行間をたっぷり */
.task-title { line-height: 1.7; }
.task-meta { line-height: 1.7; margin-top: 4px; }
.task-note, .proj-desc, .sec-desc, .page-sub { line-height: 1.8; }
.note-box, .memo-box, .detail-note { line-height: 1.9; }
.detail-done { margin: 10px 0 8px; padding: 6px 14px 6px 11px; }
.detail-done svg { width: 16px; height: 16px; }
.detail-done.is-done { color: var(--sub); }
.page-head h1, .proj-title, .cal-top h1, .panel-input, .detail-title { line-height: 1.45; }
.task { padding-top: 13px; padding-bottom: 13px; }
.proj-page .sec { margin-top: 22px; }

/* サイドバー：プロジェクトのセクション折りたたみ */
.np { position: relative; }
.np-toggle { position: absolute; right: 4px; top: 5px; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: var(--sub); opacity: 0; transition: opacity .2s ease; }
.np-toggle svg { width: 16px; height: 16px; transition: transform .2s ease; }
.np.open > .np-toggle svg { transform: rotate(90deg); }
.np:has(> .nav-item:hover, > .np-toggle:hover) > .np-toggle, .np-toggle:focus-visible { opacity: 1; }
/* 矢印だけでなく行全体をホバー表示にする */
.np:has(> .nav-item:hover, > .np-toggle:hover) > .nav-item { background: var(--side-hover); }
.np.has-secs:has(> .nav-item:hover, > .np-toggle:hover) > .nav-item .count { visibility: hidden; }
.sub-nav { margin: 2px 0 4px; padding: 0; }
.nav-item.nav-sub { padding: 6px 10px 6px 38px; font-size: 13px; border: 0; }
@media (hover: none) { .np-toggle { opacity: 1; } .np.has-secs > .nav-item .count { visibility: hidden; } }

.crumbs .crumb-sep { color: var(--muted); margin: 0 2px; }
.crumbs .crumb-here { color: var(--text); font-weight: 700; }
.crumbs button span { font-weight: 500; }
.proj-desc.is-empty { color: var(--muted); }

/* ロゴ右：通知・メニュー折りたたみ */
.brand-actions { margin-left: auto; display: flex; align-items: center; gap: 0; }
.brand-actions .icon-btn { width: 34px; height: 34px; color: var(--sub); transition: background-color .2s ease; }
.brand-actions .icon-btn:hover { background: var(--side-hover); color: var(--sub); }
.brand-actions .icon-btn svg { width: 22px; height: 22px; }
.bell-btn { position: relative; justify-content: center; padding: 0; gap: 0; }
.bell-btn.dd-btn > svg:last-child { transform: none !important; width: 22px; height: 22px; color: var(--sub); }
.bell-dot { position: absolute; top: 5px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--side); }
/* 通知のポップアップ */
.ntf-panel { width: min(680px, 100%); height: min(86dvh, 720px); }
.ntf-head { height: 76px; padding-top: 12px; gap: 4px; }
.ntf-title { font-size: 24px; font-weight: 700; margin: 0; line-height: 1.3; }
.ntf-head .icon-btn svg { width: 19px; height: 19px; }
.ntf-body { padding-top: 4px; }
.ntf-list { display: flex; flex-direction: column; }
.ntf-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.ntf-text b { font-weight: 700; }
.ntf-meta { font-size: 12px; color: var(--sub); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntf-time { font-size: 12px; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }
.ntf { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 16px 4px; border-bottom: 2px solid var(--line); text-align: left; }
.ntf:last-child { border-bottom: 0; }
.ntf-empty { padding: 48px 0; font-size: 13px; color: var(--muted); text-align: center; letter-spacing: .04em; }
@media (max-width: 768px) {
}
.set-note { font-size: 12.5px; color: var(--muted); text-align: right; }
/* カレンダーの表示切り替えシート（スマホ） */
.cal-sheet { padding-top: 0; }
.sheet-label { margin: 20px 0 2px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.sheet-label:first-child { margin-top: 0; }
.sheet-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 4px; border-bottom: 2px solid var(--line); font-size: 14.5px; text-align: left; color: var(--text); }
.sheet-opt svg { width: 18px; height: 18px; flex-shrink: 0; visibility: hidden; }
.sheet-opt.on svg { visibility: visible; }
.sheet-opt.on span { font-weight: 700; }
.sheet-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-opt small { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.sheet-opt.link { padding-left: 32px; }
.sheet-opt.link svg { visibility: visible; color: var(--sub); }

/* サイドバーを折りたたむ（PC・タブレット） */
.side-expand { display: none; }
@media (min-width: 769px) {
  .sidebar { transition: margin-left .25s ease; }
  .side-collapsed .sidebar { margin-left: -268px; }
  .side-collapsed .side-expand { display: grid; position: fixed; top: 33px; left: 14px; z-index: 30; width: 34px; height: 34px; color: var(--sub); }
  .side-collapsed .side-expand svg { width: 22px; height: 22px; }
  .side-collapsed .page-top { padding-left: 60px; }
  .side-collapsed .cal-top, .side-collapsed .cal-bar { padding-left: 64px; }
}
.add-task-btn + .nav { margin-top: 0; }
.btn:disabled { color: var(--muted); cursor: default; border-color: var(--line); }
.menu-item:disabled, .menu-item:disabled .lead { color: var(--muted); cursor: default; }
.page-tabs { margin: 20px 0 6px; }

/* ===== アカウント（ログイン・招待・発行）===== */
.auth-mode .sidebar, .auth-mode .bottom-nav, .auth-mode .topbar { display: none !important; }
.auth-mode .main { overflow-y: auto; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(32px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.auth-card { width: min(400px, 100%); }
.auth-logo { margin-bottom: 36px; }
.auth-logo .logo { width: 132px; height: auto; display: block; }
.auth-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.45; }
.auth-lead { margin: 0 0 8px; font-size: 13.5px; color: var(--sub); }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--sub); letter-spacing: .04em; }
.auth-input { height: 46px; padding: 0 14px; border: 1.5px solid var(--input-line); border-radius: 10px; background: transparent; outline: 0; font-size: 15px; color: var(--text); letter-spacing: normal; font-weight: 400; }
.auth-input:focus { border-color: var(--input-line-focus); }
.auth-static { font-size: 15px; font-weight: 400; color: var(--text); letter-spacing: normal; padding: 2px 0; }
.auth-error { font-size: 12.5px; font-weight: 700; color: var(--danger); margin-top: 8px; }
.auth-form .auth-error { margin-top: -4px; }
.auth-btn { justify-content: center; height: 46px; margin-top: 6px; font-size: 14px; }
.auth-note { margin: 18px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.auth-demo { margin-top: 32px; padding: 14px 16px 6px; border-radius: 12px; background: var(--side); }
.auth-demo-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; font-size: 12.5px; font-weight: 700; }
.auth-demo-head small { font-size: 11.5px; font-weight: 400; color: var(--muted); letter-spacing: .04em; }
.auth-demo-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 0; border-top: 2px solid var(--bg); text-align: left; font-size: 13.5px; color: var(--text); }
.auth-demo-item small { font-size: 12px; color: var(--sub); }
.mtag { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 6px; background: var(--fill); font-size: 11px; font-weight: 500; line-height: 20px; color: var(--sub); letter-spacing: .04em; vertical-align: 2px; }
.page-head h1 .mtag { font-size: 12px; vertical-align: 4px; }
.issue-who { display: flex; flex-direction: column; margin: 8px 0 16px; font-size: 14px; }
.issue-who span { font-size: 12.5px; color: var(--sub); }
.issue-link { display: flex; gap: 8px; align-items: center; }
.issue-link .line-input { flex: 1; min-width: 0; padding-right: 14px; font-size: 12.5px; color: var(--sub); }
.btn.plain.danger { color: var(--danger); padding-left: 0; }

/* 確認のポップアップ（設定などのポップアップより手前に出す） */
#ask { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
#ask[hidden] { display: none; }
.ask-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fade-in .15s ease; }
.ask-box { position: relative; width: min(380px, 100%); padding: 26px 26px 18px; border-radius: 16px; background: var(--bg); animation: panel-in .2s cubic-bezier(.2, .8, .2, 1); }
.ask-title { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.6; }
.ask-sub { margin: 6px 0 0; font-size: 13px; color: var(--sub); white-space: pre-line; }
.ask-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@keyframes slide-next { from { transform: translateX(24px); opacity: .3; } }
@keyframes slide-prev { from { transform: translateX(-24px); opacity: .3; } }

/* タスクの一覧：期限ごとのカード（影なし・薄い枠線） */
.tgroups { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.tgroup { border: 2px solid var(--line); border-radius: 14px; padding: 0 18px; }
.tgroup-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 0 12px; border-bottom: 2px solid var(--line); }
.tgroup-head b { font-size: 15px; font-weight: 700; }
.tgroup-head .n { font-size: 13px; color: var(--sub); }
.tgroup-head small { margin-left: auto; font-size: 12px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.tgroup.over .tgroup-head b, .tgroup.over .tgroup-head .n { color: var(--danger); }
.tgroup .tasks .task:last-child { border-bottom: 0; }
.tgroup-empty { padding: 14px 0 16px; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.tgroups + .add-inline { margin-top: 10px; }
@media (max-width: 768px) {
  .tgroups { gap: 10px; margin-top: 18px; }
  .tgroup { padding: 0 14px; }
}

/* プロジェクトページ：セクションの一覧（カードの中の行） */
.proj-page .stats-grid { margin-bottom: 4px; }
.proj-page .page-tabs { margin-top: 24px; }
.proj-page .tgroups { margin-top: 12px; }
.srows { list-style: none; margin: 0; padding: 0; }
.srow { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 2px solid var(--line); cursor: pointer; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.srow:last-child { border-bottom: 0; }
.srow.dragging { transition: none; z-index: 5; background: var(--bg); }
.srow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow-main b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-main small { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-count { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-size: 12px; line-height: 1.6; color: var(--sub); letter-spacing: .04em; }
.srow-count b { margin: 0 3px; font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: normal; }
.srow-count small { font-size: 11.5px; color: var(--muted); }
.srow-count em { font-style: normal; color: var(--danger); font-weight: 700; }
.srow.arch .srow-main b { color: var(--sub); }
@media (max-width: 768px) {
  .srows > .srow { gap: 10px; }
  .proj-page .page-tabs { margin-top: 18px; }
}

/* 起動画面（スマホ／ホーム画面から開いたとき）：ロゴを表示してからアプリへ */
#splash { display: none; }
html.splash-on #splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .45s ease; }
#splash .logo { width: 156px; height: auto; display: block; animation: splash-in .6s cubic-bezier(.2, .8, .2, 1) both; }
#splash.out { opacity: 0; pointer-events: none; }
@keyframes splash-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }

/* 一覧：見出しはカードの外。タスク・セクション・プロジェクトを1件ずつ線枠のカードに（角丸は控えめ） */
.logo { stroke: none; } /* ロゴに線（黒い縁）が付かないように */
.stat { border: 1.5px solid var(--input-line); background: transparent; border-radius: 10px; padding: 14px 16px; }
.tgroups { gap: 26px; }
.tgroup { border: 0; background: none; border-radius: 0; padding: 0; }
.tgroup-head { border-bottom: 0; padding: 0 2px 10px; align-items: center; }
/* 見出しの頭に小さな点（今日はオレンジ、期限切れは赤、ほかはグレー） */
.tgroup-head::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; margin-right: 2px; align-self: center; }
.tgroup.today .tgroup-head::before { background: var(--accent); }
.tgroup.over .tgroup-head::before { background: var(--danger); }
.tgroup-head .n { min-width: 22px; padding: 0 7px; border-radius: 6px; background: var(--fill); font-size: 12px; line-height: 20px; text-align: center; color: var(--sub); }
.tgroup.over .tgroup-head .n { color: var(--danger); }
.tgroup-body { border: 0; padding: 0; }
.tgroup-empty { padding: 16px 18px; border: 1.5px dashed var(--input-line); border-radius: 10px; }

/* 1件ずつのカード（タスク：インボックス・セクション・タスク・メンバーなどすべての一覧） */
.view:not(.cal-view) .tasks { display: flex; flex-direction: column; gap: 8px; }
.view:not(.cal-view) .tasks > .task { border: 1.5px solid var(--input-line); border-radius: 10px; padding: 16px 18px; background: var(--bg); }
.view:not(.cal-view) .tasks > .task:has(+ .task-subs) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-width: 0; }
.view:not(.cal-view) .tasks > .task-subs { margin-top: -8px; border: 1.5px solid var(--input-line); border-top: 0; border-radius: 0 0 10px 10px; padding: 0 18px 12px 50px; }
.view:not(.cal-view) .tasks + .add-inline, .tgroups + .add-inline { margin-top: 6px; }
/* セクション・プロジェクトの行もカードに */
.srows, .proj-list { display: flex; flex-direction: column; gap: 8px; }
.tgroup .srow, .proj-list > .proj-row { border: 1.5px solid var(--input-line); border-radius: 10px; background: var(--bg); }
.tgroup .srow { padding: 16px 12px 16px 18px; }
.proj-list > .proj-row { padding: 16px 18px; }
.tgroup-body .add-inline { padding: 12px 4px; border-top: 0; }
@media (max-width: 768px) {
  .tgroups { gap: 22px; }
  .view:not(.cal-view) .tasks > .task { padding: 14px 14px; }
  .view:not(.cal-view) .tasks > .task-subs { padding: 0 14px 12px 46px; }
  .tgroup .srow { padding: 14px 10px 14px 14px; }
  .proj-list > .proj-row { padding: 14px; }
}

/* 起動画面のロゴは大きさを固定して、画面の真ん中に置く */
#splash .logo { position: absolute; inset: 0; margin: auto; width: 156px; height: 38px; }
/* ホーム画面のアプリでは上の時計の帯の分だけ下に寄って見えるので、少し上げる */
@media (display-mode: standalone) { #splash .logo { bottom: 52px; } }

/* 見出しを少し大きく、チェックの○はカードの上下中央に */
.tgroup-head b { font-size: 16.5px; }
.tgroup-head .n { font-size: 12.5px; }
.tgroup-head small { font-size: 12.5px; }
.view:not(.cal-view) .tasks > .task { align-items: center; }
.view:not(.cal-view) .tasks > .task > .check { margin-top: 0; }
.view:not(.cal-view) .tasks[data-sortable] > .task { transition: transform .22s cubic-bezier(.2, .8, .2, 1); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.view:not(.cal-view) .tasks[data-sortable] > .task.dragging { transition: none; z-index: 5; position: relative; }

/* サブタスクの開閉矢印はカードの左の余白に置き、ほかの一覧と中身の位置をそろえる */
.view:not(.cal-view) .tasks > .task { position: relative; }
.view:not(.cal-view) .tasks > .task > .subs-btn { position: absolute; left: 1px; top: 50%; transform: translateY(-50%); width: 16px; margin: 0; }
.view:not(.cal-view) .tasks > .task > .subs-btn-space { display: none; }

/* プロジェクトページのセクション（案件）カード */
.tgroup .srow.srow-rich { align-items: flex-start; padding: 18px 12px 16px 20px; }
.srow-rich .srow-main { gap: 4px; }
.srow-rich .srow-name { font-size: 16px; font-weight: 700; line-height: 1.5; white-space: normal; }
.srow-memo { margin: 0; font-size: 13px; line-height: 1.75; color: var(--sub); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srow-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--sub); letter-spacing: .04em; }
.srow-foot b { color: var(--text); font-weight: 700; }
.srow-foot .over { color: var(--danger); font-weight: 700; }
.srow-prog { display: inline-flex; align-items: center; gap: 8px; }
.srow-prog .bar { width: 72px; flex: none; height: 5px; }
.srow-rich .act-dd { margin-top: -4px; }
@media (max-width: 768px) {
  .tgroup .srow.srow-rich { padding: 16px 8px 14px 16px; }
  .srow-foot { gap: 4px 12px; }
}

/* 空の一覧（点線の枠） */
.empty-box { padding: 16px 18px; border: 1.5px dashed var(--input-line); border-radius: 10px; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.view .empty-box + .add-inline, .view .empty-box + .add-form { margin-top: 6px; }
.tgroups + .empty-box { margin-top: 24px; }
.proj-tabs + .empty-box, .page-tabs + .empty-box, .page-tabs + .proj-loose .empty-box { margin-top: 12px; }
#sidebar .empty-box { margin: 2px 4px; padding: 10px 12px; font-size: 12px; }
.page-tabs + .tasks { margin-top: 12px; }

/* 「セクションを追加」：タスクの追加と区別して、オレンジは使わない */
.add-inline.add-neutral { color: var(--sub); }
.add-inline.add-neutral .plus-dot { background: transparent; border: 1.5px solid var(--sub); color: var(--sub); }
.srows + .add-inline, .empty-box + .add-inline.add-neutral { margin-top: 6px; }

/* 戻る／進むでページを少しスライド */
.view.slide-prev, .page-top.slide-prev, .page-top.slide-prev + .view { animation: slide-prev .25s ease; }
.view.slide-next, .page-top.slide-next, .page-top.slide-next + .view { animation: slide-next .25s ease; }

/* ログイン画面：パスワード再設定のリンク・読み込み中 */
.auth-link { margin-top: 14px; padding: 0; font-size: 12.5px; color: var(--sub); text-decoration: underline; letter-spacing: .04em; }
.auth-loading { margin-top: 8px; color: var(--muted); }
.btn:disabled { opacity: .6; }

/* サブタスク：いつも表示。先頭に横棒を付けて、親タスクの下に入っていることが分かるように */
.view:not(.cal-view) .tasks > .task-subs { padding: 0 18px 12px 20px; }
.task-subs .sub { gap: 8px; }
.task-subs .sub::before { content: ""; width: 12px; height: 1.5px; border-radius: 1px; background: var(--input-line); flex-shrink: 0; }
@media (max-width: 768px) {
  .view:not(.cal-view) .tasks > .task-subs { padding: 0 14px 12px 16px; }
  /* ピンチで画面が拡大・移動しないように（スクロールはそのまま） */
  html, body, .main { touch-action: pan-x pan-y; }
}
