/* Desk の画面。Ink v2.1（ink.css）の上に Glass Gradient の白（glass-white.css。00_global/design/glass-gradient-design-system/glass-white-app.css の写し）を重ね、
   このファイルでタスクの行・上の帯・追加と編集のシート・取り消しの知らせだけを足す（2026-11-29 作成・AI）。
   色・線・角丸・影は --ink-*・--gw-* を使い、ここに値を直書きしない（寸法と、白いガラスの透け具合だけ）。
   ライトだけ。艶のある黒は「選択中」（区分・Project）と「主の操作」（足す・保存）・「完了の箱」だけ */

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
/* ボタンの初期化は効きを 0 にする（ink-btn・ink-icon-btn の線や黒い地を消さない） */
:where(.ink-ui) :where(button) { border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; font: inherit; color: inherit; }
:where(.ink-ui) :where(button:disabled) { cursor: default; }
body.is-sheet { overflow: hidden; }

/* ---------- 枠: スマホ 1 カラム ---------- */
.dk { min-height: 100dvh; }
.dk-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* 上の帯（すりガラス・上に残る） */
.dk-head {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--gw-glass-strong); border-bottom: 1px solid var(--gw-glass-edge);
  box-shadow: 0 10px 24px -20px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: var(--gw-blur); backdrop-filter: var(--gw-blur);
}
.dk-head .dk-wrap { display: flex; flex-direction: column; gap: var(--ink-sp-3); padding-top: 14px; padding-bottom: 12px; }
.dk-titlebar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--ink-sp-3); }
.dk-brand { font-size: 17px; font-weight: 600; letter-spacing: -.03em; color: var(--ink-text); }
.dk-today { font-size: var(--ink-fs-sm); color: var(--ink-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ink-ui .dk-refresh { width: 40px; height: 40px; border-radius: 999px; }
.dk-refresh.is-spin .ink-ic { animation: dk-spin .9s linear infinite; }
@keyframes dk-spin { to { transform: rotate(360deg); } }

/* 区分（今日・予定・日付なし・完了）。横に収まらなければ横に送る */
.ink-tabs.dk-tabs { display: flex; width: 100%; }
.dk-tabs .ink-tab { flex: 1 0 auto; justify-content: center; height: 38px; padding: 0 14px; gap: 6px; }

/* Project の絞り込み（横に送る） */
.dk-chips { display: flex; gap: var(--ink-sp-2); overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.dk-chips::-webkit-scrollbar { display: none; }
.dk-chips .ink-chip { flex: none; }
.dk-chips--wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }

/* ---------- 一覧 ---------- */
.dk-main { display: flex; flex-direction: column; gap: var(--ink-sp-2); padding-top: var(--ink-sp-3); padding-bottom: calc(env(safe-area-inset-bottom) + 112px); }
.dk-status { min-height: 18px; font-size: var(--ink-fs-sm); line-height: 18px; color: var(--ink-text-3); }
.dk-status.err { color: var(--ink-text); font-weight: 600; }
#list { display: flex; flex-direction: column; gap: var(--ink-sp-5); }

.dk-group-h { display: flex; align-items: baseline; gap: var(--ink-sp-2); margin: 0 4px var(--ink-sp-2); font-size: var(--ink-fs-md); font-weight: 600; color: var(--ink-text); }
.dk-group-sub { font-size: var(--ink-fs-sm); font-weight: 400; color: var(--ink-text-3); }
.dk-group-count { margin-left: auto; font-size: var(--ink-fs-sm); font-weight: 500; color: var(--ink-text-3); }

.ink-panel.dk-rows { list-style: none; margin: 0; padding: 4px 8px; }
.dk-row { display: flex; align-items: flex-start; gap: 4px; }
.dk-row + .dk-row { border-top: 1px solid var(--ink-line); }

/* 完了の箱（未完了＝線の箱、完了＝艶のある黒の箱＋白い印）。押せる広さは 48px */
.ink-ui .dk-box { position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 56px; border-radius: var(--ink-r-sm); }
.dk-box::before {
  content: ""; width: 24px; height: 24px; border: 1.5px solid var(--ink-line-2); border-radius: 8px; background: rgba(255, 255, 255, .85);
  transition: background-color .12s, border-color .12s;
}
.dk-box[aria-pressed="true"]::before { border-color: transparent; background: var(--ink-black); box-shadow: var(--ink-black-shadow-sm); }
.dk-box[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 21px; top: 21px; width: 6px; height: 11px;
  border: solid var(--ink-on-black); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ink-ui .dk-box:active::before { background: var(--ink-fill-2); }

.ink-ui .dk-item {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 56px; padding: 15px 8px 14px 2px; border-radius: var(--ink-r-sm); text-align: left;
}
.ink-ui .dk-item:active { background: var(--ink-fill); }
.dk-name { font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--ink-text); overflow-wrap: anywhere; }
.dk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.dk-due, .dk-proj { font-size: var(--ink-fs-sm); line-height: 1.4; color: var(--ink-text-3); }
.dk-due.is-over { color: var(--ink-text); font-weight: 600; }
.dk-meta .ink-badge { height: 22px; padding: 0 8px; }
.dk-row:has(.dk-box[aria-pressed="true"]) .dk-name { color: var(--ink-text-3); text-decoration: line-through; text-decoration-color: var(--ink-line-2); }
.dk-row.is-saving { opacity: .55; }

.dk-empty { min-height: 160px; }
.dk-foot { display: flex; justify-content: center; padding-top: var(--ink-sp-5); }
.dk[aria-busy="true"] #list { opacity: .5; transition: opacity .2s; }

/* 足すボタン（右下・艶のある黒の丸） */
.dk-fab {
  position: fixed; right: max(16px, calc((100vw - 640px) / 2 + 16px)); bottom: calc(env(safe-area-inset-bottom) + 20px); z-index: 12;
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px;
  background: var(--ink-black); color: var(--ink-on-black); box-shadow: var(--ink-black-shadow);
}
.ink-ui .dk-fab { background: var(--ink-black); }
.dk-fab .ink-ic { width: 24px; height: 24px; stroke-width: 1.8; }

/* 取り消しの知らせ（足すボタンの左） */
.dk-toast {
  position: fixed; left: max(16px, calc((100vw - 640px) / 2 + 16px)); right: max(88px, calc((100vw - 640px) / 2 + 88px));
  bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 12;
  display: flex; align-items: center; gap: var(--ink-sp-3); min-height: 48px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--gw-glass-edge); border-radius: 999px; background: var(--gw-float); box-shadow: var(--ink-float-shadow);
  -webkit-backdrop-filter: var(--gw-blur); backdrop-filter: var(--gw-blur);
}
.dk-toast > span { flex: 1; min-width: 0; font-size: var(--ink-fs-sm); color: var(--ink-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ink-ui .dk-toast-btn { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ink-fill-2); font-size: var(--ink-fs-sm); font-weight: 600; color: var(--ink-text); }

/* ---------- 追加・編集のシート（スマホは下から、広い画面は真ん中） ---------- */
.dk-scrim { position: fixed; inset: 0; z-index: 30; background: var(--ink-scrim); }
.dk-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px calc(env(safe-area-inset-bottom) + 20px);
  background: rgba(255, 255, 255, .97); border-top: 1px solid #fff; border-radius: var(--ink-r-float) var(--ink-r-float) 0 0;
  box-shadow: var(--ink-float-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
}
@media (min-width: 621px) {
  .dk-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, calc(100vw - 48px)); transform: translate(-50%, -50%);
    padding: 28px 28px 24px; border: 1px solid #fff; border-radius: var(--ink-r-float);
  }
}
.dk-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ink-sp-4); margin-bottom: var(--ink-sp-4); }
.dk-sheet-head h2 { margin: 0; font-size: var(--ink-fs-lg); font-weight: 600; letter-spacing: -.01em; }
.ink-ui .dk-sheet-head .ink-icon-btn { width: 40px; height: 40px; border-radius: 999px; }
.dk-form { display: flex; flex-direction: column; gap: var(--ink-sp-5); }
.dk-form .ink-input, .dk-form .ink-textarea { font-size: 16px; } /* iOS の自動ズームを防ぐ */
.dk-name-input { min-height: 0; resize: none; line-height: 1.6; }
.dk-datepick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ink-sp-2) var(--ink-sp-3); }
.dk-datepick .dk-chips { margin: 0; padding: 0; overflow: visible; }
.ink-input.dk-date { width: auto; min-width: 160px; height: 40px; }
.dk-seg { align-self: flex-start; }
.dk-seg .ink-seg-btn { height: 36px; padding: 0 16px; font-size: var(--ink-fs-base); }
.dk-form-err { min-height: 0; margin: 0; font-size: var(--ink-fs-sm); font-weight: 600; color: var(--ink-text); }
.dk-form-err:empty { display: none; }
.dk-sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--ink-sp-4); }
.dk-sheet-foot .ink-btn { min-width: 120px; height: 44px; margin-left: auto; }

/* ---------- ログイン ---------- */
.dk-login { display: grid; place-items: center; min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 24px); }
.dk-login .ink-form-card { gap: 18px; }
.dk-login .dk-brand { font-size: var(--ink-fs-lg); }
.dk-login form { display: flex; flex-direction: column; gap: 14px; }
.dk-login .ink-input { font-size: 16px; }
.dk-login .ink-error { display: none; }
.dk-login .ink-error.show { display: block; }

@media (min-width: 621px) {
  .dk-wrap { padding-left: 24px; padding-right: 24px; }
  .dk-chips { margin: 0 -24px; padding: 0 24px; }
  .dk-chips--wrap { margin: 0; padding: 0; }
}
@media (max-width: 380px) {
  .dk-tabs .ink-tab { padding: 0 10px; }
}
